Skip to content

Commit

Permalink
Support extra PyInstaller args on Mac and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mherrmann committed Apr 18, 2018
1 parent b62d88e commit fe0c67f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions fbs/freeze/arch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from fbs.freeze.linux import freeze_linux, remove_shared_libraries

def freeze_arch():
freeze_linux()
def freeze_arch(extra_pyinstaller_args=None):
freeze_linux(extra_pyinstaller_args)
# Our apps normally ship with eg. libQt5Core.so.5. This loads other .so
# files, if present, from /usr/lib. If those libraries are Qt libraries of a
# different Qt version, errors occur.
Expand Down
4 changes: 2 additions & 2 deletions fbs/freeze/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from os import remove
from shutil import copy

def freeze_linux():
run_pyinstaller()
def freeze_linux(extra_pyinstaller_args=None):
run_pyinstaller(extra_pyinstaller_args)
generate_resources(dest_dir=path('${freeze_dir}'))
copy(path('src/main/icons/Icon.ico'), path('${freeze_dir}'))
# For some reason, PyInstaller packages libstdc++.so.6 even though it is
Expand Down
6 changes: 4 additions & 2 deletions fbs/freeze/mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from shutil import copy, rmtree
from subprocess import run

def freeze_mac():
def freeze_mac(extra_pyinstaller_args=None):
if extra_pyinstaller_args is None:
extra_pyinstaller_args = []
if not exists(path('target/Icon.icns')):
_generate_iconset()
run(['iconutil', '-c', 'icns', path('target/Icon.iconset')], check=True)
Expand All @@ -19,7 +21,7 @@ def freeze_mac():
pyinstaller_args.extend([
'--osx-bundle-identifier', bundle_identifier
])
run_pyinstaller(extra_args=pyinstaller_args)
run_pyinstaller(extra_args=pyinstaller_args + extra_pyinstaller_args)
_remove_unwanted_pyinstaller_files()
_fix_sparkle_delta_updates()
generate_resources(
Expand Down
6 changes: 3 additions & 3 deletions fbs/freeze/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
def freeze_windows(extra_pyinstaller_args=None):
if extra_pyinstaller_args is None:
extra_pyinstaller_args = []
args = [
pyinstaller_args = [
'--windowed',
'--icon', path('src/main/icons/Icon.ico')
] + extra_pyinstaller_args
run_pyinstaller(extra_args=args)
]
run_pyinstaller(extra_args=pyinstaller_args + extra_pyinstaller_args)
_restore_corrupted_python_dlls()
generate_resources(dest_dir=path('${freeze_dir}'))
copy(path('src/main/icons/Icon.ico'), path('${freeze_dir}'))
Expand Down

0 comments on commit fe0c67f

Please sign in to comment.