[glib: 1/2] gio: Provide schemas directory information in pkg-config file



commit 64e9e1f4826737284754e0be20888b618d5c885e
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Aug 27 13:48:47 2018 +0200

    gio: Provide schemas directory information in pkg-config file
    
    GSettings XML schema files are installed in a well known directory
    under Glib's installation directory: `glib-2.0/schemas`. However,
    the Glib installation directory might vary, so the exact location of
    the schema files might be unknown.
    
    The information regarding this directory has been added to GIO's
    pkg-config file, so it can be checked, and also overrided, by using
    the command line utility.

 gio-2.0.pc.in   | 2 ++
 gio/meson.build | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
index 7574eb700..999e1c080 100644
--- a/gio-2.0.pc.in
+++ b/gio-2.0.pc.in
@@ -3,6 +3,8 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 
+datadir=@datadir@
+schemasdir=${datadir}/glib-2.0/schemas
 giomoduledir=@GIO_MODULE_DIR@
 glib_compile_schemas=glib-compile-schemas
 glib_compile_resources=glib-compile-resources
diff --git a/gio/meson.build b/gio/meson.build
index 4b2c8f2ca..b83d8f5f3 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -804,10 +804,14 @@ if giomodulesdir == ''
   giomodulesdir = join_paths('${libdir}', 'gio', 'modules')
 endif
 
+schemas_subdir = join_paths('glib-2.0', 'schemas')
+
 pkg.generate(libraries : libgio,
   libraries_private : [osx_ldflags],
   requires : ['glib-2.0', 'gobject-2.0'],
-  variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
+  variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
+               'schemasdir=' + join_paths('${datadir}', schemas_subdir),
+               'bindir=' + join_paths('${prefix}', get_option('bindir')),
                'giomoduledir=' + giomodulesdir,
                'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'),
                'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
@@ -945,7 +949,7 @@ executable('gsettings', 'gsettings-tool.c',
   link_args : noseh_link_args,
   dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
 install_data('gschema.dtd',
-  install_dir : join_paths(get_option('datadir'), 'glib-2.0/schemas'))
+  install_dir : join_paths(get_option('datadir'), schemas_subdir))
 
 install_data(['gschema.loc', 'gschema.its'],
   install_dir : join_paths(get_option('datadir'), 'gettext/its'))


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