Page 1 of 6

Deluge.app (GTK-OSX based)

Posted: Tue Jul 19, 2011 1:31 pm
by Cas
Update: A test release has been created by carbncl Deluge.app, that should work on x64 10.6/10.7 OSX.


I looked into py2app, instead of using macports, but it currently does not work with pygtk, however I found an alternative solution using GTK-OSX.

I started testing earlier this year with OSX 10.6.6 in a Virtualbox VM (iso from leohazard) however running a VM is painfully slow on my machine so I couldn't continue with it. I just found the instructions that I had written down and thought I would share them here in case anyone else wants to try.

The instructions below are based on the details found on these website: GTK-OSX, winswitch and tryton.
  1. Validate that gcc-4.0 and the 10.5 sdk are present

    Code: Select all

    /usr/bin/gcc-4.0 -v
    ls -ld /Developer/SDKs/MacOSX10.5.sdk
  2. Install git

    Code: Select all

    curl -O http://git-osx-installer.googlecode.com/files/git-1.7.2.3-intel-leopard.dmg
    open git-1.7.2.3-intel-leopard.dmg
    sudo installer -pkg /Volumes/Git\ 1.7.2.3\ Intel\ Leopard/git-1.7.2.3-intel-leopard.pkg -target /
    hdiutil eject "/Volumes/Git 1.7.2.3 Intel Leopard"
  3. Create a user just for this build, become that user, and prepare the environment

    Code: Select all

    sudo su - gtkosxbuilder
    cat << EOF > ~/.profile
    export PATH=~/.local/bin:~/gtk/inst/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/git/bin
    export DYLD_FALLBACK_LIBRARY_PATH=~/gtk/inst/lib
    EOF
    . ~/.profile
    
  4. Download and run the gtk-osx build setup script

    Code: Select all

    curl -L -O https://github.com/jralls/gtk-osx-build/raw/master/gtk-osx-build-setup.sh
    sh gtk-osx-build-setup.sh
    
  5. Modify .jhbuildrc-custom

    Code: Select all

    sed -i -e 's/^setup_sdk/#setup_sdk/g' .jhbuildrc-custom
    cat << EOF >> .jhbuildrc-custom
    _gtk_osx_use_jhbuild_python = True
    setup_sdk(target="10.5", sdk_version="10.5", architectures=["i386"])
    os.environ["CC"] = "/usr/bin/gcc-4.0"
    os.environ["DYLD_LIBRARY_PATH"] = ""
    build_policy = "updated-deps"
    modules = [ "meta-gtk-osx-bootstrap", "meta-gtk-osx-core", "meta-gtk-osx-python", "librsvg", "meta-gtk-osx-themes", "gtk-quartz-engine" ]
    EOF
    
  6. Build (This will take a while)

    Code: Select all

    jhbuild bootstrap && jhbuild build

Re: Deluge build using GTK-OSX

Posted: Wed Oct 19, 2011 6:41 pm
by carbncl
Did some work on the mentioned methods and links.
Got some progress with a working jhbuild environment with deluge working in it.

But I have some issues packaging an OSX app, and unfortunately I am not experienced with python.
Right now I'm kinda stuck with pkg_resources errors, from what I understand, this mostly intended to introspect eggs, which I think py2app doesn't support.
(Once again I'm not a python dev and could be completely mistaking)

Does that rings some bells to you Cas?

Re: Deluge build using GTK-OSX

Posted: Thu Oct 20, 2011 9:41 am
by carbncl
I was right see this on py2app mailing list.
Will try the suggested solutions. Some help from a python coder would be appreciated ;)

Re: Deluge build using GTK-OSX

Posted: Thu Oct 20, 2011 5:12 pm
by carbncl
Good news, as someone suggested on py2app mailing list, just copying the egg to the app bundle... works.
Will cleanup my dirty scripts and setup.py... But looks like I now have a working Deluge.app (70MB) ! :)

Re: Deluge build using GTK-OSX

Posted: Thu Oct 20, 2011 5:39 pm
by fancyclown
:o :mrgreen:

Re: Deluge build using GTK-OSX

Posted: Fri Oct 21, 2011 6:37 pm
by carbncl
That's still crashing in classic mode, in libtorrent... will sort this later. But works great with a remote server :)

Just managed to bundle Clearlooks within app, that looks not bad, same as macport gtk-quartz version :
Image

Re: Deluge build using GTK-OSX

Posted: Sat Oct 29, 2011 8:31 am
by serine
I don't anything constructive to add besides saying that it looks nice!

Re: Deluge build using GTK-OSX

Posted: Sat Oct 29, 2011 9:37 am
by carbncl
Sorted the libtorrent issues (was a bad openssl version...), and some others.
Would love some people testing this, that should work on x64 10.6/10.7 OSX...
If that does not, please post error logs / crash reports that you can get from Console.

Re: Deluge build using GTK-OSX

Posted: Sat Oct 29, 2011 5:24 pm
by Cas
Excellent work carbncl. I'm glad my initial work did not got to waste :D

Re: Deluge.app build using GTK-OSX **Test Release Available*

Posted: Sat Oct 29, 2011 10:11 pm
by gmichels
Whoa I'm speechless, it worked flawlessly (thin client mode, have't tried the local daemon). Sure I didn't use it much yet, but so far looks great.

I'll start using this and report back if issues arise.

THANKS FOR YOUR EFFORTS!