void-packages/srcpkgs/gobject-introspection/files/g-ir-scanner-qemuwrapper

26 lines
731 B
Bash
Executable File

#!/bin/sh
# Use a modules directory which doesn't exist so we don't load random things
# which may then get deleted (or their dependencies) and potentially segfault
export GIO_MODULE_DIR=${XBPS_CROSS_BASE}/gio/modules-dummy
case "$XBPS_TARGET_MACHINE" in
x86_64*) _MACHINE=x86_64 ;;
i686) _MACHINE=i386 ;;
aarch64*) _MACHINE=aarch64 ;;
armv*) _MACHINE=arm ;;
mipsel*) _MACHINE=mipsel ;;
mips*) _MACHINE=mips ;;
ppc64le*) _MACHINE=ppc64le ;;
ppc64*) _MACHINE=ppc64 ;;
ppc*) _MACHINE=ppc ;;
*)
echo "unknown qemu architecture: $XBPS_TARGET_MACHINE"
exit 1
;;
esac
/usr/bin/qemu-${_MACHINE}-static \
-L ${XBPS_CROSS_BASE} \
-E LD_LIBRARY_PATH="${XBPS_CROSS_BASE}/usr/lib:.libs:${GIR_EXTRA_LIBS_PATH}" \
"$@"