[gnome-disk-utility] build: Do not use prefix on directory variables



commit 8c231d54cb552356d2c494d91854c61863714da7
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Jul 3 23:19:30 2019 +0200

    build: Do not use prefix on directory variables
    
    Although usually directory variables are set by using the `prefix`
    directory, this might cause issues due to parameters that need
    relative directories.
    
    In order to ease the transition `prefix` directory has been stripped
    from directory variables and only has been appended when necessary.

 data/meson.build                   |  2 +-
 meson.build                        | 12 ++++++------
 meson_post_install.py              |  6 +++---
 src/disk-image-mounter/meson.build |  4 ++--
 src/disks/meson.build              |  4 ++--
 src/libgdu/meson.build             |  4 ++--
 src/notify/meson.build             |  2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 011847f8..d91ecc17 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -19,7 +19,7 @@ foreach desktop: desktops
 endforeach
 
 service_conf = configuration_data()
-service_conf.set('bindir', gdu_bindir)
+service_conf.set('bindir', gdu_prefix / gdu_bindir)
 
 service = 'org.gnome.DiskUtility.service'
 
diff --git a/meson.build b/meson.build
index 8181dbb8..f12d2a48 100644
--- a/meson.build
+++ b/meson.build
@@ -10,12 +10,12 @@ gdu_name = 'gnome-disk-utility'
 gdu_version = meson.project_version()
 
 gdu_prefix = get_option('prefix')
-gdu_bindir = gdu_prefix / get_option('bindir')
-gdu_datadir = gdu_prefix / get_option('datadir')
-gdu_libexecdir = gdu_prefix / get_option('libexecdir')
-gdu_localedir = gdu_prefix / get_option('localedir')
-gdu_mandir = gdu_prefix / get_option('mandir')
-gdu_sysconfdir = gdu_prefix / get_option('sysconfdir')
+gdu_bindir = get_option('bindir')
+gdu_datadir = get_option('datadir')
+gdu_libexecdir = get_option('libexecdir')
+gdu_localedir = get_option('localedir')
+gdu_mandir = get_option('mandir')
+gdu_sysconfdir = get_option('sysconfdir')
 
 cc = meson.get_compiler('c')
 
diff --git a/meson_post_install.py b/meson_post_install.py
index 6ff4fd2f..c8c8ce8b 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -5,12 +5,12 @@ import subprocess
 import sys
 
 if not os.environ.get('DESTDIR'):
-  datadir = sys.argv[1]
+  prefix = os.environ['MESON_INSTALL_PREFIX']
 
-  icondir = os.path.join(datadir, 'icons', 'hicolor')
+  icondir = os.path.join(prefix, sys.argv[1], 'icons', 'hicolor')
   print('Update icon cache...')
   subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
 
-  schemadir = os.path.join(datadir, 'glib-2.0', 'schemas')
+  schemadir = os.path.join(prefix, sys.argv[1], 'glib-2.0', 'schemas')
   print('Compile gsettings schemas...')
   subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/src/disk-image-mounter/meson.build b/src/disk-image-mounter/meson.build
index de2ce907..3a764216 100644
--- a/src/disk-image-mounter/meson.build
+++ b/src/disk-image-mounter/meson.build
@@ -9,9 +9,9 @@ deps = [
 ]
 
 cflags = [
-  '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_datadir),
+  '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_prefix / gdu_datadir),
   '-DG_LOG_DOMAIN="@0@"'.format(name),
-  '-DGNOMELOCALEDIR="@0@"'.format(gdu_localedir),
+  '-DGNOMELOCALEDIR="@0@"'.format(gdu_prefix / gdu_localedir),
 ]
 
 executable(
diff --git a/src/disks/meson.build b/src/disks/meson.build
index db39358b..0e38ed6b 100644
--- a/src/disks/meson.build
+++ b/src/disks/meson.build
@@ -97,9 +97,9 @@ deps = [
 ]
 
 cflags = [
-  '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_datadir),
+  '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_prefix / gdu_datadir),
   '-DG_LOG_DOMAIN="@0@"'.format(name),
-  '-DGNOMELOCALEDIR="@0@"'.format(gdu_localedir),
+  '-DGNOMELOCALEDIR="@0@"'.format(gdu_prefix / gdu_localedir),
 ]
 
 executable(
diff --git a/src/libgdu/meson.build b/src/libgdu/meson.build
index 2121fa6c..839f927f 100644
--- a/src/libgdu/meson.build
+++ b/src/libgdu/meson.build
@@ -26,9 +26,9 @@ if enable_logind
 endif
 
 cflags = [
-  '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_datadir),
+  '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_prefix / gdu_datadir),
   '-DG_LOG_DOMAIN="libgdu"',
-  '-DGNOMELOCALEDIR="@0@"'.format(gdu_localedir),
+  '-DGNOMELOCALEDIR="@0@"'.format(gdu_prefix / gdu_localedir),
 ]
 
 libgdu = static_library(
diff --git a/src/notify/meson.build b/src/notify/meson.build
index 7c884f78..e7698d78 100644
--- a/src/notify/meson.build
+++ b/src/notify/meson.build
@@ -21,7 +21,7 @@ executable(
 )
 
 desktop_conf = configuration_data()
-desktop_conf.set('libexecdir', gdu_libexecdir)
+desktop_conf.set('libexecdir', gdu_prefix / gdu_libexecdir)
 
 desktop = 'org.gnome.SettingsDaemon.DiskUtilityNotify.desktop'
 


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