[tali/flatpak-nightlies: 1/3] meson: add new tasks on post install
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tali/flatpak-nightlies: 1/3] meson: add new tasks on post install
- Date: Sun, 20 Jan 2019 23:21:18 +0000 (UTC)
commit 5c7efe3accafd2f40b8d1554255e6e02c4aea66f
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Mon Jan 21 00:18:53 2019 +0100
meson: add new tasks on post install
Update the destkop database & icon cache.
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 51d54aa..8a8e926 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')
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]