[gnome-disk-utility] build: Use datadir on post install script
- From: Kai Lüke <kailueke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] build: Use datadir on post install script
- Date: Wed, 15 Nov 2017 02:24:34 +0000 (UTC)
commit c5ee1d71d2f89474a8eb67e6b4d7fd537c7fbc12
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Mon Nov 13 19:18:38 2017 +0100
build: Use datadir on post install script
The previous approach used a fixed path for datadir. However,
its location might change.
This patch uses the provided datadir path, if the user provides one,
or the default path.
https://bugzilla.gnome.org/show_bug.cgi?id=790303
meson.build | 5 ++++-
meson_post_install.py | 11 ++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1679fba..41f8cfe 100644
--- a/meson.build
+++ b/meson.build
@@ -132,7 +132,10 @@ configure_file(
configuration: config_h
)
-meson.add_install_script('meson_post_install.py')
+meson.add_install_script(
+ 'meson_post_install.py',
+ gdu_datadir
+)
output = '\n gnome-disk-utility ' + gdu_version + '\n'
output += ' =========================\n\n'
diff --git a/meson_post_install.py b/meson_post_install.py
index bf320a9..6ff4fd2 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -2,14 +2,15 @@
import os
import subprocess
-
-install_prefix = os.environ['MESON_INSTALL_PREFIX']
-icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
-schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
+import sys
if not os.environ.get('DESTDIR'):
+ datadir = sys.argv[1]
+
+ icondir = os.path.join(datadir, 'icons', 'hicolor')
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
- print('Compiling gsettings schemas...')
+ schemadir = os.path.join(datadir, 'glib-2.0', 'schemas')
+ print('Compile gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]