[gtk/wip/fanc999/gtk-3-24-meson-msvc: 2/2] meson: Make post-install script a Python script
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/fanc999/gtk-3-24-meson-msvc: 2/2] meson: Make post-install script a Python script
- Date: Mon, 25 Mar 2019 05:02:52 +0000 (UTC)
commit afe25428f3656b258b970482807200a62ebb6a8d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Mar 22 17:31:02 2019 +0800
meson: Make post-install script a Python script
This is so that the post install script will work on environments where
*NIX shell scripts are not supported, such as on Windows cmd.exe for
Visual Studio builds.
build-aux/meson/post-install.py | 31 +++++++++++++++++++++++++++++++
build-aux/meson/post-install.sh | 26 --------------------------
meson.build | 4 ++--
3 files changed, 33 insertions(+), 28 deletions(-)
---
diff --git a/build-aux/meson/post-install.py b/build-aux/meson/post-install.py
new file mode 100644
index 0000000000..d81abd28a4
--- /dev/null
+++ b/build-aux/meson/post-install.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import subprocess
+
+if 'DESTDIR' not in os.environ:
+ gtk_api_version = sys.argv[1]
+ gtk_abi_version = sys.argv[2]
+ gtk_libdir = sys.argv[3]
+ gtk_datadir = sys.argv[4]
+
+ gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
+ gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
+ gtk_immodule_dir = os.path.join(gtk_moduledir, 'immodules')
+
+ print('Compiling GSettings schemas...')
+ subprocess.call(['glib-compile-schemas',
+ os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
+
+ print('Updating icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-q', '-t' ,'-f',
+ os.path.join(gtk_datadir, 'icons', 'hicolor')])
+
+ print('Updating module cache for print backends...')
+ os.makedirs(gtk_printmodule_dir, exist_ok=True)
+ subprocess.call(['gio-querymodules', gtk_printmodule_dir])
+
+ print('Updating module cache for input methods...')
+ os.makedirs(gtk_immodule_dir, exist_ok=True)
+ subprocess.call(['gio-querymodules', gtk_immodule_dir])
diff --git a/meson.build b/meson.build
index 4b902f276e..ef808b5aa7 100644
--- a/meson.build
+++ b/meson.build
@@ -749,8 +749,8 @@ endif
# subdir('docs/reference')
#endif
-# Keep this in sync with post-install.sh expected arguments
-meson.add_install_script('build-aux/meson/post-install.sh',
+# Keep this in sync with post-install.py expected arguments
+meson.add_install_script('build-aux/meson/post-install.py',
gtk_api_version,
gtk_binary_version,
gtk_libdir,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]