diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk index c18a1f17d3..35b6669469 100644 --- a/package/gobject-introspection/gobject-introspection.mk +++ b/package/gobject-introspection/gobject-introspection.mk @@ -33,11 +33,12 @@ HOST_GOBJECT_INTROSPECTION_DEPENDENCIES = \ GOBJECT_INTROSPECTION_NINJA_ENV += \ CC="$(TARGET_CC)" -# Disable introspection data on the host, as it is not needed and -# the package will attempt to use the systems libglib2 which will fail -# if the systems libglib2 version is older than 2.60. -HOST_GOBJECT_INTROSPECTION_CONF_OPTS = \ - -Dbuild_introspection_data=false +# When building, gobject-introspection uses tools/g-ir-scanner to build several +# .gir and .typelib files. g-ir-scanner does not use LDFLAGS, and by default, +# links to the system-installed libglib2 path. To remedy this issue, defining +# LD_LIBRARY_PATH forces g-ir-scanner to use our host installed libglib2 files. +HOST_GOBJECT_INTROSPECTION_NINJA_ENV += \ + LD_LIBRARY_PATH="$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(HOST_DIR)/lib" # Use the host gi-scanner to prevent the scanner from generating incorrect # elf classes.