Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def freeze_fedora(debug=False):
freeze_linux(debug)
# Force Fedora to use the system's Gnome libraries. This avoids warnings
# when starting the app on the command line.
remove_shared_libraries('libgio-2.0.so.*', 'libglib-2.0.so.*')
# Fixes for Fedora 29:
remove_shared_libraries('libfreetype.so.*', 'libssl.so.*')
# PyInstaller 3.4 includes the library below when on Python 3.6.
# (Interestingly, it does not package it on Python 3.5.) This leads to a lot
# of Fontconfig-related errors when starting the frozen app. Further,
# starting the app takes ages. Removing the library fixes this:
remove_shared_libraries('libfontconfig.so.*')
def freeze_arch(debug=False):
freeze_linux(debug)
from fbs.freeze.windows import freeze_windows
freeze_windows(debug=debug)
executable += '.exe'
elif is_linux():
if is_ubuntu():
from fbs.freeze.ubuntu import freeze_ubuntu
freeze_ubuntu(debug=debug)
elif is_arch_linux():
from fbs.freeze.arch import freeze_arch
freeze_arch(debug=debug)
elif is_fedora():
from fbs.freeze.fedora import freeze_fedora
freeze_fedora(debug=debug)
else:
from fbs.freeze.linux import freeze_linux
freeze_linux(debug=debug)
else:
raise FbsError('Unsupported OS')
_LOG.info(
"Done. You can now run `%s`. If that doesn't work, see "
"https://build-system.fman.io/troubleshooting.", executable
)
from fbs.freeze.windows import freeze_windows
freeze_windows(debug=debug)
executable += '.exe'
elif is_linux():
if is_ubuntu():
from fbs.freeze.ubuntu import freeze_ubuntu
freeze_ubuntu(debug=debug)
elif is_arch_linux():
from fbs.freeze.arch import freeze_arch
freeze_arch(debug=debug)
elif is_fedora():
from fbs.freeze.fedora import freeze_fedora
freeze_fedora(debug=debug)
else:
from fbs.freeze.linux import freeze_linux
freeze_linux(debug=debug)
else:
raise RuntimeError('Unsupported OS')
_LOG.info(
"Done. You can now run `%s`. If that doesn't work, see "
"https://build-system.fman.io/troubleshooting.", executable
)
def freeze_ubuntu(debug=False):
freeze_linux(debug)
# When we build on Ubuntu on 14.04 and run on 17.10, the app fails to start
# with the following error:
#
# > This application failed to start because it could not find or load the
# > Qt platform plugin "xcb" in "". Available platform plugins are:
# > eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
#
# Interestingly, the error does not occur when building on Ubuntu 16.04.
# The difference between the two build outputs seems to be
# libgpg-error.so.0. Removing it fixes the problem:
remove_shared_libraries('libgpg-error.so.*')
# libgtk-3.so is present on every Ubuntu system. Make sure we don't ship it
# to avoid incompatibilities. In particular, running the frozen app with
# libgtk-3.so from Ubuntu 14 on Ubuntu 16 produces many Gtk warnings
# "Theme parsing error".
remove_shared_libraries('libgtk-3.so.*')