[tali/flatpak-nightlies: 3/5] meson: update desktop database & icon cache after install



commit d8c7a2e58cdc41b0973f4cc83af62ea7bbfbfc9d
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Mon Jan 21 00:18:53 2019 +0100

    meson: update desktop database & icon cache after install

 build-aux/meson_post_install.py | 21 +++++++++++++++++++++
 data/meson.build                |  1 -
 data/meson_compile_gschema.py   | 10 ----------
 meson.build                     |  2 ++
 4 files changed, 23 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..cc5e2a6
--- /dev/null
+++ b/build-aux/meson_post_install.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
+datadir = os.path.join(prefix, 'share')
+
+# Packaging tools define DESTDIR and this isn't needed for them
+if 'DESTDIR' not in os.environ:
+    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', '-qtf',
+                     os.path.join(datadir, 'icons', 'hicolor')])
+
+    print('Updating desktop database...')
+    subprocess.call(['update-desktop-database', '-q',
+                     os.path.join(datadir, 'applications')])
diff --git a/data/meson.build b/data/meson.build
index 78d49c1..8efddd8 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -23,7 +23,6 @@ install_data ([ 'gnome-dice-1.svg',
 
 install_data (project_id + '.gschema.xml',
               install_dir: join_paths (datadir, 'glib-2.0', 'schemas'))
-meson.add_install_script ('meson_compile_gschema.py')
 
 desktop_file = i18n.merge_file ('desktop-file',
                  input: project_id + '.desktop.in',
diff --git a/meson.build b/meson.build
index fa952f6..4ef1ea2 100644
--- a/meson.build
+++ b/meson.build
@@ -31,3 +31,5 @@ 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]