2016-10-15 15:45:40 +00:00
|
|
|
# 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
|
2019-10-06 18:33:50 +00:00
|
|
|
# - remove makedepend on ceph, drop qemu-block-rbd package
|
2016-10-15 15:45:40 +00:00
|
|
|
|
2018-03-10 02:43:17 +00:00
|
|
|
buildarch=12
|
2016-10-15 15:45:40 +00:00
|
|
|
|
|
|
|
pkgbase=qemu
|
|
|
|
pkgname=(qemu qemu-headless qemu-arch-extra qemu-headless-arch-extra
|
2019-10-06 18:33:50 +00:00
|
|
|
qemu-block-{iscsi,gluster} qemu-guest-agent)
|
2016-10-15 15:45:40 +00:00
|
|
|
pkgdesc="A generic and open source machine emulator and virtualizer"
|
2019-08-19 23:24:07 +00:00
|
|
|
pkgver=4.1.0
|
2019-11-11 19:49:11 +00:00
|
|
|
pkgrel=5
|
2017-12-18 18:51:07 +00:00
|
|
|
arch=(x86_64)
|
2016-10-15 15:45:40 +00:00
|
|
|
license=(GPL2 LGPL2.1)
|
2019-04-25 22:41:05 +00:00
|
|
|
url="https://wiki.qemu.org/"
|
2016-10-15 15:45:40 +00:00
|
|
|
_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[@]}")
|
2019-10-06 18:33:50 +00:00
|
|
|
makedepends=(spice-protocol python2 libiscsi glusterfs python-sphinx)
|
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
|
2019-11-07 01:43:06 +00:00
|
|
|
65-kvm.rules
|
|
|
|
fix_image_corruption_1.patch::"https://git.qemu.org/?p=qemu.git;a=patch;h=944f3d5dd216fcd8cb007eddd4f82dced0a15b3d"
|
2019-11-11 19:49:11 +00:00
|
|
|
fix_image_corruption_2.patch::"https://git.qemu.org/?p=qemu.git;a=patch;h=5e9785505210e2477e590e61b1ab100d0ec22b01"
|
|
|
|
fix_qcow_compressed.patch::"https://git.qemu.org/?p=qemu.git;a=patch;h=24552feb6ae2f615b76c2b95394af43901f75046")
|
2019-08-19 23:24:07 +00:00
|
|
|
sha512sums=('82fd51702a7b9b1b00b2f1bd3b4a832b80249018dbba1add0b0a73e7d4bee452afd45574b4d8df7ce4477d8711f3bda4ca072a1a6de25895c93eb21cf78fc4b2'
|
2016-12-19 00:44:56 +00:00
|
|
|
'SKIP'
|
2018-09-26 12:34:38 +00:00
|
|
|
'269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4'
|
2019-11-07 01:43:06 +00:00
|
|
|
'bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99'
|
|
|
|
'5cb7967aa2957919df788a92aefeab0e7aeb6e13ef89c7ab79f6a2b18fcb871376aa1fdf2d821560af6f41d3a78dcd3e0c9c0f199a57cc94b7f138e94d7103a0'
|
2019-11-11 19:49:11 +00:00
|
|
|
'1cec5950692859c717b0d41fb7baf6b23f638086f9dccaddc3c96d835184ab832393592156a7c25f342f45059071e75a36360f4a6799f7cf74b6a548bdbe66d2'
|
|
|
|
'9ebb3f853d78c8f1c482e3603c79b621cad036a943a7c5f575e2bc1b1fb5f2f14f909d97e77ff9738d23b212c74e7d30c99dc55633132a1a03480d28ee988f55')
|
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}
|
2019-08-19 23:24:07 +00:00
|
|
|
#sed -i 's/vte-2\.90/vte-2.91/g' configure
|
2019-11-07 01:43:06 +00:00
|
|
|
|
|
|
|
# https://bugs.archlinux.org/task/64150
|
|
|
|
patch -p1 < ../fix_image_corruption_1.patch
|
|
|
|
patch -p1 < ../fix_image_corruption_2.patch
|
2019-11-11 19:49:11 +00:00
|
|
|
patch -p1 < ../fix_qcow_compressed.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 \
|
|
|
|
--enable-modules \
|
2019-04-25 22:41:05 +00:00
|
|
|
--enable-sdl \
|
2016-10-15 15:45:40 +00:00
|
|
|
--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-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
|
2019-10-06 18:33:50 +00:00
|
|
|
rm qemu/block-{iscsi,gluster}.so
|
2016-10-15 15:45:40 +00:00
|
|
|
|
|
|
|
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-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:
|