Unofficial Deluge 2 for Windows 7 + 10

Specific support for Deluge on Microsoft Windows OS
Post Reply
fmar
Leecher
Leecher
Posts: 74
Joined: Sun Mar 08, 2020 5:34 pm

Unofficial Deluge 2 for Windows 7 + 10

Post by fmar »

Since Python 3.9 doesn't support Windows 7 anymore and mhertz stopped with his Windows 7 builds, I decided to set up a VM for my own needs and build a current version of Deluge. Also started a Windows 10 build until @petersasi resumes with his builds.

I do use the stable version myself, so I would consider it "beta stable" ;)
As for the development version: I start it with a torrent and see if the download and upload is working. That's about it.

The installer includes the option to select from three different libtorrent versions, the 7z package contains only the current libtorrent version.

:!: Please make a backup before updating :!:

I can't really provide any support or help, since I don't know much about Python. But I'll try my best.

Thank you @mhertz for providing his build scripts on GitHub, I might have some questions now and again :)

Current versions: Deluge dev70/dev84, GTK 3.24.30, libtorrent 1.2.14, Python 3.9.7 (Windows 10), 3.8.12 (Windows 7), OpenSSL 1.1.1l

Edit 2021-10-09: new Windows 7 and 10 dev84 builds, preferences window works again.

Mega Cloud - Windows 7
Google Drive - Windows 7

Mega Cloud - Windows 10
Google Drive - Windows 10

Changelog: https://pastebin.com/UQ7btzbg
Last edited by fmar on Fri Oct 08, 2021 10:17 pm, edited 29 times in total.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Unofficial Deluge 2 for Windows 7

Post by mhertz »

Nice, cool initiative, thank you for providing this mate, and of-course, just drop me a line if in doubt of something and i'll explain. :)

@all, just wanted to add that there's two issues I found with the "win7"(python <3.9) versions, and also is there when building manually from source, so not something I introduced - If having classic mode enabled in win7 then you need select other deluge theme than the default during install, as else the deluge GTKUI is borked and looks strange, and all others work from installer. Then there's an issue if having a second CD or external whatever drive added and used a disc or whatever and not having rebooted, which in that case will show error when starting deluge about insert disc in drive a or something - this can be avoided by after ejecting a disc from said drive, then rigtclick drive and select eject in windows explorer(I know empty but regardless), so windows shows error as empty already, but then afterwards deluge works again, and will not show this error again untill entering disc again in which will need workaround repeated unless having rebooted afterwards sometime. Could also just reboot of-course, but other workaround nicer. This never happens on win10 for some reason, even with exact same installer strangely, and i've spent many hours trying to find what triggers this i.e. run deluge in debugger and traced diffs of api calls between win10 and win7 eject commands, and googled the f out of it in general(and is an issue reported on many different projects btw previously i.e. "insert disk in drive a" error, or whatever drive letter used), but to no avail unfortunetly. Just a heads-up.

BTW, win10 etc users can also use this if wanted, as only "win7" about this, compared to "win10" builds, is little bit older python and no win10 titlebar-button changes in default and Mantis-dark theme.

Thanks again fmar :)
fmar
Leecher
Leecher
Posts: 74
Joined: Sun Mar 08, 2020 5:34 pm

Re: Unofficial Deluge 2 for Windows 7

Post by fmar »

@mhertz: Thank you for adding you thoughts. I totally forgot about those display issues, since I'm using my own settings.ini and theme.
The optical drive error bugged me for a while, never figured out why Windows did that too.

Anyway, I consider this a work in progress, a living thing if you will. Let it live a little :lol:

Well, as for you scripts: I changed some bits in the Deluge build script. Mainly the combined Git clone and pip install line. The reason for this being, that I wanted to use git apply instead of the GNU patch utility.

It all works fine: I clone the repo from Git, apply the patches through git apply and install the local repo with Pip.
Now Pip tells me that this functionality (installing from a local repo) will soon be deprecated:

Code: Select all

  DEPRECATION: A future pip version will change local packages to be built in-pl
ace without first copying to a temporary directory. We recommend you use --use-f
eature=in-tree-build to test your packages with this new behavior before it beco
mes the default.
   pip 21.3 will remove support for this functionality. You can find discussion
regarding this at https://github.com/pypa/pip/issues/7555.
The issue on Github goes on about the use of $TMPDIR on Linux, but that doesn't apply to Windows.
On Windows Pip creates a temporary repo inside the %TEMP% directory with some random string added, like "C:\Users\deluge\AppData\Local\Temp\pip-req-build-5pxoo_ud".

What I would like to know: is there any way to get ahold of that directory or directory name?
Am I able to modify the temporary repository that Pip uses for the installation?

I tried to figure it out, but couldn't find any good (or understandable) information on it. I really want to apply the patches with git apply, since it's way easier and it also is able to change multiple files at once.

As additional information, here's what I changed in your script:

Instead of:

Code: Select all

python\Scripts\pip install git+https://github.com/deluge-torrent/deluge
I use:

Code: Select all

git clone -b master --single-branch https://github.com/deluge-torrent/deluge deluge-build\stable
curl https://github.com/deluge-torrent/deluge/commit/48040b1fe76e17e0776418bfd8bc88bd27013a84.patch | git apply --directory="deluge-build/stable"
python\Scripts\pip install "deluge-build/stable"
Sorry for the long winding post :?
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Unofficial Deluge 2 for Windows 7

Post by mhertz »

