[eog: 1/11] build: Do not use prefix on directory variables




commit 2e9e28a72279a84b84416fdedcc70a96b37efaf0
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Oct 27 08:58:16 2021 +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.

 meson.build       | 12 ++++++------
 src/meson.build   | 10 +++++-----
 tests/meson.build |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/meson.build b/meson.build
index 9d49aa45..a263569a 100644
--- a/meson.build
+++ b/meson.build
@@ -17,13 +17,13 @@ eog_gir_ns = 'Eog'
 eog_gir_version = '1.0'
 
 eog_prefix = get_option('prefix')
-eog_datadir = eog_prefix / get_option('datadir')
-eog_libdir = eog_prefix / get_option('libdir')
-eog_localedir = eog_prefix / get_option('localedir')
+eog_datadir = get_option('datadir')
+eog_libdir = get_option('libdir')
+eog_localedir = get_option('localedir')
 
 eog_pkgdatadir = eog_datadir / meson.project_name()
 eog_pkglibdir = eog_libdir / meson.project_name()
-eog_pkglibexecdir = eog_prefix / get_option('libexecdir') / meson.project_name()
+eog_pkglibexecdir = get_option('libexecdir') / meson.project_name()
 
 eog_pluginsdir = eog_pkglibdir / 'plugins'
 
@@ -126,7 +126,7 @@ common_deps = [
 
 gio_schemasdir = gio_dep.get_pkgconfig_variable(
   'schemasdir',
-  define_variable: ['datadir', eog_datadir],
+  define_variable: ['datadir', eog_prefix / eog_datadir],
   default: eog_datadir / 'glib-2.0/schemas',
 )
 
@@ -249,7 +249,7 @@ configure_file(
 
 meson.add_install_script(
   'meson_post_install.py',
-  eog_datadir,
+  eog_prefix / eog_datadir,
   gio_schemasdir,
 )
 
diff --git a/src/meson.build b/src/meson.build
index 08ea4275..d7ddcad2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -134,9 +134,9 @@ deps = common_deps + [
 
 cflags = [
   '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name().to_upper()),
-  '-DEOG_DATA_DIR="@0@"'.format(eog_pkgdatadir),
-  '-DEOG_PLUGIN_DIR="@0@"'.format(eog_pluginsdir),
-  '-DLIBDIR="@0@"'.format(eog_libdir),
+  '-DEOG_DATA_DIR="@0@"'.format(eog_prefix / eog_pkgdatadir),
+  '-DEOG_PLUGIN_DIR="@0@"'.format(eog_prefix / eog_pluginsdir),
+  '-DLIBDIR="@0@"'.format(eog_prefix / eog_libdir),
 ]
 
 symbol_map = meson.current_source_dir() / 'symbol.map'
@@ -191,7 +191,7 @@ deps = [libeog_dep]
 
 cflags = [
   '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name().to_upper()),
-  '-DEOG_LOCALE_DIR="@0@"'.format(eog_localedir),
+  '-DEOG_LOCALE_DIR="@0@"'.format(eog_prefix / eog_localedir),
 ]
 
 if enable_introspection
@@ -205,7 +205,7 @@ eog = executable(
   dependencies: deps,
   c_args: cflags,
   install: true,
-  install_rpath: eog_pkglibdir,
+  install_rpath: eog_prefix / eog_pkglibdir,
 )
 
 if enable_introspection
diff --git a/tests/meson.build b/tests/meson.build
index 497c56b0..f9ab2b6d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -31,7 +31,7 @@ test_names = [
 
 foreach test_name: test_names
   tests_conf = {
-    'TESTS_PATH': tests_execdir,
+    'TESTS_PATH': eog_prefix / tests_execdir,
     'TEST_NAME': test_name,
   }
 


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