Skip to content

Commit cf09872

Browse files
committed
Update build scripts
- PyInstaller script (e.g. for Windows) - build_osx.sh for OSX
1 parent 9aad323 commit cf09872

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

pyinstaller/bitmessagemain.spec

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
srcPath = "C:\\src\\PyBitmessage\\src\\"
2+
qtPath = "C:\\Qt\\4.8.6\\"
3+
openSSLPath = "C:\\OpenSSL-1.0.2e\\"
4+
outPath = "C:\\src\\PyInstaller\\bitmessagemain"
5+
6+
# -*- mode: python -*-
7+
a = Analysis([srcPath + 'bitmessagemain.py'],
8+
pathex=[outPath],
9+
hiddenimports=[],
10+
hookspath=None,
11+
runtime_hooks=None)
12+
13+
# fix duplicates
14+
for d in a.datas:
15+
if 'pyconfig' in d[0]:
16+
a.datas.remove(d)
17+
break
18+
19+
def addTranslations():
20+
import os
21+
extraDatas = []
22+
for file in os.listdir(srcPath + 'translations'):
23+
if file[-3:] != ".qm":
24+
continue
25+
extraDatas.append(('translations\\'+file, srcPath + 'translations\\' + file, 'DATA'))
26+
for file in os.listdir(qtPath + 'translations'):
27+
if file[0:3] != "qt_" or file[5:8] != ".qm":
28+
continue
29+
extraDatas.append(('translations\\'+file, qtPath + 'translations\\' + file, 'DATA'))
30+
return extraDatas
31+
32+
def addUIs():
33+
import os
34+
extraDatas = []
35+
for file in os.listdir(srcPath + 'bitmessageqt'):
36+
if file[-3:] != ".ui":
37+
continue
38+
extraDatas.append(('ui\\'+file, srcPath + 'bitmessageqt\\' + file, 'DATA'))
39+
return extraDatas
40+
41+
# append the translations directory
42+
a.datas += addTranslations()
43+
a.datas += addUIs()
44+
45+
a.binaries.append(('msvcr120.dll', 'C:\\WINDOWS\\system32\\msvcr120.dll', 'BINARY'))
46+
47+
pyz = PYZ(a.pure)
48+
exe = EXE(pyz,
49+
a.scripts,
50+
a.binaries,
51+
a.zipfiles,
52+
a.datas,
53+
a.binaries + [('libeay32.dll', openSSLPath + 'libeay32.dll', 'BINARY'), ('bitmsghash\\bitmsghash32.dll', srcPath + 'bitmsghash\\bitmsghash32.dll', 'BINARY'), ('bitmsghash\\bitmsghash.cl', srcPath + 'bitmsghash\\bitmsghash.cl', 'BINARY'), ('sslkeys\\cert.pem', srcPath + 'sslkeys\\cert.pem', 'BINARY'), ('sslkeys\\key.pem', srcPath + 'sslkeys\\key.pem', 'BINARY')],
54+
name='Bitmessage.exe',
55+
debug=False,
56+
strip=None,
57+
upx=False,
58+
console=False, icon= srcPath + 'images\\can-icon.ico')

src/build_osx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
('', ['sslkeys', 'images']),
1212
('bitmsghash', ['bitmsghash/bitmsghash.cl', 'bitmsghash/bitmsghash.so']),
1313
('translations', glob('translations/*.qm')),
14+
('ui', glob('bitmessageqt/*.ui')),
1415
('translations', glob(str(QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)) + '/qt_??.qm')),
1516
('translations', glob(str(QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)) + '/qt_??_??.qm')),
1617
]

0 commit comments

Comments
 (0)