[gnome-sudoku] meson: Add postinstall script



commit 9458253b689c3962e922843b725cea0c1c34dbf8
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Fri Jun 1 07:54:09 2018 +0200

    meson: Add postinstall script

 meson.build     |  2 ++
 post_install.py | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)
---
diff --git a/meson.build b/meson.build
index 6eaeeb6..f1f977a 100644
--- a/meson.build
+++ b/meson.build
@@ -53,3 +53,5 @@ subdir('help')
 subdir('lib')
 subdir('po')
 subdir('src')
+
+meson.add_install_script('post_install.py')
diff --git a/post_install.py b/post_install.py
new file mode 100755
index 0000000..cc5e2a6
--- /dev/null
+++ b/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')])


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