#----------------------------------------------------------------------------- # Copyright (c) 2005-2015, 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 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_typelibs hiddenimports = ['gi.overrides.GObject', 'gi._gobject.option', 'gi._gobject'] datas = get_typelibs('GObject', '2.0')
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 from PyInstaller.utils.hooks import get_typelibs, exec_statement logger = logging.getLogger(__name__) hiddenimports = ['gi.overrides.Gio'] datas = get_typelibs('Gio', '2.0') binaries = [] statement = """ from gi.repository import Gio print(Gio.__path__) """ path = exec_statement(statement) pattern = None if is_darwin: # Use commonprefix to find common prefix between sys.prefix and the path, e.g., # /opt/local/Library/Frameworks/Python.framework/Versions/3.4, # and /opt/local/lib/girepository-1.0/Gio-2.0.typelib.
import glob import os from PyInstaller.utils.hooks import exec_statement, get_typelibs hiddenimports = [ 'gi.overrides.Gst', 'gi.repository.GObject', 'gi.repository.GModule', 'gi.repository.Gio' ] statement = """ import os import gi gi.require_version('Gst', '1.0') from gi.repository import Gst Gst.init(None) reg = Gst.Registry.get() plug = reg.find_plugin('coreelements') path = plug.get_filename() print(os.path.dirname(path)) """ plugin_path = exec_statement(statement) # Use a pattern of libgst* since all GStreamer plugins that conform to GStreamer standards start with libgst # and we may have mixed plugin extensions, e.g., .so and .dylib. pattern = os.path.join(plugin_path, 'libgst*') binaries = [(f, os.path.join('gst_plugins')) for f in glob.glob(pattern)] datas = get_typelibs('Gst', '1.0')
#----------------------------------------------------------------------------- # Copyright (c) 2005-2015, 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 get_typelibs hiddenimports = ['gi.overrides.GLib'] datas = get_typelibs('GLib', '2.0')
import glob import os import sys import PyInstaller.log as logging from PyInstaller.compat import is_darwin, is_win from PyInstaller.utils.hooks import get_typelibs, exec_statement logger = logging.getLogger(__name__) hiddenimports = ['gi.overrides.Gio'] datas = get_typelibs('Gio', '2.0') binaries = [] statement = """ from gi.repository import Gio print(Gio.__path__) """ path = exec_statement(statement) pattern = None if is_darwin: # Use commonprefix to find common prefix between sys.prefix and the path, e.g., # /opt/local/Library/Frameworks/Python.framework/Versions/3.4,
#----------------------------------------------------------------------------- # Copyright (c) 2005-2015, 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 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_typelibs hiddenimports = ['gi.overrides.GModule'] datas = get_typelibs('GModule', '2.0')
# We also need to resolve binary dependencies of these GStreamer plugins. import glob import os from PyInstaller.utils.hooks import exec_statement, get_typelibs hiddenimports = ['gi.overrides.Gst', 'gi.repository.GObject', 'gi.repository.GModule', 'gi.repository.Gio'] statement = """ import os import gi gi.require_version('Gst', '1.0') from gi.repository import Gst Gst.init(None) reg = Gst.Registry.get() plug = reg.find_plugin('coreelements') path = plug.get_filename() print(os.path.dirname(path)) """ plugin_path = exec_statement(statement) # Use a pattern of libgst* since all GStreamer plugins that conform to GStreamer standards start with libgst # and we may have mixed plugin extensions, e.g., .so and .dylib. pattern = os.path.join(plugin_path, 'libgst*') binaries = [(f, os.path.join('gst_plugins')) for f in glob.glob(pattern)] datas = get_typelibs('Gst', '1.0')