[gobject-introspection/wip/meson/pkg-generate] WIP



commit c6ee2dc8c849a4bdb3f1a3cf64c96fc8bf9ec351
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Thu Jun 13 23:09:47 2019 +0200

    WIP
    
    meson produces broken .pc files the second time here :(

 girepository/meson.build                  | 37 +++++++++++++++++++++++++
 gobject-introspection-1.0.pc.in           | 24 -----------------
 gobject-introspection-no-export-1.0.pc.in | 23 ----------------
 meson.build                               | 45 +------------------------------
 4 files changed, 38 insertions(+), 91 deletions(-)
---
diff --git a/girepository/meson.build b/girepository/meson.build
index 1d7aed6b..ddda408a 100644
--- a/girepository/meson.build
+++ b/girepository/meson.build
@@ -174,6 +174,43 @@ girepo_lib = shared_library('girepository-1.0',
   install: true,
 )
 
+pkg = import('pkgconfig')
+
+if host_system == 'windows' or host_system == 'cygwin'
+  exeext = '.exe'
+else
+  exeext = ''
+endif
+
+foreach noexport : [false, true]
+  if noexport
+    pc_base = 'gobject-introspection-no-export-1.0'
+    extravars = []
+  else
+    pc_base = 'gobject-introspection-1.0'
+    extravars = ['gidatadir=${datadir}/gobject-introspection-1.0']
+  endif
+
+  pkg.generate(
+    name: 'gobject-introspection',
+    description: 'GObject Introspection',
+    filebase: pc_base,
+    subdirs: ['gobject-introspection-1.0'],
+    libraries: [girepo_lib],
+    requires: [glib_dep, gobject_dep],
+    requires_private: [gmodule_dep, libffi_dep],
+    variables: [
+      'bindir=${prefix}/' + get_option('bindir'),
+      'datadir=${prefix}/' + get_option('datadir'),
+      'g_ir_scanner=${bindir}/g-ir-scanner',
+      'g_ir_compiler=${bindir}/g-ir-compiler' + exeext,
+      'g_ir_generate=${bindir}/g-ir-generate' + exeext,
+      'girdir=' + gir_dir_pc_prefix + '/gir-1.0',
+      'typelibdir=${libdir}/girepository-1.0',
+    ] + extravars,
+  )
+endforeach
+
 # Copy to builddir for use with giscanner/dumper.py when running uninstalled
 configure_file(input : 'gdump.c',
   output : 'gdump.c',
diff --git a/meson.build b/meson.build
index 941d63ec..cf89929d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
 project('gobject-introspection', 'c',
   version: '1.61.1',
-  meson_version: '>= 0.47.0',
+  meson_version: '>= 0.49.0',
   default_options: [
     'warning_level=1',
     'buildtype=debugoptimized',
@@ -174,46 +174,3 @@ subdir('tests')
 
 install_data('Makefile.introspection', install_dir: join_paths(get_option('datadir'), 
'gobject-introspection-1.0'))
 install_data('m4/introspection.m4', install_dir: join_paths(get_option('datadir'), 'aclocal'))
-
-prefix = get_option('prefix')
-pkgconfig_conf = configuration_data()
-pkgconfig_conf.set('prefix', prefix)
-pkgconfig_conf.set('exec_prefix', '${prefix}')
-pkgconfig_conf.set('bindir', join_paths('${exec_prefix}', get_option('bindir')))
-pkgconfig_conf.set('libdir', join_paths('${exec_prefix}', get_option('libdir')))
-pkgconfig_conf.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
-pkgconfig_conf.set('datadir', '${datarootdir}')
-pkgconfig_conf.set('includedir', join_paths('${prefix}', get_option('includedir')))
-pkgconfig_conf.set('GIR_PC_DIR', join_paths(gir_dir_pc_prefix, 'gir-1.0'))
-if host_system == 'windows' or host_system == 'cygwin'
-  pkgconfig_conf.set('EXEEXT', '.exe')
-else
-  pkgconfig_conf.set('EXEEXT', '')
-endif
-pkgconfig_conf.set('VERSION', meson.project_version())
-pkgconfig_conf.set('FFI_PC_PACKAGES', 'libffi')
-if libffi_dep.type_name() == 'pkgconfig'
-  pkgconfig_conf.set('FFI_PC_CFLAGS', libffi_dep.get_pkgconfig_variable('Cflags'))
-  pkgconfig_conf.set('FFI_PC_LIBS', libffi_dep.get_pkgconfig_variable('Libs'))
-else
-  # XXX: We can't know the correct values for these, needs meson API. Maybe we
-  # should use meson's pkgconfig module to generate the whole file.
-  pkgconfig_conf.set('FFI_PC_CFLAGS', '')
-  pkgconfig_conf.set('FFI_PC_LIBS', '-lffi')
-endif
-
-configure_file(
-  input: 'gobject-introspection-no-export-1.0.pc.in',
-  output: 'gobject-introspection-no-export-1.0.pc',
-  configuration: pkgconfig_conf,
-  install: true,
-  install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
-)
-
-configure_file(
-  input: 'gobject-introspection-1.0.pc.in',
-  output: 'gobject-introspection-1.0.pc',
-  configuration: pkgconfig_conf,
-  install: true,
-  install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
-)


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