diff --git a/srcpkgs/qemu-user-static/template b/srcpkgs/qemu-user-static/template index 49355e56547..b2e7b04e4f8 100644 --- a/srcpkgs/qemu-user-static/template +++ b/srcpkgs/qemu-user-static/template @@ -2,7 +2,7 @@ # This package should be updated together with qemu pkgname=qemu-user-static version=9.0.2 -revision=1 +revision=2 build_style=configure configure_args="--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec --disable-kvm --disable-png --disable-virtfs --disable-fdt --disable-seccomp @@ -28,6 +28,16 @@ case "$XBPS_TARGET_MACHINE" in ppc64*) _omit+=(ppc) ;; esac +case "$XBPS_TARGET_MACHINE" in + x86_64*|i686*) _host_arch="i386" ;; + mips*) _host_arch="mips" ;; + ppc*le) _host_arch="ppcle" ;; + ppc*) _host_arch="ppc" ;; + arm*|aarch64*) _host_arch="arm" ;; + riscv*) _host_arch="riscv" ;; + *) _host_arch="${XBPS_TARGET_MACHINE%-musl}" ;; +esac + post_install() { # Remove unneeded stuff. rm -rf ${DESTDIR}/etc ${DESTDIR}/usr/share ${DESTDIR}/usr/libexec @@ -39,7 +49,7 @@ post_install() { done vmkdir usr/share/binfmts - scripts/qemu-binfmt-conf.sh --debian ALL --exportdir "${DESTDIR}"/usr/share/binfmts \ + HOST_ARCH="$_host_arch" scripts/qemu-binfmt-conf.sh --debian --exportdir "${DESTDIR}"/usr/share/binfmts \ --qemu-path /usr/bin --preserve-argv0 yes --persistent yes --credential yes for bf in "${DESTDIR}"/usr/share/binfmts/*; do for ar in "${_omit[@]}"; do