kiwix-hotspot-win64.spec 2.31 KB
Newer Older
1
2
# -*- mode: python -*-

rgaudin's avatar
rgaudin committed
3
import os
4
import sys
rgaudin's avatar
rgaudin committed
5
import site
6
sys.path += [os.path.join(os.getcwd(), 'kiwix-hotspot')]
7
8
9
10
11
12
13
14
15
from version import get_version_str, get_short_version_str

# update version number for exe metadata
rsc = os.path.join('windows_bundle', 'resources.rc')
with open(rsc, 'r') as f:
	content = f.read().replace("VERSION_TUPLE", get_short_version_str(",")) \
					  .replace("VERSION_STR", get_version_str())
with open(rsc, 'w') as f:
	f.write(content)
rgaudin's avatar
rgaudin committed
16

17
block_cipher = None
rgaudin's avatar
rgaudin committed
18
typelib_path = os.path.join(site.getsitepackages()[1], 'gnome', 'lib', 'girepository-1.0')
19

20
a = Analysis(['kiwix-hotspot/__main__.py'],
21
             pathex=['.'],
rgaudin's avatar
rgaudin committed
22
             binaries=[(os.path.join(typelib_path, tl), 'gi_typelibs') for tl in os.listdir(typelib_path)],
thiolliere's avatar
thiolliere committed
23
             datas=[('ui.glade', '.'),
rgaudin's avatar
rgaudin committed
24
                    ('contents.json', '.'),
25
                    ('imdisk.png', '.'),
rgaudin's avatar
rgaudin committed
26
                    ('etcher.gif', '.'),
27
                    ('mbr.img', '.'),
28
                    ('kiwix-hotspot-logo.png', '.'),
29
                    ('aria2c.exe', '.'),
thiolliere's avatar
thiolliere committed
30
                    ('ansiblecube', 'ansiblecube'),
31
                    ('vexpress-boot', 'vexpress-boot'),
rgaudin's avatar
rgaudin committed
32
33
                    ('C:\Program Files\qemu', 'qemu'),
                    ('C:\Program Files\imdiskinst', 'imdiskinst'),
34
                    ('C:\Program Files\etcher-cli', 'etcher-cli'),
rgaudin's avatar
rgaudin committed
35
36
37
                    ('C:\Program Files\\7zextra\\x64\\7za.dll', '.'),
                    ('C:\Program Files\\7zextra\\x64\\7za.exe', '.'),
                    ('C:\Program Files\\7zextra\\x64\\7zxa.dll', '.')],
38
             hiddenimports=['gui', 'cli', 'image', 'cache', 'wipe'],
thiolliere's avatar
thiolliere committed
39
             hookspath=['additional-hooks'],
40
41
42
43
44
45
46
47
48
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
thiolliere's avatar
thiolliere committed
49
          exclude_binaries=True,
50
          name='launcher',
51
52
53
          debug=False,
          strip=False,
          upx=True,
thiolliere's avatar
thiolliere committed
54
          console=False,
55
          icon='kiwix-hotspot-logo.ico',
thiolliere's avatar
thiolliere committed
56
57
58
59
60
61
62
          uac_admin=True)
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
63
               name='kiwix-hotspot')