Tested with GLib 2.44.1, PyGObject 3.16.2, GObject Introspection 1.44.0 on Mac OS X 10.10.5 and GLib 2.42.2, PyGObject 3.14.0, and GObject Introspection 1.42 on Windows 7 """ import glob import os import sys import PyInstaller.log as logging from PyInstaller.compat import is_darwin, is_win, is_linux, base_prefix from PyInstaller.utils.hooks import get_gi_typelibs, get_gi_libdir, exec_statement logger = logging.getLogger(__name__) binaries, datas, hiddenimports = get_gi_typelibs('Gio', '2.0') libdir = get_gi_libdir('Gio', '2.0') path = None if is_win: pattern = os.path.join(libdir, 'gio', 'modules', '*.dll') elif is_darwin or is_linux: gio_libdir = os.path.join(libdir, 'gio', 'modules') if not os.path.exists(gio_libdir): # homebrew installs the files elsewhere.. gio_libdir = os.path.join(os.path.commonprefix([base_prefix, gio_libdir]), 'lib', 'gio', 'modules') pattern = os.path.join(gio_libdir, '*.so') if pattern:
#----------------------------------------------------------------------------- # Copyright (c) 2005-2017, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('Gdk', '3.0') hiddenimports += ['gi._gi_cairo', 'gi.repository.cairo']
# ----------------------------------------------------------------------------- # Copyright (c) 2005-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # ----------------------------------------------------------------------------- """ Import hook for PyGObject's "gi.repository.GtkChamplain" package. """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GtkChamplain', '0.12')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for PyGObject's "gi.repository.GtkClutter" package. """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GtkClutter', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject's "gi.repository.Clutter" package. """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('Clutter', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GIRepository', '2.0')
# ----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # ----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_glib_share_files, get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GtkSource', '3.0') datas += collect_glib_share_files('gtksourceview-3.0')
cmds = ['gdk-pixbuf-query-loaders-64', 'gdk-pixbuf-query-loaders'] else: cmds = ['gdk-pixbuf-query-loaders'] for cmd in cmds: gdk_pixbuf_query_loaders = which(cmd) if gdk_pixbuf_query_loaders is not None: break if gdk_pixbuf_query_loaders is None: logger.warning( '"hook-gi.repository.GdkPixbuf" ignored, since GDK not found ' '(i.e., "gdk-pixbuf-query-loaders" not in $PATH).') # Else, GDK is available. Let's do this. else: binaries, datas, hiddenimports = get_gi_typelibs('GdkPixbuf', '2.0') datas += collect_glib_translations('gdk-pixbuf') libdir = get_gi_libdir('GdkPixbuf', '2.0') # To add support for a new platform, add a new "elif" branch below with the # proper is_<platform>() test and glob for finding loaders on that platform. if is_win: ext = "*.dll" elif is_darwin or is_linux: ext = "*.so" # If loader detection is supported on this platform, bundle all detected # loaders and an updated loader cache. if ext: loader_libs = []
#----------------------------------------------------------------------------- # Copyright (c) 2005-2017, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GIRepository', '2.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('PangoCairo', '1.0')
"""Import hook for PyGObject https://wiki.gnome.org/PyGObject.""" from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs("GtkosxApplication", "1.0")
#----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.compat import is_darwin from PyInstaller.utils.hooks import get_gi_typelibs if is_darwin: binaries, datas, hiddenimports = get_gi_typelibs('GtkosxApplication', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2017, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for Gst(GStreamer) http://gstreamer.freedesktop.org/ introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GstPbutils', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('PangoCairo', '1.0')
else: cmds = ['gdk-pixbuf-query-loaders'] for cmd in cmds: gdk_pixbuf_query_loaders = which(cmd) if gdk_pixbuf_query_loaders is not None: break if gdk_pixbuf_query_loaders is None: logger.warning( '"hook-gi.repository.GdkPixbuf" ignored, since GDK not found ' '(i.e., "gdk-pixbuf-query-loaders" not in $PATH).' ) # Else, GDK is available. Let's do this. else: binaries, datas, hiddenimports = get_gi_typelibs('GdkPixbuf', '2.0') datas += collect_glib_translations('gdk-pixbuf') libdir = get_gi_libdir('GdkPixbuf', '2.0') # To add support for a new platform, add a new "elif" branch below with the # proper is_<platform>() test and glob for finding loaders on that platform. if is_win: pattern = os.path.join( libdir, 'gdk-pixbuf-2.0', '2.10.0', 'loaders', '*.dll') elif is_darwin or is_linux: pattern = os.path.join( libdir, 'gdk-pixbuf-2.0', '2.10.0', 'loaders', '*.so') # If loader detection is supported on this platform, bundle all detected # loaders and an updated loader cache.
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for GObject https://developer.gnome.org/gobject/stable/ from the GLib library https://wiki.gnome.org/Projects/GLib introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection Tested with GLib 2.44.1, PyGObject 3.16.2, and GObject Introspection 1.44.0 on Mac OS X 10.10 and GLib 2.42.2, PyGObject 3.14.0, and GObject Introspection 1.42 on Windows 7 """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GObject', '2.0') hiddenimports += ['gi._gobject']
#----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for Gst(GStreamer) http://gstreamer.freedesktop.org/ introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GstTag', '1.0')
"""Temporary hook to support HarfBuzz. Work around for https://github.com/pyinstaller/pyinstaller/issues/5129 Both this file and the pre_safe import hook are required. """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs("HarfBuzz", "0.0")
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('HarfBuzz', '0.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for Gst(GStreamer) http://gstreamer.freedesktop.org/ introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GstPbutils', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for GModule https://developer.gnome.org/glib/stable/glib-Dynamic-Loading-of-Modules.html from the GLib library https://wiki.gnome.org/Projects/GLib introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection Tested with GLib 2.44.1, PyGObject 3.16.2, and GObject Introspection 1.44.0 on Mac OS X 10.10 and GLib 2.42.2, PyGObject 3.14.0, and GObject Introspection 1.42 on Windows 7 """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GModule', '2.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('Gdk', '3.0') hiddenimports += ['gi._gi_cairo', 'gi.repository.cairo']
#----------------------------------------------------------------------------- # Copyright (c) 2005-2016, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for the GLib library https://wiki.gnome.org/Projects/GLib introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection Tested with GLib 2.44.1, PyGObject 3.16.2, and GObject Introspection 1.44.0 on Mac OS X 10.10 and GLib 2.42.2, PyGObject 3.14.0, and GObject Introspection 1.42 on Windows 7 """ from PyInstaller.utils.hooks import collect_glib_translations, collect_glib_share_files, get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GLib', '2.0') datas += collect_glib_translations('glib20') datas += collect_glib_share_files('glib-2.0', 'schemas')
# ----------------------------------------------------------------------------- # Copyright (c) 2005-2016, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # ----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs("cairo", "1.0")
#----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import collect_glib_translations, get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('Atk', '1.0') datas += collect_glib_translations('atk10')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for Gst(GStreamer) http://gstreamer.freedesktop.org/ introspected through PyGobject https://wiki.gnome.org/PyGObject via the GObject Introspection middleware layer https://wiki.gnome.org/Projects/GObjectIntrospection """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GstVideo', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------------------------------------------------------------- """ Import hook for PyGObject's "gi.repository.GtkChamplain" package. """ from PyInstaller.utils.hooks import get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('GtkChamplain', '0.12')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- """ Import hook for PyGObject https://wiki.gnome.org/PyGObject """ from PyInstaller.utils.hooks import collect_glib_translations, get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs('Atk', '1.0') datas += collect_glib_translations('atk10')
# ----------------------------------------------------------------------------- # Copyright (c) 2005-2018, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # ----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_glib_share_files, get_gi_typelibs binaries, datas, hiddenimports = get_gi_typelibs("GtkSource", "3.0") datas += collect_glib_share_files("gtksourceview-3.0")