[gtk: 1/2] testsuite: introspection: Do not override environment variables.




commit 29e6cc58088ef37bfde364965cdebd2f7402f315
Author: Maxim Cournoyer <maxim cournoyer gmail com>
Date:   Sun Dec 19 23:19:50 2021 -0500

    testsuite: introspection: Do not override environment variables.
    
    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 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build
index 647150055c..048e47e6eb 100644
--- a/testsuite/introspection/meson.build
+++ b/testsuite/introspection/meson.build
@@ -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)


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