[gtk: 1/2] build: Get typelib dir dynamically using gobject-introspection dependency




commit d5f2b69d0c8f7b698fa201e6a5e68b12ee3a343d
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu Jul 8 04:33:16 2021 +0200

    build: Get typelib dir dynamically using gobject-introspection dependency
    
    We hardcoded the typelib directory for only an arch (and a distro),
    while we can just get it from gobject-introspection pkg config if tests
    are enabled.

 meson.build                         | 3 +++
 testsuite/introspection/meson.build | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 2071ec73f3..e6382b7db0 100644
--- a/meson.build
+++ b/meson.build
@@ -406,6 +406,9 @@ iso_codes_dep  = dependency('iso-codes', required: false)
 gidocgen_dep    = dependency('gi-docgen', version: '>= 2021.1',
                              fallback: ['gi-docgen', 'dummy_dep'],
                              required: get_option('gtk_doc'))
+gi_dep         = dependency('gobject-introspection-1.0', version: introspection_req,
+                            required: get_option('introspection').enabled() and
+                                      get_option('build-tests'))
 
 fontconfig_dep = [] # only used in x11 backend
 
diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build
index 58eea5aca2..6202fb7446 100644
--- a/testsuite/introspection/meson.build
+++ b/testsuite/introspection/meson.build
@@ -3,6 +3,7 @@ test('api',
      find_program('api.py', dirs: meson.current_source_dir()),
      suite: ['introspection'],
      env: [
-       'GI_TYPELIB_PATH=@0@/gtk:/usr/lib64/girepository-1.0'.format(project_build_root),
+       'GI_TYPELIB_PATH=@0@/gtk:@1@'.format(project_build_root,
+          gi_dep.get_pkgconfig_variable('typelibdir')),
        'LD_PRELOAD=@0@/gtk/libgtk-4.so'.format(project_build_root),
      ])


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