[gnome-mines] meson: improve post install script



commit b8e4371b7fde3b1783a9d0cc95f8d067e33eaf37
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sun Jan 6 00:02:57 2019 +0100

    meson: improve post install script

 build-aux/meson_post_install.py | 15 +++++++++++++++
 data/meson.build                |  1 -
 data/meson_compile_gschema.py   | 10 ----------
 meson.build                     |  1 +
 4 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 100755
index 0000000..9784940
--- /dev/null
+++ b/build-aux/meson_post_install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+datadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share')
+
+if not os.environ.get('DESTDIR'):
+    print('Compiling gsettings schemas...')
+    subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')])
+    print('Updating icon cache...')
+    subprocess.call(['gtk-update-icon-cache', os.path.join(datadir, 'icons', 'hicolor')])
+    print('Updating desktop database...')
+    subprocess.call(['update-desktop-database', os.path.join(datadir, 'applications')])
+    
\ No newline at end of file
diff --git a/data/meson.build b/data/meson.build
index 84d23d3..abac290 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -7,7 +7,6 @@ install_data (join_paths ('icons', 'hicolor', 'scalable', '@0 -symbolic svg'.for
 
 install_data ('@0  gschema xml'.format(app_id),
               install_dir: join_paths (datadir, 'glib-2.0', 'schemas'))
-meson.add_install_script ('meson_compile_gschema.py')
 
 foreach theme: [ 'default', 'bgcolors', 'classic' ]
     foreach file: [ 'theme.css',
diff --git a/meson.build b/meson.build
index afa1b80..f9c3e65 100644
--- a/meson.build
+++ b/meson.build
@@ -29,3 +29,4 @@ subdir ('po')
 subdir ('data')
 subdir ('help')
 subdir ('src')
+meson.add_install_script ('build-aux/meson_post_install.py')


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