[libgnomekbd] meson: Install introspection data



commit b417c90081cb8708b9bd4e330d96f286241f4a4b
Author: Matt Turner <mattst88 gmail com>
Date:   Wed Aug 17 18:40:56 2022 -0400

    meson: Install introspection data
    
    And rename the option 'gir' to 'introspection' to match other GNOME
    projects.

 libgnomekbd/meson.build | 40 ++++++++++++++++++++++++----------------
 meson.build             |  2 ++
 meson_options.txt       |  4 ++--
 3 files changed, 28 insertions(+), 18 deletions(-)
---
diff --git a/libgnomekbd/meson.build b/libgnomekbd/meson.build
index f98c67e..dcd7110 100644
--- a/libgnomekbd/meson.build
+++ b/libgnomekbd/meson.build
@@ -170,19 +170,27 @@ install_data(
   install_dir: get_option('prefix') / get_option('datadir') / 'GConf' / 'gsettings'
 )
 
-gnome.generate_gir(
-  libgnomekbd_lib, libgnomekbdui_lib,
-  sources: [
-    libgnomekbd_sources,
-    libgnomekbdui_sources,
-    libgnomekbd_headers,
-    libgnomekbdui_headers,
-    gkbd_indicator_marshal,
-    gkbd_keyboard_drawing_marshal,
-  ],
-  dependencies: [ libgnomekbd_deps, m_dep ],
-  include_directories: root_include,
-  namespace: 'Gkbd',
-  nsversion: '3.0',
-  includes: ['GObject-2.0', 'Gtk-3.0', 'xlib-2.0', 'Xkl-1.0'],
-)
+if get_option('introspection')
+  gir_dir = join_paths(get_option('prefix') / get_option('datadir'), '@0@-@1@'.format('gir', 
gnomekbd_gir_version))
+  typelib_dir = join_paths(get_option('prefix') / get_option('libdir'), '@0@-@1@'.format('girepository', 
gnomekbd_gir_version))
+
+  gnome.generate_gir(
+    libgnomekbd_lib, libgnomekbdui_lib,
+    sources: [
+      libgnomekbd_sources,
+      libgnomekbdui_sources,
+      libgnomekbd_headers,
+      libgnomekbdui_headers,
+      gkbd_indicator_marshal,
+      gkbd_keyboard_drawing_marshal,
+    ],
+    dependencies: [ libgnomekbd_deps, m_dep ],
+    include_directories: root_include,
+    namespace: 'Gkbd',
+    nsversion: '3.0',
+    includes: ['GObject-2.0', 'Gtk-3.0', 'xlib-2.0', 'Xkl-1.0'],
+    install: true,
+    install_dir_gir: gir_dir,
+    install_dir_typelib: typelib_dir,
+  )
+endif
diff --git a/meson.build b/meson.build
index 4b4a2f9..c6c2a6e 100644
--- a/meson.build
+++ b/meson.build
@@ -13,6 +13,8 @@ project('libgnomekbd', 'c',
 library_version = '8.0.0'
 gettext_domain = 'libgnomekbd'
 
+gnomekbd_gir_version = '1.0'
+
 gnome = import('gnome')
 i18n = import('i18n')
 
diff --git a/meson_options.txt b/meson_options.txt
index 63596da..fef3b89 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,4 @@
-option('gir',
+option('introspection',
        type: 'boolean', value: true,
        description: 'Generate gir data (requires gobject-introspection)')
 option('vapi',
@@ -6,4 +6,4 @@ option('vapi',
        description: 'Generate vapi data (requires vapigen)')
 option('tests',
        type : 'boolean', value : true,
-       description: 'Enable tests')
\ No newline at end of file
+       description: 'Enable tests')


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