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 76
|
# -*- mode: python -*-
import os
import os.path
block_cipher = None
debug = False
drive_c = DISTPATH
basedir = os.path.join(drive_c, 'repo')
gtkdir = os.path.join(drive_c, 'gtk')
srcdir = os.path.join(basedir, 'rednotebook')
icon = os.path.join(basedir, 'win', 'rednotebook.ico')
MISSED_BINARIES = [
(os.path.join(gtkdir, src), destdir) for src, destdir in [
("bin/gdbus.exe", "."),
("bin/libenchant.dll", "."),
("lib/enchant/libenchant_myspell.dll", "lib/enchant/"),
]
]
for path in [drive_c, basedir, srcdir, icon] + [src for src, _ in MISSED_BINARIES]:
assert os.path.exists(path), "{} does not exist".format(path)
print('PATH:', os.environ['PATH'])
def Dir(path, excludes=None):
assert os.path.isdir(path), path
return Tree(path, prefix=os.path.basename(path), excludes=excludes or [])
a = Analysis(
[os.path.join(srcdir, 'journal.py')],
pathex=[basedir],
binaries=MISSED_BINARIES,
datas=[],
hiddenimports=[],
hookspath=["."], # To find custom hooks.
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name='rednotebook.exe',
debug=debug,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=debug,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=icon,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
Dir(os.path.join(srcdir, 'files')),
Dir(os.path.join(srcdir, 'images')),
strip=False,
upx=True,
upx_exclude=[],
name='dist',
)
|