[meld: 5/10] build: Use the schemasdir variable from gio pkg-config file




commit 1c2440b50cd1e64cfe1cd5945a5c414c6cddc0fd
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sun Feb 14 21:01:15 2021 +0100

    build: Use the schemasdir variable from gio pkg-config file
    
    The `gio-2.0` pkg-config file defines the location of schema files.
    The hardcoded value has been changed to use the value of this
    variable.

 data/meson.build | 2 +-
 meson.build      | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
index 21e8a334..2d8fbb99 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -8,7 +8,7 @@ install_data(
 # Install schema file
 install_data(
   '@0  gschema xml'.format(resource_base_id),
-  install_dir: datadir / 'glib-2.0/schemas',
+  install_dir: gio_schemasdir,
 )
 
 # Install desktop file
diff --git a/meson.build b/meson.build
index e812f3c0..f6c697a0 100644
--- a/meson.build
+++ b/meson.build
@@ -43,6 +43,12 @@ pkgdatadir = datadir / meson.project_name()
 itsdir = meson.current_source_dir() / 'gettext'
 podir = meson.current_source_dir() / 'po'
 
+gio_schemasdir = dependency('gio-2.0').get_pkgconfig_variable(
+  'schemasdir',
+  define_variable: ['datadir', datadir],
+  default: datadir / 'glib-2.0/schemas',
+)
+
 subdir('meld')
 subdir('data')
 subdir('help')


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