[glib-networking: 103/129] meson: Improve GIO modules directory handling



commit 69fa8880fdf5367879b4e64a1bbb9a92040a8dde
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Feb 8 17:51:14 2018 +0100

    meson: Improve GIO modules directory handling
    
    GIO modules are usually installed in a system directory that is
    checked from the `gio-2.0.pc` file. However this might cause issues
    to users without permissions to write in those system directories.
    
    A new option has been added to allow anyone to choose a writable
    directory. If this option is let empty it will fallback to the
    previous behaviour by checking the information from the `gio-2.0.pc`
    file.
    
    The meson variable has also been renamed to prevent any confusion.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793311

 meson.build             | 9 +++++++--
 meson_options.txt       | 1 +
 tls/openssl/meson.build | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4db3e20..0a0737b 100644
--- a/meson.build
+++ b/meson.build
@@ -9,7 +9,12 @@ glib_req = '2.46.0'
 glib = dependency('glib-2.0', version: '>=' + glib_req)
 gobject = dependency('gobject-2.0', version: '>=' + glib_req)
 gio = dependency('gio-2.0', version: '>=' + glib_req)
-giomoduledir = gio.get_pkgconfig_variable('giomoduledir')
+
+gio_module_dir = get_option('gio_module_dir')
+if gio_module_dir == ''
+  gio_module_dir = gio.get_pkgconfig_variable('giomoduledir')
+endif
+
 gio_querymodules = find_program('gio-querymodules')
 
 # MSVC builds of OpenSSL does not generate pkg-config files,
@@ -140,4 +145,4 @@ subdir('tls/openssl')
 subdir('tls/tests')
 subdir('po')
 
-meson.add_install_script(join_paths('build-aux', 'post_install.py'), giomoduledir)
+meson.add_install_script(join_paths('build-aux', 'post_install.py'), gio_module_dir)
diff --git a/meson_options.txt b/meson_options.txt
index 265f608..144e7fc 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1 +1,2 @@
 option('ca_certificates', type: 'string', value: '', description: 'Path to system Certificate Authority 
list')
+option('gio_module_dir', type: 'string', value: '', description: 'custom directory for gio modules')
diff --git a/tls/openssl/meson.build b/tls/openssl/meson.build
index 866577e..890afd0 100644
--- a/tls/openssl/meson.build
+++ b/tls/openssl/meson.build
@@ -27,7 +27,7 @@ gioopenssl = shared_module('gioopenssl',
                            dependencies: [tlsopenssl_dep],
                            include_directories: config_h_include,
                            install: true,
-                           install_dir: giomoduledir,
+                           install_dir: gio_module_dir,
                            c_args: [extra_args + common_flags])
 
 # Internal dependency, for tests and benchmarks


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