def freeze_windows(extra_pyinstaller_args=None): if extra_pyinstaller_args is None: extra_pyinstaller_args = [] args = ['--windowed', '--icon', path('src/main/icons/Icon.ico')] + extra_pyinstaller_args run_pyinstaller(extra_args=args) _restore_corrupted_python_dlls() generate_resources(dest_dir=path('${freeze_dir}')) copy(path('src/main/icons/Icon.ico'), path('${freeze_dir}')) _add_missing_dlls()
def freeze_linux(): run_pyinstaller() generate_resources(dest_dir=path('target/App.app')) copy(path('src/main/icons/Icon.ico'), path('target/App.app')) # For some reason, PyInstaller packages libstdc++.so.6 even though it is # available on most Linux distributions. If we include it and run our app on # a different Ubuntu version, then Popen(...) calls fail with errors # "GLIBCXX_... not found" or "CXXABI_..." not found. So ensure we don't # package the file, so that the respective system's compatible version is # used: remove_shared_libraries('libstdc++.so.*', 'libtinfo.so.*', 'libreadline.so.*', 'libdrm.so.*')
def freeze_windows(extra_pyinstaller_args=None, debug=False): if extra_pyinstaller_args is None: extra_pyinstaller_args = [] pyinstaller_args = [] if not debug: # The --windowed flag below prevents us from seeing any console output. # We therefore only add it when we're not debugging. pyinstaller_args.append('--windowed') pyinstaller_args.extend(['--icon', path('src/main/icons/Icon.ico')]) run_pyinstaller(pyinstaller_args + extra_pyinstaller_args, debug) _restore_corrupted_python_dlls() generate_resources() copy(path('src/main/icons/Icon.ico'), path('${freeze_dir}')) _add_missing_dlls()
def freeze_windows(extra_pyinstaller_args=None): if extra_pyinstaller_args is None: extra_pyinstaller_args = [] args = ['--windowed', '--icon', path('src/main/icons/Icon.ico')] + extra_pyinstaller_args run_pyinstaller(extra_args=args) # PyInstaller somehow corrupts python3*.dll - see: # https://github.com/pyinstaller/pyinstaller/issues/2526 # Restore the uncorrupted original: for dll_name in ('python3.dll', 'python35.dll'): remove(path('target/App.app/' + dll_name)) copy(join(dirname(sys.executable), dll_name), path('target/App.app')) generate_resources(dest_dir=path('target/App.app')) copy(path('src/main/icons/Icon.ico'), path('target/App.app')) _add_missing_dlls()
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) pyinstaller_args = ['--windowed', '--icon', path('target/Icon.icns')] bundle_identifier = SETTINGS.get('mac_bundle_identifier', '') if bundle_identifier: pyinstaller_args.extend(['--osx-bundle-identifier', bundle_identifier]) run_pyinstaller(extra_args=pyinstaller_args + extra_pyinstaller_args) _remove_unwanted_pyinstaller_files() _fix_sparkle_delta_updates() generate_resources()
def freeze_windows(extra_pyinstaller_args=None): if extra_pyinstaller_args is None: extra_pyinstaller_args = [] args = ['--windowed', '--icon', path('src/main/icons/Icon.ico')] + extra_pyinstaller_args run_pyinstaller(extra_args=args) # PyInstaller somehow corrupts python3*.dll - see: # https://github.com/pyinstaller/pyinstaller/issues/2526 # Restore the uncorrupted original: python_dlls = ('python%s.dll' % sys.version_info.major, 'python%s%s.dll' % (sys.version_info.major, sys.version_info.minor)) for dll_name in python_dlls: remove(path('${freeze_dir}/' + dll_name)) copy(join(dirname(sys.executable), dll_name), path('${freeze_dir}')) generate_resources(dest_dir=path('${freeze_dir}')) copy(path('src/main/icons/Icon.ico'), path('${freeze_dir}')) _add_missing_dlls()
def test_generate_resources(self): self.init_fbs('Mac') generate_resources() self.assertTrue(exists(path('${freeze_dir}/Contents/Info.plist')))