Please sign in to comment.
use pyinstaller to build wormhole fat/standalone binary
tested with/on: - ubuntu linux 18.04 amd64 - pyinstaller 3.3.1 (pip install pyinstaller) - python 3.6.5 There is a good chance it also works on FreeBSD, maybe also on macOS. The change in __main__.py was required because otherwise it complains about __main__ not being a package when trying the dot-relative import.
- Loading branch information...
Showing with 61 additions and 7 deletions.
|@@ -0,0 +1,17 @@|
|# use pyinstaller to build a single-file "fat binary" called wormhole.exe.|
|# the .exe here does NOT mean a windows executable, but an executable in general.|
|# "fat binary" means it includes the python interpreter, the python source code|
|# and libs, compiled code parts and externally needed (C/compiled) libraries.|
|# it does NOT include the (g)libc though as this needs to be provided by the|
|# target platform and needs to match the kernel there. thus, it is a good idea|
|# to run the build on an old, but still security-supported linux (or other posix|
|# OS) to keep the minimum (g)libc requirement low.|
|pyinstaller --clean --distpath=dist wormhole.exe.spec|
|# result will be in dist/wormhole.exe|
|@@ -0,0 +1,43 @@|
|# -*- mode: python -*-|
|# this pyinstaller spec file is used to build wormhole binaries on posix platforms|
|import os, sys|
|# your cwd should be in the same dir as this file, so .. is the project directory:|
|basepath = os.path.realpath('..')|
|a = Analysis([os.path.join(basepath, 'src/wormhole/__main__.py'), ],|
|pyz = PYZ(a.pure, a.zipped_data, cipher=None)|
|exe = EXE(pyz,|
|# Enable this block to build a directory-based binary instead of|
|# a packed single file.|
|coll = COLLECT(exe,|