testsuite: introspection: Do not override environment variables.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Mon, 20 Dec 2021 04:19:50 +0000 (23:19 -0500)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Mon, 20 Dec 2021 16:22:41 +0000 (11:22 -0500)
Functional package managers such as GNU Guix rely on environment
variables such as GI_TYPELIB_PATH to discover the system libraries and
resources; extend rather than override them.

* testsuite/introspection/meson.build (env): New variable that extends
rather than override the GI_TYPELIB_PATH and LD_PRELOAD environment
variables.
(api): Use the above as the value of the 'env' keyword argument.

testsuite/introspection/meson.build

index 647150055c8e0dfb76515a0c9023d93b32a6d3d2..048e47e6eb20494b5ac02b82ec1c611e595c019d 100644 (file)
@@ -1,10 +1,12 @@
 py = import('python').find_installation('python3', modules: ['gi'])
 
+env = environment()
+env.prepend('GI_TYPELIB_PATH',
+    join_paths(project_build_root, 'gtk'),
+    gi_dep.get_pkgconfig_variable('typelibdir'))
+env.prepend('LD_PRELOAD', join_paths(project_build_root, 'gtk', 'libgtk-4.so'))
+
 test('api',
      find_program('api.py', dirs: meson.current_source_dir()),
      suite: ['introspection'],
-     env: [
-       '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),
-     ])
+     env: env)