From dffef90bd65d862db9fb881c09bd21e98b779b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sat, 7 Jan 2017 22:49:32 +0100 Subject: [PATCH] Add support for self-contained bundle build for macOS and Windows --- build-on-mac.spec | 31 +++++++++++++++++++++++++++++++ build-on-win.spec | 26 ++++++++++++++++++++++++++ build.bat | 6 +----- build.sh | 9 ++------- 4 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 build-on-mac.spec create mode 100644 build-on-win.spec diff --git a/build-on-mac.spec b/build-on-mac.spec new file mode 100644 index 0000000..2d4d6e2 --- /dev/null +++ b/build-on-mac.spec @@ -0,0 +1,31 @@ +# -*- mode: python -*- + +block_cipher = None + + +a = Analysis(['nodemcu-pyflasher.py'], + binaries=None, + datas=[("images", "images")], + hiddenimports=[], + hookspath=[], + 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, + a.binaries, + a.zipfiles, + a.datas, + name='NodeMCU-PyFlasher', + debug=False, + strip=False, + upx=True, + console=False , icon='images/icon-256.icns') +app = BUNDLE(exe, + name='NodeMCU-PyFlasher.app', + icon='./images/icon-256.icns', + bundle_identifier='com.frightanic.nodemcu-pyflasher') diff --git a/build-on-win.spec b/build-on-win.spec new file mode 100644 index 0000000..9b894f0 --- /dev/null +++ b/build-on-win.spec @@ -0,0 +1,26 @@ +# -*- mode: python -*- + +block_cipher = None + +a = Analysis(['nodemcu-pyflasher.py'], + binaries=[], + datas=[("images", "images")], + hiddenimports=[], + hookspath=[], + 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, + a.binaries, + a.zipfiles, + a.datas, + name='NodeMCU-PyFlasher', + debug=False, + strip=False, + upx=True, + console=False , icon='images\\icon-256.ico') diff --git a/build.bat b/build.bat index 80679e3..8749fba 100755 --- a/build.bat +++ b/build.bat @@ -1,7 +1,3 @@ pyinstaller --log-level=DEBUG ^ - --windowed ^ - --icon=.\images\icon-256.png ^ - --name="NodeMCU-PyFlasher" ^ --noconfirm ^ - --onefile ^ - nodemcu-pyflasher.py + build-on-win.spec diff --git a/build.sh b/build.sh index 6db8f04..33e611f 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,5 @@ #!/usr/bin/env bash -rm -fr build dist +#rm -fr build dist pyinstaller --log-level=DEBUG \ - --windowed \ - --icon=./images/icon-256.icns \ - --name="NodeMCU-PyFlasher" \ --noconfirm \ - --onefile \ - --osx-bundle-identifier=com.frightanic.nodemcu-pyflasher \ - nodemcu-pyflasher.py + build-on-mac.spec