Skip to content

Commit a5c5953

Browse files
committed
Add release process for Mac OS X.
1 parent 8f5d485 commit a5c5953

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ python mki18n.py
2929
pyrcc4 icons.qrc -o lib/icons_rc.py
3030
python setup.py sdist --format=zip,gztar
3131

32+
On Mac OS X:
33+
34+
sudo python setup-release.py py2app
35+
sudo hdiutil create -fs HFS+ -volname "Electrum" -srcfolder dist/Electrum.app dist/electrum-v0.61-macosx.dmg
36+
3237

3338
== BROWSER CONFIGURATION ==
3439

electrum.icns

96.7 KB
Binary file not shown.

setup-release.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
"""
2+
py2app/py2exe build script for Electrum Litecoin
3+
4+
Usage (Mac OS X):
5+
python setup.py py2app
6+
7+
Usage (Windows):
8+
python setup.py py2exe
9+
"""
10+
11+
import sys, os, shutil
12+
from setuptools import setup
13+
from lib.version import ELECTRUM_VERSION as version
14+
from lib.util import print_error
15+
16+
17+
name = "Electrum"
18+
mainscript = 'electrum'
19+
20+
if sys.version_info[:3] < (2,6,0):
21+
print_error("Error: " + name + " requires Python version >= 2.6.0...")
22+
sys.exit(1)
23+
24+
if sys.platform == 'darwin':
25+
shutil.copy(mainscript, mainscript + '.py')
26+
mainscript += '.py'
27+
extra_options = dict(
28+
setup_requires=['py2app'],
29+
app=[mainscript],
30+
options=dict(py2app=dict(argv_emulation=True,
31+
iconfile='electrum.icns',
32+
resources=["data/background.png", "data/style.css", "data/icons"])),
33+
)
34+
elif sys.platform == 'win32':
35+
extra_options = dict(
36+
setup_requires=['py2exe'],
37+
app=[mainscript],
38+
)
39+
else:
40+
extra_options = dict(
41+
# Normally unix-like platforms will use "setup.py install"
42+
# and install the main script as such
43+
scripts=[mainscript],
44+
)
45+
46+
setup(
47+
name = name,
48+
version = version,
49+
**extra_options
50+
)
51+
52+
if sys.platform == 'darwin':
53+
# Remove the copied py file
54+
os.remove(mainscript)
55+
resource = "dist/" + name + ".app/Contents/Resources/"
56+
# Need to include a copy of qt_menu.nib
57+
shutil.copytree("/opt/local/lib/Resources/qt_menu.nib", resource + "qt_menu.nib")
58+
# Need to touch qt.conf to avoid loading 2 sets of tT libraries
59+
fname = resource + "qt.conf"
60+
with file(fname, 'a'):
61+
os.utime(fname, None)

0 commit comments

Comments
 (0)