From f702b50b6ac6cb2e1e0e848a629a623f323c9de2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 24 Jun 2023 19:38:33 +0200 Subject: Merging upstream version 2.1.2~dev0+20230529. Signed-off-by: Daniel Baumann --- packaging/osx/Info.plist.in | 59 ++++++++++ packaging/osx/Instructions.md | 48 ++++++++ packaging/osx/README.rst | 127 +++++++++++++++++++++ packaging/osx/deluge | 79 +++++++++++++ packaging/osx/deluge-console | 69 +++++++++++ packaging/osx/deluge-web | 69 +++++++++++ packaging/osx/deluge.bundle | 43 +++++++ packaging/osx/deluge.icns | Bin 0 -> 201047 bytes packaging/osx/deluge.modules | 62 ++++++++++ packaging/osx/deluged | 69 +++++++++++ packaging/osx/gtkrc | 10 ++ packaging/osx/jhbuildrc-custom | 32 ++++++ .../launchd/org.deluge-torrent.deluge-web.plist | 29 +++++ .../osx/launchd/org.deluge-torrent.deluged.plist | 29 +++++ packaging/osx/libtorrent.modules | 45 ++++++++ packaging/osx/make-app | 49 ++++++++ packaging/osx/torrent.icns | Bin 0 -> 199899 bytes 17 files changed, 819 insertions(+) create mode 100644 packaging/osx/Info.plist.in create mode 100644 packaging/osx/Instructions.md create mode 100644 packaging/osx/README.rst create mode 100755 packaging/osx/deluge create mode 100755 packaging/osx/deluge-console create mode 100755 packaging/osx/deluge-web create mode 100644 packaging/osx/deluge.bundle create mode 100644 packaging/osx/deluge.icns create mode 100644 packaging/osx/deluge.modules create mode 100755 packaging/osx/deluged create mode 100644 packaging/osx/gtkrc create mode 100644 packaging/osx/jhbuildrc-custom create mode 100644 packaging/osx/launchd/org.deluge-torrent.deluge-web.plist create mode 100644 packaging/osx/launchd/org.deluge-torrent.deluged.plist create mode 100644 packaging/osx/libtorrent.modules create mode 100644 packaging/osx/make-app create mode 100644 packaging/osx/torrent.icns (limited to 'packaging/osx') 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 @@ + + + + + CFBundleIdentifier + org.deluge + CFBundleName + Deluge + CFBundleIconFile + deluge.icns + CFBundleExecutable + Deluge + CFBundleShortVersionString + %VERSION% + CFBundleVersion + %VERSION% + CFBundleGetInfoString + %VERSION% (c) 2008-%YEAR% Deluge Team http://deluge-torrent.org/ + NSHumanReadableCopyright + Copyright 2008-%YEAR% Deluge Team + CFBundleDevelopmentRegion + English + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + DL## + LSMinimumSystemVersion + 10.6 + LSUIElement + 0 + NSHighResolutionCapable + + CFBundleDisplayName + Deluge + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + torrent + + CFBundleTypeIconFile + torrent + CFBundleTypeName + BitTorrent Document + CFBundleTypeRole + Viewer + LSHandlerRank + Owner + LSItemContentTypes + + org.bittorrent.torrent + + + + + 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 @@ + + + + ${env:JHBUILD_PREFIX} + app + + ${project}/deluge + + ${project}/Info.plist + ${prefix}/bin/deluge-gtk + ${prefix}/bin/deluged + ${prefix}/bin/deluge-web + ${prefix}/bin/deluge-console + ${prefix}/bin/python + + + ${prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.so + ${prefix}/lib/libpyglib-2.0-python.0.dylib + ${prefix}/lib/libgtk-quartz-2.0.0.dylib + ${prefix}/lib/libglade-2.0.0.dylib + ${prefix}/lib/libgtkmacintegration-gtk2.2.dylib + ${prefix}/lib/librsvg-2.2.dylib + ${prefix}/lib/pango/1.8.0/modules/pango*.so + ${prefix}/lib/libboost_system.dylib + ${prefix}/lib/libboost_python.dylib + ${prefix}/lib/libtorrent-rasterbar.9.dylib + ${prefix}/lib/libssl.1.0.0.dylib + ${prefix}/lib/libz.1.2.8.dylib + + ${project}/../../dist/deluge.app/Contents/Resources/ + ${prefix}/lib/pygtk/2.0/ + + ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/libclearlooks.so + ${prefix}/share/themes/Clearlooks + ${prefix}/share/themes/Mac + ${project}/gtkrc + ${project}/deluge.icns + ${project}/torrent.icns + + ${project}/deluged + ${project}/deluge-web + ${project}/deluge-console + diff --git a/packaging/osx/deluge.icns b/packaging/osx/deluge.icns new file mode 100644 index 0000000..125a23d Binary files /dev/null and b/packaging/osx/deluge.icns differ 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + Label + org.deluge-torrent.deluge-web + ProgramArguments + + /usr/local/bin/deluge-web + -d + -L + error + -l + /var/log/deluge-web.log + + StandardOutPath + /tmp/deluge-web.stdout + StandardErrorPath + /tmp/deluge-web.stderr + + RunAtLoad + + KeepAlive + + + 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 @@ + + + + + Label + org.deluge-torrent.deluged + ProgramArguments + + /usr/local/bin/deluged + -d + -L + error + -l + /var/log/deluged.log + + StandardOutPath + /tmp/deluged.stdout + StandardErrorPath + /tmp/deluged.stderr + + RunAtLoad + + KeepAlive + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000..a6f9040 Binary files /dev/null and b/packaging/osx/torrent.icns differ -- cgit v1.2.3