libs: glib2: fix provided pkg-config and always use host tools 23881/head
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 11 Apr 2024 15:07:36 +0000 (17:07 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 5 May 2024 15:25:12 +0000 (17:25 +0200)
For the InstallDev target, the pkg-config should point to the glib2 host
tools for glib_compile_resources, gdbus_codegen, glib_genmarshal and
glib_mkenums instead of pointing to the targets ones as they are
unusable by the host machine (due to crosscompiling)

Fix the pkg-config to reference the host tools by replaying the entry
and use the prefix_hostpkg variable provided by our pkg-config.

Link: https://github.com/openwrt/packages/pull/23881
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
libs/glib2/Makefile

index ef36e162c0ba5df74e545bbd774a588439f500c2..3c5e707c05d381f1cd4f1ed1f6adda469dad57de 100644 (file)
@@ -100,6 +100,12 @@ define Build/InstallDev
        $(INSTALL_DATA) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
                $(1)/usr/lib/pkgconfig
+       $(foreach BIN,glib_genmarshal glib_mkenums,
+               $(SED) 's/^$(BIN)=$$$${bindir}\/\(.*\)/$(BIN)=$$$${prefix_hostpkg}\/bin\/\1/' $(1)/usr/lib/pkgconfig/glib-2.0.pc
+       )
+       $(foreach BIN,glib_compile_resources gdbus_codegen,
+               $(SED) 's/^$(BIN)=$$$${bindir}\/\(.*\)/$(BIN)=$$$${prefix_hostpkg}\/bin\/\1/' $(1)/usr/lib/pkgconfig/gio-2.0.pc
+       )
 
        $(INSTALL_DIR) $(2)/share/aclocal/
        $(INSTALL_DATA) \