[dconf: 1/2] build: Make dconf client vapi installation optional



commit 8c13a452560b564af18ba9aae0ba97caffad8e2c
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Fri Feb 1 00:00:00 2019 +0000

    build: Make dconf client vapi installation optional
    
    The client vapi is no longer used internally, but it introduces
    dependency on vala, since vapigen pkg-config file is required to
    determine where to install vapi file.
    
    Make clinet vapi file installation optional, and thus the dependency on
    vala itself.
    
    Issue #38.

 bin/meson.build    |  2 +-
 client/meson.build | 25 +++++++++++++++++++------
 meson.build        |  3 +--
 meson_options.txt  |  1 +
 4 files changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/bin/meson.build b/bin/meson.build
index ceafa82..e2c620a 100644
--- a/bin/meson.build
+++ b/bin/meson.build
@@ -1,4 +1,4 @@
-sources = gvdb_builder + libdconf_vapi + files(
+sources = gvdb_builder + files(
   'dconf.c',
 )
 
diff --git a/client/meson.build b/client/meson.build
index 74fb090..f3b7122 100644
--- a/client/meson.build
+++ b/client/meson.build
@@ -56,11 +56,24 @@ pkg.generate(
   variables: 'exec_prefix=${prefix}',
 )
 
-libdconf_vapi = files('dconf.vapi')
+if get_option('vapi')
+  vapigen_dep = dependency('vapigen')
+
+  vapi_data = files(
+    'dconf.vapi',
+    'dconf.deps',
+  )
+
+  vapi_dir = vapigen_dep.get_pkgconfig_variable(
+    'vapidir',
+    define_variable: ['datadir', dconf_datadir]
+  )
+
+  install_data(
+    vapi_data,
+    install_dir: vapi_dir,
+  )
+endif
+
 
-vapi_data = libdconf_vapi + files('dconf.deps')
 
-install_data(
-  vapi_data,
-  install_dir: vapi_dir,
-)
diff --git a/meson.build b/meson.build
index 85bcc02..0204a18 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project(
   'dconf', ['c'],
   version: '0.31.2',
   license: 'LGPL2.1+',
-  meson_version: '>= 0.46.0',
+  meson_version: '>= 0.47.0',
 )
 
 dconf_prefix = get_option('prefix')
@@ -47,7 +47,6 @@ glib_dep = dependency('glib-2.0', version: '>= 2.44.0')
 
 gio_module_dir = gio_dep.get_pkgconfig_variable('giomoduledir', define_variable: ['libdir', dconf_libdir])
 dbus_session_service_dir = dependency('dbus-1').get_pkgconfig_variable('session_bus_services_dir', 
define_variable: ['datadir', dconf_datadir])
-vapi_dir = dependency('vapigen').get_pkgconfig_variable('vapidir', define_variable: ['datadir', 
dconf_datadir])
 
 enable_bash_completion = get_option('bash_completion')
 if enable_bash_completion
diff --git a/meson_options.txt b/meson_options.txt
index 9c8e3e6..a2794ce 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
 option('bash_completion', type: 'boolean', value: true, description: 'install bash completion files')
 option('man', type: 'boolean', value: true, description: 'generate man pages')
 option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
+option('vapi', type: 'boolean', value: true, description: 'install dconf client vapi')


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