[gnome-boxes/wip/inigomartinez/meson: 6/6] meson: Fix post install script
- From: Iñigo Martínez <inigomartinez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/inigomartinez/meson: 6/6] meson: Fix post install script
- Date: Sat, 9 Dec 2017 20:39:57 +0000 (UTC)
commit 1df90735823b57a77fa07eb0f683d610e281cf8c
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Sat Dec 9 21:27:53 2017 +0100
meson: Fix post install script
meson uses a post install script for compiling gsettings schemas,
updating the icon cache and also updating the desktop database.
However, it assumes that the data directory is the share directory
under prefix, which might not be correct because the user can choose
a different directory.
This patch uses the data directory used by meson by passing it to
the post install script.
https://bugzilla.gnome.org/show_bug.cgi?id=791421
build-aux/post_install.py | 14 +++++++-------
meson.build | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/build-aux/post_install.py b/build-aux/post_install.py
index c1faf09..a075a22 100755
--- a/build-aux/post_install.py
+++ b/build-aux/post_install.py
@@ -1,19 +1,19 @@
#!/usr/bin/python3
import os
-import pathlib
import subprocess
+import sys
-prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local'))
-datadir = prefix / 'share'
destdir = os.environ.get('DESTDIR', '')
-if not destdir:
+if not destdir and len(sys.argv) > 1:
+ datadir = sys.argv[1]
+
print('Compiling gsettings schemas...')
- subprocess.call(['glib-compile-schemas', str(datadir / 'glib-2.0' / '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', str(datadir / 'icons' / 'hicolor')])
+ subprocess.call(['gtk-update-icon-cache', '-qtf', os.path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database...')
- subprocess.call(['update-desktop-database', '-q', str(datadir / 'applications')])
+ subprocess.call(['update-desktop-database', '-q', os.path.join(datadir, 'icons', 'applications')])
diff --git a/meson.build b/meson.build
index 5ab4318..efdac84 100644
--- a/meson.build
+++ b/meson.build
@@ -79,7 +79,7 @@ endif
configure_file (output: 'config.h', configuration: conf)
config_h_dir = include_directories ('.')
-meson.add_install_script (join_paths ('build-aux', 'post_install.py'))
+meson.add_install_script (join_paths ('build-aux', 'post_install.py'), data_dir)
subdir ('data')
subdir ('help')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]