diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 21:38:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 21:38:38 +0000 |
commit | 2e2851dc13d73352530dd4495c7e05603b2e520d (patch) | |
tree | 622b9cd8e5d32091c9aa9e4937b533975a40356c /packaging/osx | |
parent | Initial commit. (diff) | |
download | deluge-2e2851dc13d73352530dd4495c7e05603b2e520d.tar.xz deluge-2e2851dc13d73352530dd4495c7e05603b2e520d.zip |
Adding upstream version 2.1.2~dev0+20240219.upstream/2.1.2_dev0+20240219upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/osx')
-rw-r--r-- | packaging/osx/Info.plist.in | 59 | ||||
-rw-r--r-- | packaging/osx/Instructions.md | 48 | ||||
-rw-r--r-- | packaging/osx/README.rst | 127 | ||||
-rwxr-xr-x | packaging/osx/deluge | 79 | ||||
-rwxr-xr-x | packaging/osx/deluge-console | 69 | ||||
-rwxr-xr-x | packaging/osx/deluge-web | 69 | ||||
-rw-r--r-- | packaging/osx/deluge.bundle | 43 | ||||
-rw-r--r-- | packaging/osx/deluge.icns | bin | 0 -> 201047 bytes | |||
-rw-r--r-- | packaging/osx/deluge.modules | 62 | ||||
-rwxr-xr-x | packaging/osx/deluged | 69 | ||||
-rw-r--r-- | packaging/osx/gtkrc | 10 | ||||
-rw-r--r-- | packaging/osx/jhbuildrc-custom | 32 | ||||
-rw-r--r-- | packaging/osx/launchd/org.deluge-torrent.deluge-web.plist | 29 | ||||
-rw-r--r-- | packaging/osx/launchd/org.deluge-torrent.deluged.plist | 29 | ||||
-rw-r--r-- | packaging/osx/libtorrent.modules | 45 | ||||
-rw-r--r-- | packaging/osx/make-app | 49 | ||||
-rw-r--r-- | packaging/osx/torrent.icns | bin | 0 -> 199899 bytes |
17 files changed, 819 insertions, 0 deletions
diff --git a/packaging/osx/Info.plist.in b/packaging/osx/Info.plist.in new file mode 100644 index 0000000..7021497 --- /dev/null +++ b/packaging/osx/Info.plist.in @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleIdentifier</key> + <string>org.deluge</string> + <key>CFBundleName</key> + <string>Deluge</string> + <key>CFBundleIconFile</key> + <string>deluge.icns</string> + <key>CFBundleExecutable</key> + <string>Deluge</string> + <key>CFBundleShortVersionString</key> + <string>%VERSION%</string> + <key>CFBundleVersion</key> + <string>%VERSION%</string> + <key>CFBundleGetInfoString</key> + <string>%VERSION% (c) 2008-%YEAR% Deluge Team http://deluge-torrent.org/</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright 2008-%YEAR% Deluge Team</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>DL##</string> + <key>LSMinimumSystemVersion</key> + <string>10.6</string> + <key>LSUIElement</key> + <string>0</string> + <key>NSHighResolutionCapable</key> + <true/> + <key>CFBundleDisplayName</key> + <string>Deluge</string> + <key>CFBundleDocumentTypes</key> + <array> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>torrent</string> + </array> + <key>CFBundleTypeIconFile</key> + <string>torrent</string> + <key>CFBundleTypeName</key> + <string>BitTorrent Document</string> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>LSHandlerRank</key> + <string>Owner</string> + <key>LSItemContentTypes</key> + <array> + <string>org.bittorrent.torrent</string> + </array> + </dict> + </array> +</dict> +</plist> diff --git a/packaging/osx/Instructions.md b/packaging/osx/Instructions.md new file mode 100644 index 0000000..985052c --- /dev/null +++ b/packaging/osx/Instructions.md @@ -0,0 +1,48 @@ +# Packaging setup with jhbuild + +These are the manual step based upon https://wiki.gnome.org/Projects/Jhbuild/Mac_OS + +If you encounter curl stalling on FTP URLs try disabling `epsv` for curl: +`echo no-epsv >> ~/.curlrc` + +1. Install XCode command line developer tools: + + xcode-select --install + +1. Install jhbuild: + + curl -LO https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/gtk-osx-build-setup.sh + sh gtk-osx-build-setup.sh + jhbuild bootstrap + +1. GTK-OSX Build + + 1. Bootstrap GTK and install PyGTK + + jhbuild build python meta-gtk-osx-bootstrap meta-gtk-osx-python + + 1. GTK OSX Themes: + + jhbuild build meta-gtk-osx-themes gtk-quartz-engine + + Note: [Quartz patch] if build error; `'height' is uninitialized`. + +1. Install [MacOS bundler] script + + This script is to help package GTK for Deluge. + + curl -OL http://ftp.gnome.org/pub/gnome/sources/gtk-mac-bundler/0.7/gtk-mac-bundler-0.7.4.tar.xz + tar xf gtk-mac-bundler-0.7.4.tar.xz + cd gtk-mac-bundler-0.7.4 + make install + +1. Build libtorrent and deps using libtorrent.modules: + + curl -O http://git.deluge-torrent.org/deluge/plain/osx/libtorrent.modules?h=develop + 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 a potential OpenSSL Error: 'libcrypto is a fat file' is due to mixing arch types (i386, x64) in build process. + +[quartz patch]: https://www.xpra.org/trac/attachment/ticket/533/quartz-style-fix.patch +[macos bundler]: https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling diff --git a/packaging/osx/README.rst b/packaging/osx/README.rst new file mode 100644 index 0000000..781b14b --- /dev/null +++ b/packaging/osx/README.rst @@ -0,0 +1,127 @@ +==================================== +Instructions for building Deluge.app +==================================== + +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 + EOF + . ~/.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 https://raw.github.com/jralls/gtk-osx-build/master/gtk-osx-build-setup.sh + sh gtk-osx-build-setup.sh + +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 Deluge.app +------------------- + +a. Always do your custom build operations under a jhbuild shell:: + + jhbuild shell + +b. Cleanup:: + + python setup.py clean -a + +c. Build and install:: + + python setup.py py2app + python setup.py install + +d. Build app to `deluge/osx/app/Deluge.app`:: + + cd osx + ./make-app + +You *should* now have a working Deluge.app + +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 + +Issues +------ + +If Deluge.app 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/Deluge.app/Contents/MacOS/Deluge -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 + +Reference +--------- + +.. [1] http://live.gnome.org/Jhbuild +.. [2] http://live.gnome.org/GTK%2B/OSX/Building +.. [3] http://github.com/jralls/gtk-osx-build +.. [4] http://winswitch.org/dev/macosx.html +.. [5] http://mail.python.org/pipermail/pythonmac-sig/ +.. [6] https://github.com/jralls/gtk-mac-integration diff --git a/packaging/osx/deluge b/packaging/osx/deluge new file mode 100755 index 0000000..023977f --- /dev/null +++ b/packaging/osx/deluge @@ -0,0 +1,79 @@ +#!/bin/bash + +EXEC="exec" + +name="`basename $0`" +if [[ "$0" == `pwd`* ]] || [[ "$0" == "/"* ]]; then + full_path="$0" +else + full_path="`pwd`/$0" +fi +tmp=`dirname "$full_path"` +tmp=`dirname "$tmp"` +bundle=`dirname "$tmp"` +bundle_contents=${bundle%"/Contents"}"/Contents" +bundle_macos="$bundle_contents"/MacOS +bundle_res="$bundle_contents"/Resources +bundle_lib="$bundle_res"/lib +bundle_data="$bundle_res"/share +bundle_etc="$bundle_res"/etc + +export DYLD_FALLBACK_LIBRARY_PATH="$bundle_lib" +export XDG_CONFIG_DIRS="$bundle_etc"/xdg +export XDG_DATA_DIRS="$bundle_data" +export GTK_DATA_PREFIX="$bundle_res" +export GTK_EXE_PREFIX="$bundle_res" +export GTK_PATH="$bundle_res" +export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" +export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" +export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" +export PANGO_RC_FILE="$bundle_etc/pango/pangorc" +export PANGO_LIBDIR="$bundle_lib" +export PANGO_SYSCONFDIR="$bundle_etc" + +#Set $PYTHON to point inside the bundle +export PYTHON="$bundle_macos/python" +export PYTHONHOME="$bundle_res" +#Add the bundle's python modules +PYTHONPATH="$bundle_lib:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/:$PYTHONPATH" +PYTHONPATH="$bundle_lib/pygtk/2.0:$PYTHONPATH" +export PYTHONPATH + +# Ensure deluged is available by adding macos dir to path. +PATH=$bundle_macos:$PATH + +# We need a UTF-8 locale. +lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null` +if test "$?" != "0"; then + lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'` +fi +LANG="" +if test "$lang" != ""; then + LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \ + tail -n1 | sed 's/\./ /' | awk '{print $2}'`" +fi +if test "$LANG" == ""; then + export LANG="C" +else + export LANG="$LANG.utf8" +fi + +if test -f "$bundle_lib/charset.alias"; then + export CHARSETALIASDIR="$bundle_lib" +fi + +# Extra arguments can be added in environment.sh. +EXTRA_ARGS= +if test -f "$bundle_res/environment.sh"; then + source "$bundle_res/environment.sh" +fi + +# Strip out the argument added by the OS. +if [ "x`echo "x$1" | sed -e "s/^x-psn_.*//"`" == "x" ]; then + shift 1 +fi + +# Note that we're calling $PYTHON here to override the version used. +$EXEC "$PYTHON" "$bundle_macos/Deluge-bin" "$@" diff --git a/packaging/osx/deluge-console b/packaging/osx/deluge-console new file mode 100755 index 0000000..e1e20e8 --- /dev/null +++ b/packaging/osx/deluge-console @@ -0,0 +1,69 @@ +#!/bin/bash + +EXEC="exec" + +name="`basename $0`" +if [[ "$0" == `pwd`* ]] || [[ "$0" == "/"* ]]; then + full_path="$0" +else + full_path="`pwd`/$0" +fi +tmp=`dirname "$full_path"` +tmp=`dirname "$tmp"` +bundle=`dirname "$tmp"` +bundle_contents=${bundle%"/Contents"}"/Contents" +bundle_macos="$bundle_contents"/MacOS +bundle_res="$bundle_contents"/Resources +bundle_lib="$bundle_res"/lib +bundle_data="$bundle_res"/share +bundle_etc="$bundle_res"/etc + +export DYLD_FALLBACK_LIBRARY_PATH="$bundle_lib" +export XDG_CONFIG_DIRS="$bundle_etc"/xdg +export XDG_DATA_DIRS="$bundle_data" + +#Set $PYTHON to point inside the bundle +export PYTHON="$bundle_macos/python" +export PYTHONHOME="$bundle_res" +#Add the bundle's python modules +PYTHONPATH="$bundle_lib:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/:$PYTHONPATH" +export PYTHONPATH + +# Ensure deluged is available by adding macos dir to path. +PATH=$bundle_macos:$PATH + +# We need a UTF-8 locale. +lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null` +if test "$?" != "0"; then + lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'` +fi +LANG="" +if test "$lang" != ""; then + LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \ + tail -n1 | sed 's/\./ /' | awk '{print $2}'`" +fi +if test "$LANG" == ""; then + export LANG="C" +else + export LANG="$LANG.utf8" +fi + +if test -f "$bundle_lib/charset.alias"; then + export CHARSETALIASDIR="$bundle_lib" +fi + +# Extra arguments can be added in environment.sh. +EXTRA_ARGS= +if test -f "$bundle_res/environment.sh"; then + source "$bundle_res/environment.sh" +fi + +# Strip out the argument added by the OS. +if [ "x`echo "x$1" | sed -e "s/^x-psn_.*//"`" == "x" ]; then + shift 1 +fi + +# Note that we're calling $PYTHON here to override the version used. +$EXEC "$PYTHON" "$bundle_macos/deluge-console-bin" "$@" diff --git a/packaging/osx/deluge-web b/packaging/osx/deluge-web new file mode 100755 index 0000000..e66f550 --- /dev/null +++ b/packaging/osx/deluge-web @@ -0,0 +1,69 @@ +#!/bin/bash + +EXEC="exec" + +name="`basename $0`" +if [[ "$0" == `pwd`* ]] || [[ "$0" == "/"* ]]; then + full_path="$0" +else + full_path="`pwd`/$0" +fi +tmp=`dirname "$full_path"` +tmp=`dirname "$tmp"` +bundle=`dirname "$tmp"` +bundle_contents=${bundle%"/Contents"}"/Contents" +bundle_macos="$bundle_contents"/MacOS +bundle_res="$bundle_contents"/Resources +bundle_lib="$bundle_res"/lib +bundle_data="$bundle_res"/share +bundle_etc="$bundle_res"/etc + +export DYLD_FALLBACK_LIBRARY_PATH="$bundle_lib" +export XDG_CONFIG_DIRS="$bundle_etc"/xdg +export XDG_DATA_DIRS="$bundle_data" + +#Set $PYTHON to point inside the bundle +export PYTHON="$bundle_macos/python" +export PYTHONHOME="$bundle_res" +#Add the bundle's python modules +PYTHONPATH="$bundle_lib:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/:$PYTHONPATH" +export PYTHONPATH + +# Ensure deluged is available by adding macos dir to path. +PATH=$bundle_macos:$PATH + +# We need a UTF-8 locale. +lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null` +if test "$?" != "0"; then + lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'` +fi +LANG="" +if test "$lang" != ""; then + LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \ + tail -n1 | sed 's/\./ /' | awk '{print $2}'`" +fi +if test "$LANG" == ""; then + export LANG="C" +else + export LANG="$LANG.utf8" +fi + +if test -f "$bundle_lib/charset.alias"; then + export CHARSETALIASDIR="$bundle_lib" +fi + +# Extra arguments can be added in environment.sh. +EXTRA_ARGS= +if test -f "$bundle_res/environment.sh"; then + source "$bundle_res/environment.sh" +fi + +# Strip out the argument added by the OS. +if [ "x`echo "x$1" | sed -e "s/^x-psn_.*//"`" == "x" ]; then + shift 1 +fi + +# Note that we're calling $PYTHON here to override the version used. +$EXEC "$PYTHON" "$bundle_macos/deluge-web-bin" "$@" diff --git a/packaging/osx/deluge.bundle b/packaging/osx/deluge.bundle new file mode 100644 index 0000000..c4abdfc --- /dev/null +++ b/packaging/osx/deluge.bundle @@ -0,0 +1,43 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<app-bundle> + <meta> + <prefix name="default">${env:JHBUILD_PREFIX}</prefix> + <destination overwrite="yes">app</destination> + <run-install-name-tool/> + <launcher-script>${project}/deluge</launcher-script> + </meta> + <plist>${project}/Info.plist</plist> + <main-binary>${prefix}/bin/deluge-gtk</main-binary> + <binary dest="${bundle}/Contents/MacOS/deluged-bin">${prefix}/bin/deluged</binary> + <binary dest="${bundle}/Contents/MacOS/deluge-web-bin">${prefix}/bin/deluge-web</binary> + <binary dest="${bundle}/Contents/MacOS/deluge-console-bin">${prefix}/bin/deluge-console</binary> + <binary dest="${bundle}/Contents/MacOS">${prefix}/bin/python</binary> + + <!-- not used: binary>${prefix}/lib/${gtkdir}/modules/*.so</binary--> + <binary>${prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.so</binary> + <binary>${prefix}/lib/libpyglib-2.0-python.0.dylib</binary> + <binary>${prefix}/lib/libgtk-quartz-2.0.0.dylib</binary> + <binary>${prefix}/lib/libglade-2.0.0.dylib</binary> + <binary>${prefix}/lib/libgtkmacintegration-gtk2.2.dylib</binary> + <binary>${prefix}/lib/librsvg-2.2.dylib</binary> + <binary>${prefix}/lib/pango/1.8.0/modules/pango*.so</binary> + <binary>${prefix}/lib/libboost_system.dylib</binary> + <binary>${prefix}/lib/libboost_python.dylib</binary> + <binary>${prefix}/lib/libtorrent-rasterbar.9.dylib</binary> + <binary>${prefix}/lib/libssl.1.0.0.dylib</binary> + <binary>${prefix}/lib/libz.1.2.8.dylib</binary> + + <data dest="${bundle}/Contents/Resources/">${project}/../../dist/deluge.app/Contents/Resources/</data> + <data>${prefix}/lib/pygtk/2.0/</data> + <!-- gtk theme --> + <binary>${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/libclearlooks.so</binary> + <data>${prefix}/share/themes/Clearlooks</data> + <data>${prefix}/share/themes/Mac</data><!-- required for stock accelerators cmd-X etc... --> + <data dest="${bundle}/Contents/Resources/etc/gtk-2.0/gtkrc">${project}/gtkrc</data> + <data dest="${bundle}/Contents/Resources">${project}/deluge.icns</data> + <data dest="${bundle}/Contents/Resources">${project}/torrent.icns</data> + + <data dest="${bundle}/Contents/MacOS/deluged">${project}/deluged</data> + <data dest="${bundle}/Contents/MacOS/deluge-web">${project}/deluge-web</data> + <data dest="${bundle}/Contents/MacOS/deluge-console">${project}/deluge-console</data> +</app-bundle> diff --git a/packaging/osx/deluge.icns b/packaging/osx/deluge.icns Binary files differnew file mode 100644 index 0000000..125a23d --- /dev/null +++ b/packaging/osx/deluge.icns diff --git a/packaging/osx/deluge.modules b/packaging/osx/deluge.modules new file mode 100644 index 0000000..c08180a --- /dev/null +++ b/packaging/osx/deluge.modules @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<!DOCTYPE moduleset SYSTEM "moduleset.dtd"> +<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> +<moduleset> + <repository type="git" name="git.gnome" + href="git://git.gnome.org"/> + <repository type="tarball" name="pypi" + href="http://pypi.python.org/packages/source/"/> + + <metamodule id="deluge"> + <dependencies> + <dep package="libtorrent"/> + <dep package="gtk-mac-bundler"/> + <dep package="deluge-python-deps"/> + </dependencies> + </metamodule> + + <autotools id="gtk-mac-bundler" autogen-template="echo no configure"> + <branch repo="git.gnome" module="gtk-mac-bundler"/> + </autotools> + + <metamodule id="deluge-python-deps"> + <dependencies> + <dep package="setuptools"/> + <dep package="chardet"/> + <dep package="pyopenssl"/> + <dep package="pyxdg"/> + <dep package="py2app"/> + <dep package="mako"/> + <dep package="twisted"/> + </dependencies> + </metamodule> + + <distutils id="setuptools"> + <branch repo="pypi" version="0.6c11" + module="s/setuptools/setuptools-0.6c11.tar.gz"/> + </distutils> + <distutils id="chardet"> + <branch repo="pypi" version="2.1.1" + module="c/chardet/chardet-2.1.1.tar.gz"/> + </distutils> + <distutils id="pyopenssl"> + <branch repo="pypi" version="0.13" + module="p/pyOpenSSL/pyOpenSSL-0.13.tar.gz"/> + </distutils> + <distutils id="pyxdg"> + <branch repo="pypi" version="0.25" + module="p/pyxdg/pyxdg-0.25.tar.gz"/> + </distutils> + <distutils id="py2app"> + <branch repo="pypi" version="0.7.3" + module="p/py2app/py2app-0.7.3.tar.gz"/> + </distutils> + <distutils id="mako"> + <branch repo="pypi" version="0.7.3" + module="M/Mako/Mako-0.7.3.tar.gz"/> + </distutils> + <distutils id="twisted"> + <branch repo="pypi" version="12.3.0" + module="T/Twisted/Twisted-12.3.0.tar.bz2"/> + </distutils> +</moduleset> diff --git a/packaging/osx/deluged b/packaging/osx/deluged new file mode 100755 index 0000000..28cebc0 --- /dev/null +++ b/packaging/osx/deluged @@ -0,0 +1,69 @@ +#!/bin/bash + +EXEC="exec" + +name="`basename $0`" +if [[ "$0" == `pwd`* ]] || [[ "$0" == "/"* ]]; then + full_path="$0" +else + full_path="`pwd`/$0" +fi +tmp=`dirname "$full_path"` +tmp=`dirname "$tmp"` +bundle=`dirname "$tmp"` +bundle_contents=${bundle%"/Contents"}"/Contents" +bundle_macos="$bundle_contents"/MacOS +bundle_res="$bundle_contents"/Resources +bundle_lib="$bundle_res"/lib +bundle_data="$bundle_res"/share +bundle_etc="$bundle_res"/etc + +export DYLD_FALLBACK_LIBRARY_PATH="$bundle_lib" +export XDG_CONFIG_DIRS="$bundle_etc"/xdg +export XDG_DATA_DIRS="$bundle_data" + +#Set $PYTHON to point inside the bundle +export PYTHON="$bundle_macos/python" +export PYTHONHOME="$bundle_res" +#Add the bundle's python modules +PYTHONPATH="$bundle_lib:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/lib-dynload/:$PYTHONPATH" +PYTHONPATH="$bundle_lib/python/:$PYTHONPATH" +export PYTHONPATH + +# Ensure deluged is available by adding macos dir to path. +PATH=$bundle_macos:$PATH + +# We need a UTF-8 locale. +lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null` +if test "$?" != "0"; then + lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'` +fi +LANG="" +if test "$lang" != ""; then + LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \ + tail -n1 | sed 's/\./ /' | awk '{print $2}'`" +fi +if test "$LANG" == ""; then + export LANG="C" +else + export LANG="$LANG.utf8" +fi + +if test -f "$bundle_lib/charset.alias"; then + export CHARSETALIASDIR="$bundle_lib" +fi + +# Extra arguments can be added in environment.sh. +EXTRA_ARGS= +if test -f "$bundle_res/environment.sh"; then + source "$bundle_res/environment.sh" +fi + +# Strip out the argument added by the OS. +if [ "x`echo "x$1" | sed -e "s/^x-psn_.*//"`" == "x" ]; then + shift 1 +fi + +# Note that we're calling $PYTHON here to override the version used. +$EXEC "$PYTHON" "$bundle_macos/deluged-bin" "$@" diff --git a/packaging/osx/gtkrc b/packaging/osx/gtkrc new file mode 100644 index 0000000..a77430b --- /dev/null +++ b/packaging/osx/gtkrc @@ -0,0 +1,10 @@ +gtk-theme-name = "Clearlooks" +gtk-enable-mnemonics = 0 + +# Workaround for non-ascii display issue details +# here: http://bugs.gramps-project.org/view.php?id=5474 +style "user-font" +{ + font_name="Arial Unicode MS" +} +widget_class "*" style "user-font" diff --git a/packaging/osx/jhbuildrc-custom b/packaging/osx/jhbuildrc-custom new file mode 100644 index 0000000..6899bc5 --- /dev/null +++ b/packaging/osx/jhbuildrc-custom @@ -0,0 +1,32 @@ +# -*- mode: python -*- + +_gtk_osx_use_jhbuild_python = True + +#skip.append("libiconv") # Lion issues +branches["python"] = "http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz" + +modules = [ + "python", + "meta-gtk-osx-bootstrap", + "libglade", + "meta-gtk-osx-python", + "meta-gtk-osx-themes", + "gtk-quartz-engine", +] + +build_policy = "updated-deps" + +# For default operation, set architecture and SDK for the native machine: +_target = None; +if _osx_version >= 7.0: + _target = "10.7" +elif _osx_version >= 6.0: + _target = "10.6" +elif _osx_version >= 5.0: + _target = "10.5" +elif _osx_version >= 4.0: + _target = "10.4" + +setup_sdk(target=_target, sdk_version="native", architectures=[_default_arch]) +#setup_sdk(target="10.6", sdk_version="10.6", architectures=["x86_64"]) +#setup_sdk(target="10.6", sdk_version="10.6", architectures=["i386"]) diff --git a/packaging/osx/launchd/org.deluge-torrent.deluge-web.plist b/packaging/osx/launchd/org.deluge-torrent.deluge-web.plist new file mode 100644 index 0000000..b91fb61 --- /dev/null +++ b/packaging/osx/launchd/org.deluge-torrent.deluge-web.plist @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>org.deluge-torrent.deluge-web</string> + <key>ProgramArguments</key> + <array> + <string>/usr/local/bin/deluge-web</string> + <string>-d</string> + <string>-L</string> + <string>error</string> + <string>-l</string> + <string>/var/log/deluge-web.log</string> + </array> + <key>StandardOutPath</key> + <string>/tmp/deluge-web.stdout</string> + <key>StandardErrorPath</key> + <string>/tmp/deluge-web.stderr</string> + <!-- To enable running as 'deluge' user remove comments. + <key>UserName</key> + <string>deluge</string> + --> + <key>RunAtLoad</key> + <true/> + <key>KeepAlive</key> + <true/> +</dict> +</plist> diff --git a/packaging/osx/launchd/org.deluge-torrent.deluged.plist b/packaging/osx/launchd/org.deluge-torrent.deluged.plist new file mode 100644 index 0000000..424399b --- /dev/null +++ b/packaging/osx/launchd/org.deluge-torrent.deluged.plist @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>org.deluge-torrent.deluged</string> + <key>ProgramArguments</key> + <array> + <string>/usr/local/bin/deluged</string> + <string>-d</string> + <string>-L</string> + <string>error</string> + <string>-l</string> + <string>/var/log/deluged.log</string> + </array> + <key>StandardOutPath</key> + <string>/tmp/deluged.stdout</string> + <key>StandardErrorPath</key> + <string>/tmp/deluged.stderr</string> + <!-- To enable running as 'deluge' user remove comments. + <key>UserName</key> + <string>deluge</string> + --> + <key>RunAtLoad</key> + <true/> + <key>KeepAlive</key> + <true/> +</dict> +</plist> diff --git a/packaging/osx/libtorrent.modules b/packaging/osx/libtorrent.modules new file mode 100644 index 0000000..66d63f0 --- /dev/null +++ b/packaging/osx/libtorrent.modules @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<!DOCTYPE moduleset SYSTEM "moduleset.dtd"> +<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> +<moduleset> + <repository type="tarball" name="sourceforge" + href="http://downloads.sourceforge.net/sourceforge/"/> + <repository type="tarball" name="libtorrent" + href="https://github.com/arvidn/libtorrent/archive/"/> + <repository type="tarball" name="openssl" + href="http://www.openssl.org/source/"/> + + <metamodule id="libtorrent"> + <dependencies> + <dep package="openssl"/> + <dep package="boost"/> + <dep package="libtorrent"/> + </dependencies> + </metamodule> + + <autotools id="libtorrent" autogen-sh="autotools.sh" + autogen-template="%(srcdir)s/%(autogen-sh)s --prefix=%(prefix)s --with-boost-libdir=%(libdir)s --with-openssl=%(prefix)s --with-libiconv-prefix=%(libdir)s %(autogenargs)s " + autogenargs="--enable-python-binding "> + <branch repo="libtorrent" version="1.0.6" module="RC_1_0.zip"/> + </autotools> + + <!-- openssl libdir is a relative path to prefix! --> + <autotools id="openssl" autogen-sh="Configure" + autogen-template="%(srcdir)s/%(autogen-sh)s --prefix=%(prefix)s --libdir=lib darwin64-x86_64-cc shared" + makeinstallargs="install_sw"> + <!--%(autogenargs)s" + autogenargs="darwin-i386-cc shared"> + <!--autogenargs="darwin64-x86_64-cc shared"> + Look into problem with autogenargs introducing extra darwin64-x86_64-cc --> + + <branch repo="openssl" version="1.0.2d" module="openssl-1.0.2d.tar.gz"/> + </autotools> + + <autotools id="boost" autogen-sh="bootstrap.sh" + autogen-template="%(srcdir)s/%(autogen-sh)s --prefix=%(prefix)s --libdir=%(libdir)s --with-python=%(prefix)s/bin/python --with-icu=%(prefix)s --with-libraries=system,python" + supports-non-srcdir-builds="false" + makeargs="|| ./b2" + makeinstallargs="|| ./b2 install"> + <branch repo="sourceforge" version="1.59.0" module="boost/boost_1_59_0.tar.bz2"/> + </autotools> +</moduleset> diff --git a/packaging/osx/make-app b/packaging/osx/make-app new file mode 100644 index 0000000..9489f6c --- /dev/null +++ b/packaging/osx/make-app @@ -0,0 +1,49 @@ +#!/bin/bash + +APPDIR="./app/Deluge.app" +RSCDIR="${APPDIR}/Contents/Resources" +LIBDIR="${RSCDIR}/lib" +VERSION=$(cat ../../RELEASE-VERSION) +YEAR=$(date +'%Y') + +function msg() { echo "==> $1"; } + +echo "*** Packaging Deluge.app to $APPDIR..." + +msg "Clearing app dir" +rm -fr $APPDIR + +msg "Fixing permissions on file we will need to relocate" +if [ ! -z "${JHBUILD_PREFIX}" ]; then + chmod 755 "${JHBUILD_PREFIX}/lib/"libpython*.dylib + chmod 755 "${JHBUILD_PREFIX}/lib/"libssl*.dylib + chmod 755 "${JHBUILD_PREFIX}/lib/"libcrypto*.dylib +fi + +chmod 755 deluge deluge-web deluge-console deluged + +msg "Create Info.plist for Deluge $version" +sed -e s/%VERSION%/$VERSION/ -e s/%YEAR%/$YEAR/ Info.plist.in > Info.plist + +msg "Calling gtk-mac-bundler" +gtk-mac-bundler deluge.bundle + +msg "Unzip site-packages and make python softlink without version number" +pushd ${LIBDIR} || exit 1 +ln -sf python* python +cd python +unzip -nq site-packages.zip +rm site-packages.zip +popd + +msg "Replacing deluge by its egg..." +rm -fr ${LIBDIR}/python/deluge +rsync -rpl $JHBUILD_PREFIX/lib/python2.7/site-packages/deluge-*.egg "${LIBDIR}/python/" + +msg "Clean unnecessary files" +find $APPDIR -name "*.la" -exec rm -f {} \; # Should not be packaged +find $APPDIR -name "*.pyo" -exec rm -f {} \; # Just duplicates +find $LIBDIR/python/deluge-*.egg -name "*.py" -exec rm -f {} \; # Remove source files, leaving compiled only. +rm -fr $LIBDIR/pygtk/2.0/*demo* + +echo "*** Packaging done:`du -hs $APPDIR | cut -f 1`" diff --git a/packaging/osx/torrent.icns b/packaging/osx/torrent.icns Binary files differnew file mode 100644 index 0000000..a6f9040 --- /dev/null +++ b/packaging/osx/torrent.icns |