source: trunk/pyinstaller.spec

Last change on this file was 6d4ce3b, checked in by Itamar Turner-Trauring <itamar@…>, at 2020-07-03T17:44:47Z

Additional hidden imports due to use of Future.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# -*- mode: python -*-
2
3from __future__ import print_function
4
5from distutils.sysconfig import get_python_lib
6import hashlib
7import os
8import platform
9import shutil
10import struct
11import sys
12
13
14if not hasattr(sys, 'real_prefix'):
15    sys.exit("Please run inside a virtualenv with Tahoe-LAFS installed.")
16
17
18options = [('u', None, 'OPTION')]  # Unbuffered stdio
19
20added_files = [
21    ('COPYING.*', '.'),
22    ('CREDITS', '.'),
23    ('relnotes.txt', '.'),
24    ('src/allmydata/web/*.xhtml', 'allmydata/web'),
25    ('src/allmydata/web/static/*', 'allmydata/web/static'),
26    ('src/allmydata/web/static/css/*', 'allmydata/web/static/css'),
27    ('src/allmydata/web/static/img/*.png', 'allmydata/web/static/img')]
28
29hidden_imports = [
30    '__builtin__',
31    'allmydata.client',
32    'allmydata.introducer',
33    'allmydata.stats',
34    'base64',
35    'cffi',
36    'collections',
37    'commands',
38    'Crypto',
39    'functools',
40    'future.backports.misc',
41    'itertools',
42    'math',
43    'packaging.specifiers',
44    're',
45    'reprlib',
46    'six.moves.html_parser',
47    'subprocess',
48    'UserDict',
49    'UserList',
50    'UserString',
51    'yaml',
52    'zfec',
53]
54
55a = Analysis(
56    ['static/tahoe.py'],
57    pathex=[],
58    binaries=None,
59    datas=added_files,
60    hiddenimports=hidden_imports,
61    hookspath=[],
62    runtime_hooks=[],
63    excludes=[],
64    win_no_prefer_redirects=False,
65    win_private_assemblies=False,
66    cipher=None)
67
68pyz = PYZ(
69    a.pure,
70    a.zipped_data,
71    cipher=None)
72
73exe = EXE(
74    pyz,
75    a.scripts,
76    options,
77    exclude_binaries=True,
78    name='tahoe',
79    debug=False,
80    strip=False,
81    upx=False,
82    console=True)
83
84coll = COLLECT(
85    exe,
86    a.binaries,
87    a.zipfiles,
88    a.datas,
89    strip=False,
90    upx=False,
91    name='Tahoe-LAFS')
92
93
94print("Creating archive...")
95platform_tag = platform.system().replace('Darwin', 'MacOS')
96bitness_tag = str(struct.calcsize('P') * 8) + 'bit'
97archive_name = 'Tahoe-LAFS-{}-{}'.format(platform_tag, bitness_tag)
98if sys.platform == 'win32':
99    archive_format = 'zip'
100    archive_suffix = '.zip'
101else:
102    archive_format = 'gztar'
103    archive_suffix = '.tar.gz'
104base_name = os.path.join('dist', archive_name)
105shutil.make_archive(base_name, archive_format, 'dist', 'Tahoe-LAFS')
106
107print("Hashing (SHA256)...")
108archive_path = base_name + archive_suffix
109hasher = hashlib.sha256()
110with open(archive_path, 'rb') as f:
111    for block in iter(lambda: f.read(4096), b''):
112        hasher.update(block)
113print("{}  {}".format(hasher.hexdigest(), archive_path))
Note: See TracBrowser for help on using the repository browser.