[gnome-tetravex/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: [gnome-tetravex/flatpak-nightlies: 1/3] meson: add new tasks on post install
- Date: Sun, 20 Jan 2019 23:12:48 +0000 (UTC)
commit b36c366f26797f6ff23ee5191ecbc0b340666810
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Mon Jan 21 00:08:21 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 | 2 +-
data/meson_compile_gschema.py | 10 ----------
meson.build | 2 ++
4 files changed, 24 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 a02b39a..7facd7d 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -9,7 +9,7 @@ install_data (join_paths ('icons', 'hicolor', 'scalable', project_id + '-symboli
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 6d00387..240c049 100644
--- a/meson.build
+++ b/meson.build
@@ -25,3 +25,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]