2017-01-07 21:17:15 -05:00
|
|
|
# -*- mode: python -*-
|
|
|
|
|
2020-10-11 18:57:55 -04:00
|
|
|
import os
|
2017-01-07 21:17:15 -05:00
|
|
|
import platform
|
2020-10-11 18:57:55 -04:00
|
|
|
from distutils.sysconfig import get_python_lib
|
|
|
|
|
2017-01-07 21:17:15 -05:00
|
|
|
p = platform.system()
|
|
|
|
|
2020-10-11 18:57:55 -04:00
|
|
|
version = open("share/version.txt").read().strip()
|
|
|
|
|
|
|
|
paths = ["."]
|
|
|
|
if p == "Windows":
|
|
|
|
paths.append(os.path.join(get_python_lib(), "PyQt5", "Qt", "bin"))
|
|
|
|
paths.append(
|
|
|
|
os.path.join(
|
|
|
|
os.path.abspath(os.sep),
|
|
|
|
"Program Files (x86)",
|
|
|
|
"Windows Kits",
|
|
|
|
"10",
|
|
|
|
"bin",
|
|
|
|
"x86",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
paths.append(
|
|
|
|
os.path.join(
|
|
|
|
os.path.abspath(os.sep),
|
|
|
|
"Program Files (x86)",
|
|
|
|
"Windows Kits",
|
|
|
|
"10",
|
|
|
|
"bin",
|
|
|
|
"x64",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
paths.append(
|
|
|
|
os.path.join(
|
|
|
|
os.path.abspath(os.sep),
|
|
|
|
"Program Files (x86)",
|
|
|
|
"Windows Kits",
|
|
|
|
"10",
|
|
|
|
"Redist",
|
|
|
|
"ucrt",
|
|
|
|
"DLLs",
|
|
|
|
"x86",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
paths.append(
|
|
|
|
os.path.join(
|
|
|
|
os.path.abspath(os.sep),
|
|
|
|
"Program Files (x86)",
|
|
|
|
"Windows Kits",
|
|
|
|
"10",
|
|
|
|
"Redist",
|
|
|
|
"ucrt",
|
|
|
|
"DLLs",
|
|
|
|
"x64",
|
|
|
|
)
|
|
|
|
)
|
2017-01-07 21:17:15 -05:00
|
|
|
|
|
|
|
a = Analysis(
|
2020-10-11 18:57:55 -04:00
|
|
|
["scripts/onionshare-pyinstaller"],
|
|
|
|
pathex=paths,
|
2017-01-07 21:17:15 -05:00
|
|
|
binaries=None,
|
|
|
|
datas=[
|
2020-10-11 18:57:55 -04:00
|
|
|
("../share/version.txt", "share"),
|
|
|
|
("../share/wordlist.txt", "share"),
|
|
|
|
("../share/torrc_template", "share"),
|
|
|
|
("../share/torrc_template-obfs4", "share"),
|
|
|
|
("../share/torrc_template-meek_lite_azure", "share"),
|
|
|
|
("../share/images/*", "share/images"),
|
|
|
|
("../share/locale/*", "share/locale"),
|
|
|
|
("../share/static/*", "share/static"),
|
|
|
|
("../share/templates/*", "share/templates"),
|
|
|
|
("../share/static/css/*", "share/static/css"),
|
|
|
|
("../share/static/img/*", "share/static/img"),
|
|
|
|
("../share/static/js/*", "share/static/js"),
|
|
|
|
("../install/licenses/*", "licenses"),
|
2017-01-07 21:17:15 -05:00
|
|
|
],
|
2020-09-21 23:45:57 -04:00
|
|
|
hiddenimports=["engineio.async_drivers.threading"],
|
2017-01-07 21:17:15 -05:00
|
|
|
hookspath=[],
|
|
|
|
runtime_hooks=[],
|
|
|
|
win_no_prefer_redirects=False,
|
|
|
|
win_private_assemblies=False,
|
2020-10-11 18:57:55 -04:00
|
|
|
cipher=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
|
2017-01-07 21:17:15 -05:00
|
|
|
|
2020-10-11 18:57:55 -04:00
|
|
|
# Show console in dev releases, don't show console in production releases
|
|
|
|
console = "dev" in version
|
2017-01-07 21:17:15 -05:00
|
|
|
|
|
|
|
exe = EXE(
|
|
|
|
pyz,
|
|
|
|
a.scripts,
|
|
|
|
exclude_binaries=True,
|
2020-10-11 18:57:55 -04:00
|
|
|
name="onionshare-gui",
|
2017-01-07 21:17:15 -05:00
|
|
|
debug=False,
|
|
|
|
strip=False,
|
|
|
|
upx=True,
|
2020-10-11 18:57:55 -04:00
|
|
|
console=console,
|
|
|
|
)
|
2017-01-07 21:17:15 -05:00
|
|
|
|
|
|
|
coll = COLLECT(
|
2020-10-11 18:57:55 -04:00
|
|
|
exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, name="onionshare"
|
|
|
|
)
|
2017-01-07 21:17:15 -05:00
|
|
|
|
2020-10-11 18:57:55 -04:00
|
|
|
if p == "Darwin":
|
2017-01-07 21:17:15 -05:00
|
|
|
app = BUNDLE(
|
|
|
|
coll,
|
2020-10-11 18:57:55 -04:00
|
|
|
name="OnionShare.app",
|
|
|
|
icon="onionshare.icns",
|
|
|
|
bundle_identifier="com.micahflee.onionshare",
|
2017-01-07 21:17:15 -05:00
|
|
|
info_plist={
|
2020-10-11 18:57:55 -04:00
|
|
|
"CFBundleShortVersionString": version,
|
|
|
|
"NSHighResolutionCapable": "True",
|
|
|
|
},
|
2017-01-07 21:17:15 -05:00
|
|
|
)
|