# aarch64-only build: Arch Linux ARM builds qemu without the static user-mode # binaries, so the Omarchy default set (qemu-user-static-binfmt, used for # foreign-architecture containers) repackages Debian's statically linked # qemu-user build. On x86_64 both packages come from the Arch extra repository. pkgbase=qemu-user-static pkgname=('qemu-user-static' 'qemu-user-static-binfmt') pkgver=10.0.11 _debver="1:10.0.11+ds-0+deb13u1+b1" pkgrel=1 pkgdesc="A generic and open source machine emulator and virtualizer - static user-mode emulation" arch=('aarch64') url="https://www.qemu.org" license=('GPL-2.0-only' 'LGPL-2.1-only') source=("qemu-binfmt-conf.sh") # Debian removes superseded pool files. Pin the official archive snapshot so # the same checksum-verified binary remains rebuildable. source_aarch64=("qemu-user_${pkgver}_arm64.deb::https://snapshot.debian.org/archive/debian/20260713T202617Z/pool/main/q/qemu/qemu-user_${_debver#*:}_arm64.deb") sha256sums=('5e12ef484b8364e1ba7bae4acda837d2e6320ffbeb7fab341034124553cdb137') sha256sums_aarch64=('6c9483063bf60f37fe181ead911251deabe40c893ea5829bc34b0b7b88913b6a') noextract=("qemu-user_${pkgver}_arm64.deb") prepare() { mkdir -p deb bsdtar -C deb -xf "qemu-user_${pkgver}_arm64.deb" data.tar.xz bsdtar -C deb -xf deb/data.tar.xz ./usr/bin ./usr/share/doc/qemu-user/copyright } package_qemu-user-static() { pkgdesc="A generic and open source machine emulator and virtualizer - static user-mode emulation" depends=('glibc') optdepends=('qemu-user-static-binfmt: binary format rules for foreign-architecture binaries') provides=('qemu-user-static') conflicts=('qemu-user-static-bin') install -dm755 "$pkgdir/usr/bin" local binary for binary in deb/usr/bin/qemu-*; do install -Dm755 "$binary" "$pkgdir/usr/bin/$(basename "$binary")-static" done install -Dm644 deb/usr/share/doc/qemu-user/copyright "$pkgdir/usr/share/licenses/$pkgname/copyright" } package_qemu-user-static-binfmt() { pkgdesc="Binary format rules for the static QEMU user-mode emulators" depends=('qemu-user-static') provides=('qemu-user-binfmt-provider') conflicts=('qemu-user-binfmt-provider' 'binfmt-qemu-static') install -dm755 "$pkgdir/usr/lib/binfmt.d" # HOST_ARCH keeps the native architecture out of the rule set regardless # of the build host, so the package is identical under native and QEMU builds. HOST_ARCH=aarch64 sh "$srcdir/qemu-binfmt-conf.sh" \ --systemd ALL \ --exportdir "$pkgdir/usr/lib/binfmt.d/" \ --qemu-path /usr/bin \ --qemu-suffix -static \ --persistent yes \ --preserve-argv0 yes local conf for conf in "$pkgdir"/usr/lib/binfmt.d/*.conf; do mv "$conf" "${conf%.conf}-static.conf" done }