[gnome-builder/wip/gtk4-port: 1417/1774] plugins/meson-templates: cleanup shared library template




commit 2058a604bd9a591456162333077e3c0e5a974571
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 8 12:49:08 2022 -0700

    plugins/meson-templates: cleanup shared library template
    
     - Add support for GObject Introspection generation.
     - Cleanup alignment/spacing
     - Require gio-2.0 in pkgconfig pc file
     - Require Gio-2.0 for GObject Introspection
     - Remove some unnecessary variables

 .../meson-templates/resources/src/meson-clib.build | 35 ++++++++++++----------
 1 file changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/meson-templates/resources/src/meson-clib.build 
b/src/plugins/meson-templates/resources/src/meson-clib.build
index af5b27723..47821e2a8 100644
--- a/src/plugins/meson-templates/resources/src/meson-clib.build
+++ b/src/plugins/meson-templates/resources/src/meson-clib.build
@@ -9,38 +9,33 @@ api_version = '0.1'
 ]
 
 version_split = meson.project_version().split('.')
-MAJOR_VERSION = version_split[0]
-MINOR_VERSION = version_split[1]
-MICRO_VERSION = version_split[2]
-
 version_conf = configuration_data()
 version_conf.set('VERSION', meson.project_version())
-version_conf.set('MAJOR_VERSION', MAJOR_VERSION)
-version_conf.set('MINOR_VERSION', MINOR_VERSION)
-version_conf.set('MICRO_VERSION', MICRO_VERSION)
+version_conf.set('MAJOR_VERSION', version_split[0])
+version_conf.set('MINOR_VERSION', version_split[1])
+version_conf.set('MICRO_VERSION', version_split[2])
 
 configure_file(
-  input: '{{name}}-version.h.in',
-  output: '{{name}}-version.h',
+          input: '{{name}}-version.h.in',
+         output: '{{name}}-version.h',
   configuration: version_conf,
-  install: true,
-  install_dir: join_paths(get_option('includedir'), '{{name}}')
+        install: true,
+    install_dir: join_paths(get_option('includedir'), '{{name}}')
 )
 
 {{name_}}_deps = [
-  dependency('gio-2.0', version: '>= 2.50'),
+  dependency('gio-2.0'),
 ]
 
 {{name_}}_lib = shared_library('{{name}}-' + api_version,
   {{name_}}_sources,
   dependencies: {{name_}}_deps,
-  install: true,
+       install: true,
 )
 
 install_headers({{name_}}_headers, subdir: '{{name}}')
 
 pkg = import('pkgconfig')
-
 pkg.generate(
   description: 'A shared library for ...',
     libraries: {{name_}}_lib,
@@ -48,6 +43,16 @@ pkg.generate(
      filebase: '{{name}}-' + api_version,
       version: meson.project_version(),
       subdirs: '{{name}}',
-     requires: 'glib-2.0',
+     requires: 'gio-2.0',
   install_dir: join_paths(get_option('libdir'), 'pkgconfig')
 )
+
+gnome = import('gnome')
+{{name_}}_gir = gnome.generate_gir({{name_}}_lib,
+            nsversion: api_version,
+            namespace: '{{Prefix}}',
+        symbol_prefix: '{{prefix}}',
+    identifier_prefix: '{{Prefix}}',
+             includes: [ 'Gio-2.0' ],
+              install: true,
+)


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