forked from veusz/veusz
-
Notifications
You must be signed in to change notification settings - Fork 1
/
veusz_pyinst.spec
75 lines (65 loc) · 2.54 KB
/
veusz_pyinst.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This is a pyinstaller script file
# to make the distribution you need to create a directory, e.g. temp
# add a symlink called veusz inside temp, pointing to the veusz directory
# you will need to edit the paths below to get the correct input directory
from glob import glob
import os.path
import sys
# platform specific stuff
if sys.platform == 'win32':
# windows
name = r'buildveusz_pyinst\veusz.exe'
thisdir = r'c:\source\veusz'
console = 0
aargs = {'icon': os.path.join(thisdir,'windows/icons/veusz.ico')}
upx = True
else:
# unix
name = 'buildveusz_pyinst/veusz'
thisdir = '/home/jss/veusz.qt4'
console = 1
aargs = {}
upx = False
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
os.path.join(HOMEPATH,'support/useUnicode.py'), 'veusz_main.py'],
pathex=[thisdir, os.path.join(thisdir, 'temp')],
excludes=['Tkinter', 'readline', 'termios'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=1,
name=name,
debug=False,
strip=True,
upx=upx,
console=console,
**aargs)
# add necessary documentation, licence
binaries = a.binaries
for bin in ('VERSION', 'ChangeLog', 'AUTHORS', 'README', 'INSTALL', 'COPYING',
'embed.py', '__init__.py'):
binaries += [ (bin, bin, 'DATA') ]
# add various required files to distribution
for f in ( glob('windows/icons/*.png') + glob('windows/icons/*.ico') +
glob('windows/icons/*.svg') +
glob('examples/*.vsz') +
glob('examples/*.dat') + glob('examples/*.csv') +
glob('examples/*.py') +
glob('dialogs/*.ui') + glob('widgets/data/*.dat')):
binaries.append( (f, f, 'DATA') )
excludes = set(['ld-linux.so.2', 'libcom_err.so.3', 'libcrypto.so.4',
'libdl.so.2', 'libfontconfig.so.1', 'libfreetype.so.6',
'libgpm.so.1', 'libgssapi_krb5.so.2', 'libICE.so.6',
'libk5crypto.so.3', 'libkrb5.so.3', 'libncurses.so.5',
'libncursesw.so.5', 'libreadline.so.4', 'libresolv.so.2',
'libSM.so.6', 'libssl.so.4', 'libutil.so.1', 'libX11.so.6',
'libXext.so.6', 'libXrender.so.1', 'libz.so.1', 'readline.so',
'termios.so'])
# remove libraries in the set above
# works a lot better if we do this...
binaries[:] = [b for b in binaries if b[0] not in excludes]
coll = COLLECT( exe,
a.binaries, a.zipfiles, a.datas,
strip=False,
upx=upx,
name='distveusz_main' )