for OSX

Manual Steps (Tested on Yosemite VM)

  1. Install XCode
  2. Jhbuild install and update Python:
    export PATH=~/.local/bin:~/gtk/inst/bin:$PATH
    jhbuild build bootstrap
    jhbuild build python
    • Uncomment _gtk_osx_use_jhbuild_python = True in .jhbuildrc-custom.
  3. GTK OSX Build:
    jhbuild build meta-gtk-osx-bootstrap
    1. PyGTK (Includes meta-gtk-osx-core)
      jhbuild build libglade
      jhbuild build meta-gtk-osx-python
    2. GTK OSX Themes:
      jhbuild build meta-gtk-osx-themes
      jhbuild build gtk-quartz-engine
  4. Bundler for Packaging Deluge.
    tar xf gtk-mac-bundler-0.7.4.tar.xz
    cd gtk-mac-bundler-0.7.4
    make install
  5. Build libtorrent and deps using libtorrent.modules:
    jhbuild -m libtorrent.modules build meta_libtorrent 
    • OpenSSL requires "Skip Module (2)" when install stage fails as unable to use DESTDIR path. See patch.
    • Note on potential OpenSSL Error: 'libcrypto is a fat file' is due to mixing arch types (i386, x64) in build process.
  6. Install Deluge dependencies using pip:
    jhbuild shell
    pip install twisted[tls] chardet mako pyxdg setproctitle pillow py2app cython
    pip install rencode
    pip install setuptools==19.2
    • Note1: pygame for Notifications plugin need installed separately.
    • Note2: rencode requires cython before attempting pip install. (rencode issue)
    • Note3: Due to bug in setuptools require version 19.2 (setuptools issue)
  7. Install and package Deluge:
    1. If using release tarball download required setup.cfg and osx directory from git, run commands in deluge source directory:
      wget --content-disposition
      wget -rnd -np -e robots=off --reject "index.html*" --content-disposition -P osx
    • Note: In setup.cfg need to remove 'dev' line and set arch to 'x86_64'.
    1. Build and install Deluge using py2app:
      jhbuild shell
      python py2app
      python install
      • For error dyld_find() got an unexpected keyword argument 'loader' either uninstall pillow or patch
    2. Package Deluge into app in osx/app/ using gtk-mac-bundler script:
      jhbuild shell
      cd osx
  8. Optionally create dmg image:
    hdiutil create -format UDBZ -srcfolder -volname deluge-1.3.13-osx-x64-0 deluge-1.3.13-osx-x64-0.dmg

Old Semi-Automated Guide

Instructions for building
1. Compiler
- To build deluge and the gtk osx modules, you must use `gcc`
- This has been successfully working with :
    - gcc 4.2.1 - Xcode 4.1 - Mac OSX Lion (10.7.2)
    - llvm-gcc 4.2.1 - Xcode 4.3.1 (With Command line utilities) - Mac OSX Lion (10.7.3)
- Check your version of gcc using `gcc -v`
2. GTK-OSX jhbuild environment
Quick how-to *(from the full GTK-OSX building instructions)* [1]_, [2]_
a. Create a dedicated user account and use it for all the next steps::
        sudo su - gtk
        cat << EOF > ~/.profile
        export PATH=~/.local/bin:~/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/git/bin
        . ~/.profile
  *Note*: I'm using `gtk` login with `/opt/gtk` as home an jhbuild prefix.
b. Download and run the gtk-osx-build-setup [3]_ script to install jhbuild::
        curl -O
c. Link or copy deluge osx jhbuildrc-custom::
        ln -sf deluge/osx/jhbuildrc-custom ~/.jhbuildrc-custom
  *Note*: This setup builds only for `x86_64` arch to `/opt/gtk` prefix, feel free to edit.
d. Build jhbuild and its modulesets: *(takes a while...)*::
        jhbuild bootstrap && jhbuild
  *Note*: If you encounter an error while building `glib` like::
        gconvert.c:65:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv
  Start a shell from jhbuild, edit the file `vim glib/gconvert.c +65` to delete the
  section raising error, which is irrelevant. *(Lion iconv.h looks like gnu one, but it is not)*
  Then exit the shell and resume build.
5. Build the deluge moduleset: *(takes a while...)*::
        jhbuild -m deluge/osx/deluge.modules build deluge
  *Note*: This jhbuild moduleset *should* build and install all deluge dependencies not available in gtk-osx.
3. Build
a. Always do your custom build operations under a jhbuild shell::
        jhbuild shell
b. Cleanup::
        python clean -a
c. Build and install::
        python py2app
        python install
d. Build app to `deluge/osx/app/`::
        cd osx
You *should* now have a working
i386 Notes
- Uncomment the relevant sections of :
    - jhbuildrc-custom
    - deluge.modules
    - setup.cfg
- deluge egg has to be named without the -macosx-10.6-intel suffix
- To build for i386 under a x64 arch libtorrent python bindings have to be
  patched manually to set correct arch see macports package patch
If doesn't work or crash the first thing to do is to check OSX
Console for logs and/or crash reports.
You can enable logging by passing the usual log command switches via console::
        /Applications/ -L debug -l debug.log
Recent jhbuild issues:
- Some jhbuild modules fails to build, freetype and gtk-mac-integration,
  strangely configure is not called before build/install.
- If that happens, just force rebuild with something like:
        jhbuild build -cf gtk-mac-integration-python
-  Interrupt while building with Ctrl+C and wipe to start over if configure missing
Known issues
- **i386**: libtorrent crash
- **i18n**: English only for now
- **Magnet URLs**: Not currently supported by GTK-OSX
.. [1]
.. [2]
.. [3]
.. [4]
.. [5]
.. [6]

Last modified 5 years ago Last modified on 07/22/2016 12:27:54 PM