kumquat-buildroot/package/gobject-introspection/g-ir-scanner-qemuwrapper.in
Adam Duskett 22d65321ec package/gobject-introspection: Add QEMU_USERMODE_ARGS support
Now that the qemu package has the BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS string,
the gobject-introspection g-ir-scanner-qemuwrapper script can pass that string
to qemu.

Add the QEMU_USERMODE_ARGS to g-ir-scanner-qemuwrapper.in and unconditionally
sed @QEMU_USERMODE_ARGS@ with BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS.

Fixes:
http://autobuild.buildroot.org/results/2e9dbc0d36600c09fa9e59ab1b1903c9f40661e8

Signed-off-by: Adam Duskett <aduskett@gmail.com>
[Arnout: don't add QEMU_USERMODE_ARGS variable to shell script]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-09-11 21:31:36 +02:00

23 lines
950 B
Bash

#!/usr/bin/env sh
GOI_LIBRARY_PATH="${GIR_EXTRA_LIBS_PATH:+${GIR_EXTRA_LIBS_PATH}:}.libs:$(dirname "$0")/../lib:$(dirname "$0")/../../lib"
# Pass -r to qemu-user as to trick glibc into not erroring out if the host kernel
# is older than the target kernel.
# Use a modules directory which does not exist so we don't load random things
# which may then get deleted (or their dependencies) and potentially segfault
GIO_MODULE_DIR="$(dirname "$0")/../lib/gio/modules-dummy" \
@QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
@QEMU_USERMODE_ARGS@ \
-L "$(dirname "$0")/../../" \
-E LD_LIBRARY_PATH="${GOI_LIBRARY_PATH}" \
"$@"
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help."
# shellcheck disable=SC2016
echo 'Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"'
exit 1
fi