[gnome-dictionary/ebassi/for-master] Use a Python post-install script



commit ee477e66f38f19bcc1dc54fe37ac9edb0d2f51e4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Sep 21 21:18:39 2020 +0100

    Use a Python post-install script
    
    Instead of a shell script. We know we're going to have Python at install
    time.

 build-aux/meson/post-install.py | 15 +++++++++++++++
 build-aux/meson/post-install.sh | 10 ----------
 meson.build                     |  2 +-
 3 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/build-aux/meson/post-install.py b/build-aux/meson/post-install.py
new file mode 100644
index 0000000..b26c88a
--- /dev/null
+++ b/build-aux/meson/post-install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+install_prefix = os.environ['MESON_INSTALL_PREFIX']
+icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
+schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
+
+if not os.environ.get('DESTDIR'):
+    print('Update icon cache...')
+    subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+
+    print('Compiling gsettings schemas...')
+    subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/meson.build b/meson.build
index 81aa1c1..9a3d52d 100644
--- a/meson.build
+++ b/meson.build
@@ -141,4 +141,4 @@ subdir('data')
 subdir('help')
 
 # Post-installation trigger
-meson.add_install_script ('build-aux/meson/post-install.sh')
+meson.add_install_script ('build-aux/meson/post-install.py')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]