void-packages/srcpkgs/qemu/template

90 lines
3.6 KiB
Bash

# Template file for 'qemu'
# This package should be updated together with qemu-user-static
pkgname=qemu
version=7.1.0
revision=3
build_style=configure
configure_args="--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec --localstatedir=/var
--disable-glusterfs --disable-xen --enable-docs --enable-kvm --enable-libusb --enable-pie
--enable-snappy --enable-tpm --enable-usb-redir --enable-vhost-net --enable-virtfs --enable-png
--audio-drv-list=alsa$(vopt_if sdl2 ,sdl)$(vopt_if jack ,jack)$(vopt_if pulseaudio ,pa)
$(vopt_enable opengl) $(vopt_enable pulseaudio pa) $(vopt_enable sdl2 sdl) $(vopt_enable smartcard)
$(vopt_enable spice) $(vopt_enable virgl virglrenderer) $(vopt_if gtk3 '--enable-gtk')"
hostmakedepends="gettext pkg-config perl python3 python3-Sphinx python3-sphinx_rtd_theme ninja"
makedepends="capstone-devel dtc-devel libpng-devel libjpeg-turbo-devel pixman-devel
snappy-devel libuuid-devel libX11-devel alsa-lib-devel libaio-devel gnutls-devel
libsasl-devel libglib-devel ncurses-devel libseccomp-devel nss-devel
libcurl-devel xfsprogs-devel libcap-ng-devel vde2-devel usbredir-devel
libbluetooth-devel libssh2-devel libusb-devel libnfs-devel libslirp-devel
libxkbcommon-devel libzstd-devel $(vopt_if sdl2 'SDL2-devel SDL2_image-devel')
$(vopt_if gtk3 'gtk+3-devel vte3-devel')
$(vopt_if spice 'spice-devel pcsclite-devel') $(vopt_if virgl virglrenderer-devel)
$(vopt_if opengl 'libepoxy-devel libdrm-devel MesaLib-devel')
$(vopt_if iscsi 'libiscsi-devel')
$(vopt_if smartcard libcacard-devel) $(vopt_if numa 'libnuma-devel')
$(vopt_if jack 'jack-devel') $(vopt_if pulseaudio 'pulseaudio-devel')"
short_desc="Open Source Processor Emulator"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://www.qemu.org"
distfiles="https://wiki.qemu.org/download/qemu-${version}.tar.bz2"
checksum=f7ac2b85b3f1831e6810b140306e30af91556e15784864b209f3942858947fd0
ignore_elf_dirs="/usr/share/qemu"
nostrip_files="hppa-firmware.img openbios-ppc openbios-sparc32 openbios-sparc64
palcode-clipper s390-ccw.img s390-netboot.img u-boot.e500 opensbi-riscv32-generic-fw_dynamic.elf
opensbi-riscv64-generic-fw_dynamic.elf"
make_check=no # capstone5.0: fails 90/95 qemu:unit / test-vmstate (when updating the qemu package this should go away)
build_options="gtk3 opengl sdl2 spice virgl smartcard numa iscsi jack pulseaudio"
build_options_default="opengl gtk3 virgl sdl2 numa iscsi jack pulseaudio"
desc_option_sdl2="Enable SDL (2.x) video output"
desc_option_spice="Enable support for SPICE"
desc_option_virgl="Enable support for VirGL (A Virtual 3D GPU renderer)"
desc_option_smartcard="Enable smartcard support"
desc_option_numa="Enable support for host NUMA"
desc_option_iscsi="Enable support for iSCSI"
case "$XBPS_TARGET_MACHINE" in
aarch64-musl) CFLAGS="-D_LINUX_SYSINFO_H";;
esac
if [ "$XBPS_TARGET_ENDIAN" = "le" ]; then
build_options_default+=" spice"
fi
if [ "$CROSS_BUILD" ]; then
configure_args+=" --cross-prefix=${XBPS_CROSS_TRIPLET}-"
else
build_options_default+=" smartcard"
fi
post_extract() {
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
grep -rl 'Input/output error' tests/qemu-iotests |
xargs -n1 sed -i -e 's;Input/output error;I/O error;g'
grep -rl 'Operation not supported' tests/qemu-iotests |
xargs -n1 sed -i -e 's;Operation not supported;Not supported;g'
fi
}
pre_configure() {
unset CPP
}
post_install() {
vdoc "${FILESDIR}/README.voidlinux"
# qemu-bridge-helper must be setuid for non privileged users.
chmod u+s ${DESTDIR}/usr/libexec/qemu-bridge-helper
vsv qemu-ga
}
qemu-ga_package() {
short_desc="QEMU Guest Agent"
pkg_install() {
vmove usr/bin/qemu-ga
vmove etc/sv/qemu-ga
}
}