[shotwell] build: Add post-install script
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] build: Add post-install script
- Date: Wed, 19 Sep 2018 08:53:02 +0000 (UTC)
commit 670493c3986e4a0fa0679749fc9a7c4a5689197d
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 | 2 ++
3 files changed, 23 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 b376d4ae..6cc18ea5 100644
--- a/flatpak/org.gnome.Shotwell.json
+++ b/flatpak/org.gnome.Shotwell.json
@@ -161,9 +161,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 a4bb64b0..dc6d4788 100644
--- a/meson.build
+++ b/meson.build
@@ -110,3 +110,5 @@ subdir('po')
subdir('help')
subdir('thumbnailer')
subdir('test')
+
+meson.add_install_script('build-aux/meson/postinstall.py')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]