[gnome-contacts] Meson: add post-install script.



commit aa163bdc0f55f6ff291fb0bbf391ab9eb3905b40
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Aug 23 20:25:34 2017 +0200

    Meson: add post-install script.
    
    To make sure the icon cache etc. are updated.

 meson.build           |    4 ++++
 meson_post_install.py |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/meson.build b/meson.build
index ae31d19..da9de87 100644
--- a/meson.build
+++ b/meson.build
@@ -60,6 +60,10 @@ conf.set_quoted('PKGLIBDIR', pkglibdir)
 conf.set_quoted('VERSION', meson.project_version())
 configure_file(output: 'config.h', configuration: conf)
 
+# Post-install scripts
+meson.add_install_script('meson_post_install.py')
+
+# Subfolders
 subdir('data')
 subdir('po')
 subdir('src')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..bf320a9
--- /dev/null
+++ b/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])


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