I believe only way, now that --build/-b is deprecated, is to change %temp% env-var, just like changing TMPDIR on linux, so with set or setx(if need to be system env-var and not regular env-var of user), though atleast for setx needs reinitialize cmd afterwards, which there's ways to do, but don't really know from top of head currently. Anyway, then just extract the dir under %temp% with a dir command wrapped in a FOR loop, as used in deluge-build scripts to get name of deluge-dir etc. Sorry cannot really test directly, as not have my windows VMs anymore, as said in other thread.

However, I don't understand why you even need this, since you say it works fine now, and then later pip will change to build in-place and not be copied into %temp%, but maybe i'm misunderstanding something. Have you tested the new functionality about if there's issues, with --use-feature=in-tree-build. I mean, if you don't need the temp dir now, then why later when it's not copied into %temp% anymore?

Last, honestly I don't understand why you want to avoid gnu patch of msys2 for git apply. To me they are interchangeble i.e. both use same amount of command-lines and time to run(and I just initially defined file to patch when only single file modified in a patch, though stopped doing this later on, as redundant), but anyway that is besides the point and what's important of-course is what you prefer yourself :) Anyway, if cloning the git repo like you do, then might as well as you said, omit the msys2 additional patch dep, and instead use git apply directly, so for that I can of-course see the advantage for that. Anyway just wanted to explain gnu patch isn't inferior, slower or less easy imho, but again your choise entirely of-course and should use what you deem best obviously.

Good job regarding your edits to first post! :)

Edit(s): Okay after rereading your post again, then I was too dense to understand before, sorry :) I now understand that you're asking how use git-apply through my method, as you wan't that for when pip changes functionality, though as I understand it, you should still be able to use your method, as only change is that no intermittent copy to %temp% happening and so instead build happens direct in clone dir/in-place, so no reason to change imho.

However, if needed regardless then as per your specific question about getting pip's tmp-dir name/path, then something along:

Code: Select all

set temp=%cd%
python\scripts\pip install git+....
for /f %%i in ('dir /b pip-req-build-*') do set pipdir=%%i 
Hmm, come to think of it, then don't even need change %temp% unless actually preferring it, and e.g. just do instead to get that tmp dir from pip:

Code: Select all

for /f %%i in ('dir /b /ad /od %temp%\pip-req-build-*') do set pipdir=%%i 
Though if using my method, then clones and builds at once, so you have no time to run git-apply in between, but as said all this shouldn't even be needed and just continue with your way simply. With my method, you could use pip's download instead of install(git supported there also), then git-apply and then pip install, but same scenario as before. Could also just clone dir, git apply and use python setup.py build and python setup.py install.

About your ipv6 patch giving error, then I guess it's because you use my modded patch which I apply only to the dev build(wanted to keep the stable build as stable/vanilla as possible), as I just tested and when used like you do then fails in one of the files to patch i.e. when used from local git-repo and not as I do afterwards a pip install run, where no fail. In my scripts I downloaded that patch file instead of using curl directly, because changed one of the referenced files as name changes when installed vs in a git clone dir as you do(and as original patch), plus another change making the geoip files be used from current dir always, when the defined path not found(linux path by default). If you apply the patch with curl i.e. apply unmodified, then no errors I just checked. However, the only thing currently missing with the single fail and my modded patch, is that there's no ipv6 geoip file to select path to in webui preferences, but as said I already hardcoded fallback to current dir regardless, where I have them placed in, so irrelevant. If wanting keep my patch, and wanna fix that error when used from git-clone dir, then I just fixed it up for ya just in case: https://paste.c-net.org/GunshotsImage I only tested it on clean master(stable 2.0.3) on my linux system however. BTW, Strangelovian's in/out patch/PR bypasses is_ip() so the doadin is_ip() patch is irrelevant imho, unless I'm misunderstanding something. Strangelovian stated he would add back is_ip() support to work together with doadin's patch, but never did, probably because doadin stated best to wait and see what Cas thought firstly. Doesn't hurt neither of-course to include.
fmar
Leecher
Leecher
Posts: 74
Joined: Sun Mar 08, 2020 5:34 pm

Re: Unofficial Deluge 2 for Windows 7

Post by fmar »

Hey @mhertz

Again, thank you for your contribution! I do appreciate it.

Sorry that I am not very active in the forum, but I'll read through your post and get some more knowledge about pip and python and what not.
Cheers
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Unofficial Deluge 2 for Windows 7

Post by mhertz »

Nothing to talk about, but thanks mate :) I'm not very good at neither pip nor python lol, so that's makes two of us then :) Thanks for your post and again ask if need clarification upon anything and thank you yourself for contributing.
therobin
Member
Member
Posts: 10
Joined: Fri Mar 12, 2021 12:00 am

Re: Unofficial Deluge 2 for Windows 7

Post by therobin »

Thanks for this. I can confirm this installer worked for my Windows 7 system just fine when updating from mhertz last build.
fmar
Leecher
Leecher
Posts: 74
Joined: Sun Mar 08, 2020 5:34 pm

Re: Unofficial Deluge 2 for Windows 7

Post by fmar »

@therobin

Thank you for your feedback! I don't use the installer myself, so I'm glad it's working :)
PatriciaAbr
New User
New User
Posts: 4
Joined: Sun Aug 22, 2021 6:39 am

Re: Unofficial Deluge 2 for Windows 7

Post by PatriciaAbr »

Thank you so much! keep up the good work pals
fmar
Leecher
Leecher
Posts: 74
Joined: Sun Mar 08, 2020 5:34 pm

Re: Unofficial Deluge 2 for Windows 7

Post by fmar »

PatriciaAbr wrote: Sun Aug 22, 2021 6:43 am
Thank you :D
Post Reply