#-----------------------------------------------------------------------------
# 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')
Example #2
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:
        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 = []
Example #3
0
# 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
"""

import os
import os.path
import glob

from PyInstaller.compat import is_win
from PyInstaller.utils.hooks import collect_glib_share_files, collect_glib_etc_files, collect_glib_translations, exec_statement, get_gi_typelibs

binaries, datas, hiddenimports = get_gi_typelibs('Gtk', '3.0')

datas += collect_glib_share_files('fontconfig')
datas += collect_glib_share_files('icons')
datas += collect_glib_share_files('themes')
datas += collect_glib_translations('gtk30')

# these only seem to be required on Windows
if is_win:
    datas += collect_glib_etc_files('fonts')
    datas += collect_glib_etc_files('pango')
    datas += collect_glib_share_files('fonts')
#-----------------------------------------------------------------------------
# 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-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
"""

import os
import os.path
import glob

from PyInstaller.compat import is_win
from PyInstaller.utils.hooks import collect_glib_share_files, collect_glib_etc_files, collect_glib_translations, exec_statement, get_gi_typelibs

binaries, datas, hiddenimports = get_gi_typelibs('Gtk', '3.0')

datas += collect_glib_share_files('fontconfig')
datas += collect_glib_share_files('icons')
datas += collect_glib_share_files('themes')
datas += collect_glib_translations('gtk30')

# these only seem to be required on Windows
if is_win:
    datas += collect_glib_etc_files('fonts')
    datas += collect_glib_etc_files('pango')
    datas += collect_glib_share_files('fonts')
#-----------------------------------------------------------------------------
# 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')

import glob
import os
from PyInstaller.utils.hooks import collect_glib_share_files, collect_glib_translations, exec_statement, get_gi_typelibs

binaries, datas, hiddenimports = get_gi_typelibs('Gst', '1.0')

datas += collect_glib_share_files('gstreamer-1.0')

hiddenimports += ["gi.repository.Gio"]

for prog in ['gst-plugins-bad-1.0',
             'gst-plugins-base-1.0',
             'gst-plugins-good-1.0',
             'gst-plugins-ugly-1.0',
             'gstreamer-1.0']:
    datas += collect_glib_translations(prog)

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)
    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.
    if pattern: