# Maintainer: Tobias Powalowski # Contributor: Sébastien "Seblu" Luttringer # ALARM: Kevin Mihelich # - remove numactl and seabios _headlessdeps, revert not installing qemu seabios files # - define ARM _corearchs buildarch=12 pkgbase=qemu pkgname=(qemu qemu-headless qemu-arch-extra qemu-headless-arch-extra qemu-block-{iscsi,rbd,gluster} qemu-guest-agent) pkgdesc="A generic and open source machine emulator and virtualizer" pkgver=3.0.0 pkgrel=4 arch=(x86_64) license=(GPL2 LGPL2.1) url="http://wiki.qemu.org/" _headlessdeps=(gnutls libpng libaio jemalloc xfsprogs libnfs lzo snappy curl vde2 libcap-ng spice libcacard usbredir) depends=(virglrenderer sdl2 vte3 libpulse "${_headlessdeps[@]}") makedepends=(spice-protocol python2 ceph libiscsi glusterfs) source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig} qemu-ga.service 65-kvm.rules allow_elf64.patch fix_virtio.patch::https://github.com/qemu/qemu/commit/db812c4073c77c8a64db8d6663b3416a587c7b4a.patch) sha512sums=('a764302f50b9aca4134bbbc1f361b98e71240cdc7b25600dfe733bf4cf17bd86000bd28357697b08f3b656899dceb9e459350b8d55557817444ed5d7fa380a5a' 'SKIP' '269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4' 'bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99' 'b450625ff1e705f8c7eed9e2c0c4fe2179ca061df88a1a777c861c11d543c151cd0160f7f7227babdfe8b36000de084cbcb6fd7bf0f93d2f936c2e65082c82bf' '5a27d4ddee9b75b32015e2b2e8612a49406809a50e9d1c30de60593581363a4eeb24343d2e939c950d06852d21d95560c9cb518d043b981f2e681ab6a5927290') validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584') case $CARCH in i?86) _corearch=i386 ;; x86_64) _corearch=x86_64 ;; aarch64) _corearch=aarch64 ;; arm*) _corearch=arm ;; esac prepare() { mkdir build-{full,headless} mkdir -p extra-arch-{full,headless}/usr/{bin,share/qemu} cd ${pkgname}-${pkgver} sed -i 's/vte-2\.90/vte-2.91/g' configure patch -p1 < ../allow_elf64.patch # FS#60141 patch -p1 < ../fix_virtio.patch } build() { _build full \ --audio-drv-list="pa alsa sdl" _build headless \ --audio-drv-list= \ --disable-bluez \ --disable-sdl \ --disable-gtk \ --disable-vte \ --disable-opengl \ --disable-virglrenderer } _build() ( cd build-$1 # qemu vs. make 4 == bad export ARFLAGS=rv # http://permalink.gmane.org/gmane.comp.emulators.qemu/238740 export CFLAGS+=" -fPIC" ../${pkgname}-${pkgver}/configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --libexecdir=/usr/lib/qemu \ --python=/usr/bin/python2 \ --smbd=/usr/bin/smbd \ --with-gtkabi=3.0 \ --with-sdlabi=2.0 \ --enable-modules \ --enable-jemalloc \ "${@:2}" make ) package_qemu() { optdepends=('qemu-arch-extra: extra architectures support') provides=(qemu-headless) conflicts=(qemu-headless) replaces=(qemu-kvm) _package full } package_qemu-headless() { pkgdesc="QEMU without GUI" depends=("${_headlessdeps[@]}") optdepends=('qemu-headless-arch-extra: extra architectures support') _package headless } _package() { optdepends+=('samba: SMB/CIFS server support' 'qemu-block-iscsi: iSCSI block support' 'qemu-block-rbd: RBD block support' 'qemu-block-gluster: glusterfs block support') install=qemu.install options=(!strip) make -C build-$1 DESTDIR="$pkgdir" install "${@:2}" # systemd stuff install -Dm644 65-kvm.rules "$pkgdir/usr/lib/udev/rules.d/65-kvm.rules" # remove conflicting /var/run directory cd "$pkgdir" rm -r var cd usr/lib tidy_strip # bridge_helper needs suid # https://bugs.archlinux.org/task/32565 chmod u+s qemu/qemu-bridge-helper # remove split block modules rm qemu/block-{iscsi,rbd,gluster}.so cd ../bin tidy_strip # remove extra arch for _bin in qemu-*; do [[ -f $_bin ]] || continue case ${_bin#qemu-} in # guest agent ga) rm "$_bin"; continue ;; # tools img|io|nbd) continue ;; # core emu system-${_corearch}) continue ;; esac mv "$_bin" "$srcdir/extra-arch-$1/usr/bin" done cd ../share/qemu for _blob in *; do [[ -f $_blob ]] || continue case $_blob in # iPXE ROMs efi-*|pxe-*) continue ;; # core blobs kvmvapic.bin|linuxboot*|multiboot.bin|sgabios.bin|vgabios*) continue ;; # Trace events definitions trace-events*) continue ;; # Logos *.bmp|*.svg) continue ;; esac mv "$_blob" "$srcdir/extra-arch-$1/usr/share/qemu" done } package_qemu-arch-extra() { pkgdesc="QEMU for foreign architectures" depends=(qemu) provides=(qemu-headless-arch-extra) conflicts=(qemu-headless-arch-extra) options=(!strip) mv extra-arch-full/usr "$pkgdir" } package_qemu-headless-arch-extra() { pkgdesc="QEMU without GUI, for foreign architectures" depends=(qemu-headless) options=(!strip) mv extra-arch-headless/usr "$pkgdir" } package_qemu-block-iscsi() { pkgdesc="QEMU iSCSI block module" depends=(glib2 libiscsi jemalloc) install -D build-full/block-iscsi.so "$pkgdir/usr/lib/qemu/block-iscsi.so" } package_qemu-block-rbd() { pkgdesc="QEMU RBD block module" depends=(glib2 ceph) install -D build-full/block-rbd.so "$pkgdir/usr/lib/qemu/block-rbd.so" } package_qemu-block-gluster() { pkgdesc="QEMU GlusterFS block module" depends=(glib2 glusterfs) install -D build-full/block-gluster.so "$pkgdir/usr/lib/qemu/block-gluster.so" } package_qemu-guest-agent() { pkgdesc="QEMU Guest Agent" depends=(gcc-libs glib2) install -D build-full/qemu-ga "$pkgdir/usr/bin/qemu-ga" install -Dm644 qemu-ga.service "$pkgdir/usr/lib/systemd/system/qemu-ga.service" install -Dm755 "$srcdir/qemu-$pkgver/scripts/qemu-guest-agent/fsfreeze-hook" "$pkgdir/etc/qemu/fsfreeze-hook" } # vim:set ts=2 sw=2 et: