From: coblee Date: Sun, 22 Jul 2012 23:19:25 +0000 (-0700) Subject: Add release process for Mac OS X. X-Git-Url: https://git.novaco.in/?p=electrum-nvc.git;a=commitdiff_plain;h=a5c5953d0cca08e9709c9b53795cf52e385b0549 Add release process for Mac OS X. --- diff --git a/README b/README index ef32cb5..f481ec1 100644 --- a/README +++ b/README @@ -29,6 +29,11 @@ python mki18n.py pyrcc4 icons.qrc -o lib/icons_rc.py python setup.py sdist --format=zip,gztar +On Mac OS X: + + sudo python setup-release.py py2app + sudo hdiutil create -fs HFS+ -volname "Electrum" -srcfolder dist/Electrum.app dist/electrum-v0.61-macosx.dmg + == BROWSER CONFIGURATION == diff --git a/electrum.icns b/electrum.icns new file mode 100644 index 0000000..3c75708 Binary files /dev/null and b/electrum.icns differ diff --git a/setup-release.py b/setup-release.py new file mode 100644 index 0000000..add595b --- /dev/null +++ b/setup-release.py @@ -0,0 +1,61 @@ +""" +py2app/py2exe build script for Electrum Litecoin + +Usage (Mac OS X): + python setup.py py2app + +Usage (Windows): + python setup.py py2exe +""" + +import sys, os, shutil +from setuptools import setup +from lib.version import ELECTRUM_VERSION as version +from lib.util import print_error + + +name = "Electrum" +mainscript = 'electrum' + +if sys.version_info[:3] < (2,6,0): + print_error("Error: " + name + " requires Python version >= 2.6.0...") + sys.exit(1) + +if sys.platform == 'darwin': + shutil.copy(mainscript, mainscript + '.py') + mainscript += '.py' + extra_options = dict( + setup_requires=['py2app'], + app=[mainscript], + options=dict(py2app=dict(argv_emulation=True, + iconfile='electrum.icns', + resources=["data/background.png", "data/style.css", "data/icons"])), + ) +elif sys.platform == 'win32': + extra_options = dict( + setup_requires=['py2exe'], + app=[mainscript], + ) +else: + extra_options = dict( + # Normally unix-like platforms will use "setup.py install" + # and install the main script as such + scripts=[mainscript], + ) + +setup( + name = name, + version = version, + **extra_options +) + +if sys.platform == 'darwin': + # Remove the copied py file + os.remove(mainscript) + resource = "dist/" + name + ".app/Contents/Resources/" + # Need to include a copy of qt_menu.nib + shutil.copytree("/opt/local/lib/Resources/qt_menu.nib", resource + "qt_menu.nib") + # Need to touch qt.conf to avoid loading 2 sets of tT libraries + fname = resource + "qt.conf" + with file(fname, 'a'): + os.utime(fname, None)