[shotwell/shotwell-0.30] build: Add post-install script



commit 2cdf52b48b25a5aea452a7d2c671057729cd381d
Author: Jens Georg <mail jensge org>
Date:   Wed Sep 19 10:30:37 2018 +0200

    build: Add post-install script

 build-aux/meson/postinstall.py  | 21 +++++++++++++++++++++
 flatpak/org.gnome.Shotwell.json |  3 ---
 meson.build                     |  1 +
 3 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/build-aux/meson/postinstall.py b/build-aux/meson/postinstall.py
new file mode 100755
index 00000000..6a3ea971
--- /dev/null
+++ b/build-aux/meson/postinstall.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+from os import environ, path
+from subprocess import call
+
+prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
+datadir = path.join(prefix, 'share')
+destdir = environ.get('DESTDIR', '')
+
+# Package managers set this so we don't need to run
+if not destdir:
+    print('Updating icon cache...')
+    call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
+
+    print('Updating desktop database...')
+    call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
+
+    print('Compiling GSettings schemas...')
+    call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])
+
+
diff --git a/flatpak/org.gnome.Shotwell.json b/flatpak/org.gnome.Shotwell.json
index a2f42309..e6492f3e 100644
--- a/flatpak/org.gnome.Shotwell.json
+++ b/flatpak/org.gnome.Shotwell.json
@@ -164,9 +164,6 @@
                     "url" : "https://gitlab.gnome.org/GNOME/shotwell";,
                     "branch" : "master"
                 }
-            ],
-            "post-install": [
-                "glib-compile-schemas /app/share/glib-2.0/schemas/"
             ]
         }
     ]
diff --git a/meson.build b/meson.build
index 375e8a5c..74ab9ccb 100644
--- a/meson.build
+++ b/meson.build
@@ -113,6 +113,7 @@ subdir('settings-migrator')
 subdir('test')
 subdir('app-icons')
 
+meson.add_install_script('build-aux/meson/postinstall.py')
 if get_option('install-apport-hook')
   subdir('apport')
 endif


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