Building v2.0.4.x on MacOSX Catalina using MacPorts

Support for Deluge on Apple Mac OS
Shadallark
Member
Member
Posts: 21
Joined: Sat Oct 14, 2017 2:43 pm

Building v2.0.4.x on MacOSX Catalina using MacPorts

Postby Shadallark » Fri Mar 13, 2020 1:10 pm

Good day to all of you!

In a recent post (https://forum.deluge-torrent.org/viewtopic.php?f=13&t=55393&start=10#p230847) @Lord-Kamina mentioned having built a .app for MacOSX. I have been using his version as a thin client while I updated my seedbox from 1.3.5 to 2.0.3.

Now I am trying to build my own MacOSX version using the development source code obtained using git (the developer branch) so I can see about playing with some changes to the Thin Client interface. Using the MacPorts port for Deluge (deluge @2.0.3_1+python37) I have started trying to build deluge. The build seems to finish fine but when I try running deluge or deluge-gtk I get the following error telling me that gi is not available:

Code: Select all

Unable to initialize gettext/locale!
'ngettext'
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/deluge-2.0.4.dev23-py3.8.egg/deluge/i18n/util.py", line 118, in setup_translation
    builtins.__dict__['_n'] = builtins.__dict__['ngettext']
KeyError: 'ngettext'
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/deluge-gtk", line 11, in <module>
    load_entry_point('deluge==2.0.4.dev23', 'gui_scripts', 'deluge-gtk')()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/deluge-2.0.4.dev23-py3.8.egg/deluge/ui/gtk3/__init__.py", line 63, in start
    Gtk().start()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/deluge-2.0.4.dev23-py3.8.egg/deluge/ui/gtk3/__init__.py", line 43, in start
    from .gtkui import GtkUI
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/deluge-2.0.4.dev23-py3.8.egg/deluge/ui/gtk3/gtkui.py", line 19, in <module>
    import gi  # isort:skip (Required before Gtk import).
ModuleNotFoundError: No module named 'gi'

I cannot seem to figure out how to get Gtk installed properly on my Mac. I have tried the following:

Code: Select all

pip3 install gi
ERROR: Could not find a version that satisfies the requirement gi (from versions: none)
ERROR: No matching distribution found for gi
pip3 install python-gi
ERROR: Could not find a version that satisfies the requirement python-gi (from versions: none)
ERROR: No matching distribution found for python-gi
pip3 install gtk       
ERROR: Could not find a version that satisfies the requirement gtk (from versions: none)
ERROR: No matching distribution found for gtk

EDIT: I also went to Gtk.org (https://www.gtk.org) but their link to the installation script for Mac OSX took me to a Error 404 page.

Any assistance that you can provide on how to get Gtk setup properly so I can continue building/running deluge on my MacOSX computer would be greatly appreciated. Some notes about my system setup:
  • MacOSX Catalina (v10.15.3)
  • Python 3.7.3
  • Source code for Deluge from developer branch updated this morning

Have a great day everyone!

Shadallark
Running Deluged v2.0.x on a Raspberry Pi 3b running Raspian (Debian Buster) with a Mac OSX Thin Client.

mhertz
Compulsive Poster
Compulsive Poster
Posts: 735
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Building v2.0.4.x on MacOSX Catalina using MacPorts

Postby mhertz » Fri Mar 13, 2020 2:30 pm

Just a few observations/speculations.

I believe the gi package is from the pypi pygobject package, but it's just strange you have this error because I checked that the macports file install py37-gobject3 which should be the same and also install gtk3 for you if missing(the macport).

Keep in mind that on macports they stated in changelog that because py38 had some issues with some deps, then they provide two versions, one for py37 and one for py38.

You state using py37, but the error message states you have py38.

The ngettext error can be fixed I believe, by this arch-linux patch:
https://git.archlinux.org/svntogit/pack ... 06335f5fcc

If continue get unsolvable issues, I'd instead suggest doing the home brew solution proven to work already and with clear instructions curtesy of Pippo and just use deluge git develop instead of 2.0.3:
viewtopic.php?f=13&t=55393&start=10#p230063

Good luck and good day to yourself too :)

mhertz
Compulsive Poster
Compulsive Poster
Posts: 735
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Building v2.0.4.x on MacOSX Catalina using MacPorts

Postby mhertz » Sat Mar 14, 2020 11:16 am

Sorry mate, I stated there where two versions of macports for py37 and py38, but I believe py38 variant was removed recently because dep issues, so sorry for wrong info, and I just read that there where two versions in the bug-ticket section, not changelog. Though still an issue that you use py38 then.

If not wanna use the home brew solution officially suggested by Cas in the deluge docs Mac install section, and refined by Pippo in previous link, then your best bet, if haven't already, is to contact Lord-Kamina as he has used macports for his app, and I just checked his github and he has also stuff for building gtk(though don't think you need that unless wanting, though could be wrong) and such, plus a few deluge fixes and packaging scripts etc though his forked deluge macport didn't have any extra added commits from him, unless It's in another repo of his I didn't check, so seemingly works for him. Honestly I know nothing about Macs and it's ways, so again, I'd suggest PM Lord-Kamina for macports help, if the change to py37 doesn't fix it fully, or change to homebrew with Pippo instructions.

Sorry cannot help better, hope you can figure it out. Good luck again mate :)

Lord-Kamina
New User
New User
Posts: 9
Joined: Sun Dec 22, 2019 4:24 pm

Re: Building v2.0.4.x on MacOSX Catalina using MacPorts

Postby Lord-Kamina » Thu Apr 16, 2020 12:15 am

My changes are in a fork of the deluge repository, not the macports repository; I actually had to change quite a few things, including making a bash script to make the app that more or less works (not 100% though¡, I think).

Essentially, I used macports to get the dependencies (some of which I also had to patch; those patches were submitted to MacPorts but I think most haven't been merged)


Return to “Mac OS”

Who is online

Users browsing this forum: No registered users and 3 guests