PKGBUILDs/extra/qemu/PKGBUILD

227 lines
5.5 KiB
Bash
Raw Normal View History

2016-10-15 15:45:40 +00:00
# $Id$
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Sébastien "Seblu" Luttringer <seblu@seblu.net>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2016-12-07 05:07:37 +00:00
# - remove numactl and seabios _headlessdeps, revert not installing qemu seabios files
2016-10-15 15:45:40 +00:00
# - define ARM _corearchs
buildarch=28
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"
2017-12-18 19:05:48 +00:00
pkgver=2.11.0
2018-01-29 20:13:21 +00:00
pkgrel=4
2017-12-18 18:51:07 +00:00
arch=(x86_64)
2016-10-15 15:45:40 +00:00
license=(GPL2 LGPL2.1)
url="http://wiki.qemu.org/"
_headlessdeps=(gnutls libpng libaio jemalloc xfsprogs libnfs
2017-12-20 23:58:48 +00:00
lzo snappy curl vde2 libcap-ng spice libcacard usbredir)
depends=(virglrenderer sdl2 vte3 libpulse "${_headlessdeps[@]}")
2016-12-07 05:07:37 +00:00
makedepends=(spice-protocol python2 ceph libiscsi glusterfs)
2018-01-29 20:13:21 +00:00
source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig}
2016-10-15 15:45:40 +00:00
qemu-ga.service
2017-06-23 00:01:37 +00:00
65-kvm.rules
allow_elf64.patch)
2018-01-29 20:13:21 +00:00
sha256sums=('c9d34a79024eae080ce3853aa9afe503824520eefb440190383003081ce7f437'
2016-12-19 00:44:56 +00:00
'SKIP'
2017-03-14 12:41:59 +00:00
'c39bcde4a09165e64419fd2033b3532378bba84d509d39e2d51694d44c1f8d88'
2017-12-18 18:51:07 +00:00
'a66f0e791b16b03b91049aac61a25950d93e962e1b2ba64a38c6ad7f609b532c'
2017-06-23 00:01:37 +00:00
'13a6d9e678bdc9e1f051006cfd0555f5a80582368f54c8a1bb5a78ece3832ac4')
2016-12-19 00:44:56 +00:00
validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584')
2016-10-15 15:45:40 +00:00
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
2017-06-23 00:01:37 +00:00
patch -p1 < ../allow_elf64.patch
2016-10-15 15:45:40 +00:00
}
build() {
_build full \
--audio-drv-list="pa alsa sdl"
_build headless \
--audio-drv-list= \
--disable-bluez \
--disable-sdl \
--disable-gtk \
--disable-vte \
--disable-opengl \
2017-12-18 18:51:07 +00:00
--disable-virglrenderer
2016-10-15 15:45:40 +00:00
}
_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
2016-12-19 00:44:56 +00:00
kvmvapic.bin|linuxboot*|multiboot.bin|sgabios.bin|vgabios*) continue ;;
2016-10-15 15:45:40 +00:00
# Trace events definitions
2016-12-19 00:44:56 +00:00
trace-events*) continue ;;
2016-10-15 15:45:40 +00:00
# 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"
2017-03-14 12:41:59 +00:00
install -Dm755 "$srcdir/qemu-$pkgver/scripts/qemu-guest-agent/fsfreeze-hook" "$pkgdir/etc/qemu/fsfreeze-hook"
2016-10-15 15:45:40 +00:00
}
# vim:set ts=2 sw=2 et: