summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Bridon <bochecha@daitauha.fr>2019-01-11 17:54:18 +0100
committerMathieu Bridon <bochecha@daitauha.fr>2019-01-11 17:57:33 +0100
commit0dbf209f72bd8c700668971cd6f31760c72d9181 (patch)
tree11bcd0b16906036192113cf21c79346d25924d0a
parentf606183a010fbec4382acb728882cc0eddbaf7f7 (diff)
downloadgobject-introspection-bochecha/pkgconfig-prefix.tar.gz
m4: Take prefix the into account for the gir and typelib dirsbochecha/pkgconfig-prefix
When building a Flatpak application, all the modules bundled with the app are built/installed with prefix=/app. Those modules which use gobject-introspection's introspection.m4 will use pkgconfig to query the installation directory for their own gir and typelib files. As it is, that will always return something under /usr, which causes build failures in flatpak-builder. With the original pkg-config implementation, app authors would work around this in their manifests by defining a couple of environment variables: PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR=/app/share/gir-1.0 PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR=/app/lib/girepository-1.0 With the pkgconf implementation though, as used in the Freedesktop Sdk 18.08 and the GNOME Sdk >= 3.30, this does not work any more. One workaround is now to pass those directories to `make install` explicitly: make install girdir=/app/share/gir-1.0 typelibdir=/app/lib/girepository-1.0 Both methods are workarounds though, which amount to completely short-circuiting the introspection.m4 code, and require knowing the exact directory to install those files. As such they are fragile, and could break if the install directories ever change. This commit changes the m4 code, so that it takes the prefix into account, removing the need for those workarounds entirely. More details: * pkgconf doesn't support use env vars like pkg-config does: https://git.dereferenced.org/pkgconf/pkgconf/issues/2 * an example of the old and new workarounds: https://gitlab.gnome.org/GNOME/gnome-contacts/merge_requests/26/diffs
-rw-r--r--m4/introspection.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/introspection.m4 b/m4/introspection.m4
index d89c3d90..6afe0304 100644
--- a/m4/introspection.m4
+++ b/m4/introspection.m4
@@ -59,8 +59,8 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --define-variable=prefix=${prefix} --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --define-variable=prefix=${prefix} --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection