2019-02-25 05:09:35 +00:00
|
|
|
#!/usr/bin/env python3
|
2020-12-20 16:33:41 +00:00
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
if 'DESTDIR' not in os.environ:
|
|
|
|
gtk_api_version = sys.argv[1]
|
|
|
|
gtk_abi_version = sys.argv[2]
|
2019-02-26 22:51:55 +00:00
|
|
|
gtk_libdir = sys.argv[3]
|
|
|
|
gtk_datadir = sys.argv[4]
|
2020-12-20 16:33:41 +00:00
|
|
|
gtk_bindir = sys.argv[5]
|
|
|
|
|
|
|
|
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
|
|
|
|
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
|
2022-01-14 17:53:36 +00:00
|
|
|
gtk_mediamodule_dir = os.path.join(gtk_moduledir, 'media')
|
2020-12-20 16:33:41 +00:00
|
|
|
|
|
|
|
print('Compiling GSettings schemas...')
|
2020-06-21 18:49:50 +00:00
|
|
|
glib_compile_schemas = subprocess.check_output(['pkg-config',
|
|
|
|
'--variable=glib_compile_schemas',
|
|
|
|
'gio-2.0']).strip()
|
2020-06-28 10:48:27 +00:00
|
|
|
if not os.path.exists(glib_compile_schemas):
|
|
|
|
# pkg-config variables only available since GLib 2.62.0.
|
|
|
|
glib_compile_schemas = 'glib-compile-schemas'
|
2020-06-21 18:49:50 +00:00
|
|
|
subprocess.call([glib_compile_schemas,
|
2020-12-20 16:33:41 +00:00
|
|
|
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
|
|
|
|
|
|
|
|
print('Updating icon cache...')
|
|
|
|
update_icon_cache = os.path.join(gtk_bindir, 'gtk4-update-icon-cache')
|
|
|
|
subprocess.call([update_icon_cache, '-q', '-t' ,'-f',
|
|
|
|
os.path.join(gtk_datadir, 'icons', 'hicolor')])
|
|
|
|
|
|
|
|
print('Updating module cache for print backends...')
|
2019-02-26 22:55:08 +00:00
|
|
|
os.makedirs(gtk_printmodule_dir, exist_ok=True)
|
2020-06-21 18:49:50 +00:00
|
|
|
gio_querymodules = subprocess.check_output(['pkg-config',
|
|
|
|
'--variable=gio_querymodules',
|
|
|
|
'gio-2.0']).strip()
|
2020-06-28 10:48:27 +00:00
|
|
|
if not os.path.exists(gio_querymodules):
|
|
|
|
# pkg-config variables only available since GLib 2.62.0.
|
|
|
|
gio_querymodules = 'gio-querymodules'
|
2020-06-21 18:49:50 +00:00
|
|
|
subprocess.call([gio_querymodules, gtk_printmodule_dir])
|
2020-12-20 16:33:41 +00:00
|
|
|
|
2022-01-14 17:53:36 +00:00
|
|
|
print('Updating module cache for media backends...')
|
|
|
|
os.makedirs(gtk_mediamodule_dir, exist_ok=True)
|
|
|
|
subprocess.call([gio_querymodules, gtk_mediamodule_dir])
|