build: prepend to LD_LIBRARY_PATH and GI_TYPELIB_PATH

In Nixpkgs packages are installed in separate prefixes.
Starting from GLib / gobject-introspection 2.80, GLib introspection data
is provided by GLib itself instead of gobject-introspection. This causes
tests failures in Nixpkgs because the GI_TYPELIB_PATH set by the build
environment was overridden, leaving it unable to find GLib:

	    ImportError: cannot import name GLib, introspection typelib not found

Only GI_TYPELIB_PATH needs to be preserved in our case, but I've made
the same change for LD_LIBRARY_PATH, other environments might rely on
that in a similar way.
This commit is contained in:
Alyssa Ross
2024-05-08 09:53:14 +02:00
parent 218d6d2c58
commit daa8292878
+4 -1
View File
@@ -1,5 +1,8 @@
#!/bin/sh
export LD_LIBRARY_PATH=@abs_top_builddir@/libmm-glib"${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
export GI_TYPELIB_PATH=@abs_top_builddir@/libmm-glib"${GI_TYPELIB_PATH+:$GI_TYPELIB_PATH}"
# For debugging behavior of test-modemmanager-service.py, you can modify
# this line to add --log-file option
LD_LIBRARY_PATH=@abs_top_builddir@/libmm-glib GI_TYPELIB_PATH=@abs_top_builddir@/libmm-glib @abs_top_srcdir@/tools/test-modemmanager-service.py
exec @abs_top_srcdir@/tools/test-modemmanager-service.py