2016-10-15 15:45:40 +00:00
|
|
|
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
|
2021-10-14 17:36:38 +00:00
|
|
|
# Contributor: David Runge <dvzrv@archlinux.org>
|
2016-10-15 15:45:40 +00:00
|
|
|
# Contributor: Sébastien "Seblu" Luttringer <seblu@seblu.net>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
2021-10-14 17:36:38 +00:00
|
|
|
# - remove makedepends on numactl and seabios, 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
|
|
|
|
|
|
|
pkgbase=qemu
|
2021-10-14 17:36:38 +00:00
|
|
|
pkgname=(
|
|
|
|
qemu
|
|
|
|
qemu-headless
|
|
|
|
qemu-arch-extra
|
|
|
|
qemu-headless-arch-extra
|
|
|
|
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"
|
2021-12-17 18:56:30 +00:00
|
|
|
pkgver=6.2.0
|
2021-12-22 17:21:43 +00:00
|
|
|
pkgrel=2
|
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/"
|
2021-10-14 17:36:38 +00:00
|
|
|
# TODO: consider providing rdma-core
|
|
|
|
# TODO: consider providing lzfse
|
|
|
|
makedepends=(
|
|
|
|
alsa-lib
|
|
|
|
brltty
|
|
|
|
bzip2
|
|
|
|
cairo
|
|
|
|
curl
|
|
|
|
cdrtools
|
|
|
|
dtc
|
|
|
|
fuse3
|
|
|
|
gcc-libs
|
|
|
|
gdk-pixbuf2
|
|
|
|
glib2
|
|
|
|
glusterfs
|
|
|
|
gnutls
|
|
|
|
gtk3
|
|
|
|
jack
|
|
|
|
libaio
|
|
|
|
libbpf
|
|
|
|
libcacard
|
|
|
|
libcap-ng
|
|
|
|
libepoxy
|
|
|
|
libiscsi
|
|
|
|
libnfs
|
|
|
|
libpng
|
|
|
|
libpulse
|
|
|
|
libsasl
|
|
|
|
libseccomp
|
|
|
|
libslirp
|
|
|
|
libssh
|
|
|
|
liburing
|
|
|
|
libusb
|
|
|
|
libx11
|
|
|
|
libxkbcommon
|
|
|
|
lzo
|
|
|
|
mesa
|
|
|
|
meson
|
|
|
|
ncurses
|
|
|
|
ndctl
|
|
|
|
pam
|
|
|
|
python
|
|
|
|
python-sphinx
|
|
|
|
python-sphinx_rtd_theme
|
|
|
|
sdl2
|
|
|
|
sdl2_image
|
|
|
|
snappy
|
|
|
|
spice-protocol
|
|
|
|
spice
|
|
|
|
systemd
|
|
|
|
usbredir
|
|
|
|
vde2
|
|
|
|
virglrenderer
|
|
|
|
vte3
|
|
|
|
xfsprogs
|
|
|
|
zlib
|
|
|
|
zstd
|
|
|
|
)
|
2018-01-29 20:13:21 +00:00
|
|
|
source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig}
|
2020-11-08 20:05:46 +00:00
|
|
|
qemu-guest-agent.service
|
2019-11-21 00:19:27 +00:00
|
|
|
65-kvm.rules)
|
2021-12-17 18:56:30 +00:00
|
|
|
sha512sums=('e9f8231c9e1cfcc41cb47f10a55d63f6b8aee307af00cf6acf64acb7aa4f49fa7e9d6330703a2abea15d8b7bbaba7d3cb08c83edd98d82642367b527df730817'
|
2016-12-19 00:44:56 +00:00
|
|
|
'SKIP'
|
2018-09-26 12:34:38 +00:00
|
|
|
'269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4'
|
2019-11-21 00:19:27 +00:00
|
|
|
'bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99')
|
2020-10-21 13:48:55 +00:00
|
|
|
validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584') # Michael Roth <flukshun@gmail.com>
|
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}
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2021-12-22 17:21:43 +00:00
|
|
|
_build full
|
2016-10-15 15:45:40 +00:00
|
|
|
|
|
|
|
_build headless \
|
|
|
|
--disable-sdl \
|
|
|
|
--disable-gtk \
|
|
|
|
--disable-vte \
|
2020-02-12 13:25:59 +00:00
|
|
|
--disable-brlapi \
|
2016-10-15 15:45:40 +00:00
|
|
|
--disable-opengl \
|
2021-12-22 17:21:43 +00:00
|
|
|
--disable-virglrenderer \
|
|
|
|
--disable-alsa \
|
|
|
|
--disable-jack \
|
|
|
|
--disable-oss \
|
|
|
|
--disable-pa \
|
|
|
|
--disable-sdl
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_build() (
|
|
|
|
cd build-$1
|
|
|
|
|
|
|
|
../${pkgname}-${pkgver}/configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--libexecdir=/usr/lib/qemu \
|
|
|
|
--smbd=/usr/bin/smbd \
|
|
|
|
--enable-modules \
|
2019-04-25 22:41:05 +00:00
|
|
|
--enable-sdl \
|
2020-02-12 13:25:59 +00:00
|
|
|
--enable-slirp=system \
|
2020-05-06 20:52:15 +00:00
|
|
|
--enable-xfsctl \
|
2016-10-15 15:45:40 +00:00
|
|
|
"${@:2}"
|
|
|
|
|
2020-12-10 19:45:24 +00:00
|
|
|
ninja
|
2016-10-15 15:45:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
package_qemu() {
|
2021-10-14 17:36:38 +00:00
|
|
|
depends=(
|
|
|
|
alsa-lib libasound.so
|
|
|
|
bzip2 libbz2.so
|
|
|
|
cairo
|
|
|
|
curl libcurl.so
|
|
|
|
dtc
|
|
|
|
fuse3
|
|
|
|
gcc-libs
|
|
|
|
gdk-pixbuf2 libgdk_pixbuf-2.0.so
|
|
|
|
glib2 libgio-2.0.so libglib-2.0.so libgmodule-2.0.so libgobject-2.0.so
|
|
|
|
gnutls
|
|
|
|
gtk3 libgdk-3.so libgtk-3.so
|
|
|
|
jack libjack.so
|
|
|
|
libaio
|
|
|
|
libbpf libbpf.so
|
|
|
|
libcacard
|
|
|
|
libcap-ng libcap-ng.so
|
|
|
|
libepoxy
|
|
|
|
libjpeg libjpeg.so
|
|
|
|
libnfs
|
|
|
|
libpng
|
|
|
|
libpulse libpulse.so
|
|
|
|
libsasl
|
|
|
|
libseccomp libseccomp.so
|
|
|
|
libslirp libslirp.so
|
|
|
|
libssh libssh.so
|
|
|
|
libusb libusb-1.0.so
|
|
|
|
liburing liburing.so
|
|
|
|
libx11
|
|
|
|
libxkbcommon libxkbcommon.so
|
|
|
|
lzo
|
|
|
|
mesa
|
|
|
|
ncurses libncursesw.so
|
|
|
|
ndctl
|
|
|
|
pam libpam.so
|
|
|
|
pixman libpixman-1.so
|
|
|
|
sdl2
|
|
|
|
sdl2_image
|
|
|
|
snappy
|
|
|
|
spice libspice-server.so
|
|
|
|
systemd-libs libudev.so
|
|
|
|
usbredir
|
|
|
|
virglrenderer
|
|
|
|
vde2
|
|
|
|
vte3 libvte-2.91.so
|
|
|
|
zlib
|
|
|
|
zstd libzstd.so
|
|
|
|
)
|
|
|
|
optdepends=(
|
|
|
|
'brltty: for braille device support'
|
|
|
|
'qemu-arch-extra: extra architectures support'
|
|
|
|
)
|
2016-10-15 15:45:40 +00:00
|
|
|
provides=(qemu-headless)
|
|
|
|
conflicts=(qemu-headless)
|
|
|
|
replaces=(qemu-kvm)
|
|
|
|
|
|
|
|
_package full
|
|
|
|
}
|
|
|
|
|
|
|
|
package_qemu-headless() {
|
|
|
|
pkgdesc="QEMU without GUI"
|
2021-10-14 17:36:38 +00:00
|
|
|
depends=(
|
|
|
|
bzip2 libbz2.so
|
|
|
|
curl libcurl.so
|
|
|
|
dtc
|
|
|
|
fuse3
|
|
|
|
gcc-libs
|
|
|
|
glib2 libgio-2.0.so libglib-2.0.so libgmodule-2.0.so libgobject-2.0.so
|
|
|
|
gnutls
|
|
|
|
libaio
|
|
|
|
libbpf libbpf.so
|
|
|
|
libcacard
|
|
|
|
libcap-ng libcap-ng.so
|
|
|
|
libjpeg libjpeg.so
|
|
|
|
libnfs
|
|
|
|
libpng
|
|
|
|
libsasl
|
|
|
|
libseccomp libseccomp.so
|
|
|
|
libslirp libslirp.so
|
|
|
|
libssh libssh.so
|
|
|
|
libusb libusb-1.0.so
|
|
|
|
liburing liburing.so
|
|
|
|
libxkbcommon libxkbcommon.so
|
|
|
|
lzo
|
|
|
|
ndctl
|
|
|
|
ncurses libncursesw.so
|
|
|
|
pam libpam.so
|
|
|
|
pixman libpixman-1.so
|
|
|
|
snappy
|
|
|
|
spice libspice-server.so
|
|
|
|
systemd-libs libudev.so
|
|
|
|
usbredir
|
|
|
|
vde2
|
|
|
|
zlib
|
|
|
|
zstd libzstd.so
|
|
|
|
)
|
2016-10-15 15:45:40 +00:00
|
|
|
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
|
2020-05-06 20:52:15 +00:00
|
|
|
options=(!strip !emptydirs)
|
2016-10-15 15:45:40 +00:00
|
|
|
|
2020-12-10 19:45:24 +00:00
|
|
|
DESTDIR="$pkgdir" ninja -C build-$1 install "${@:2}"
|
2016-10-15 15:45:40 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# remove extra arch
|
|
|
|
for _bin in qemu-*; do
|
|
|
|
[[ -f $_bin ]] || continue
|
|
|
|
|
|
|
|
case ${_bin#qemu-} in
|
|
|
|
# guest agent
|
|
|
|
ga) rm "$_bin"; continue ;;
|
|
|
|
|
|
|
|
# tools
|
2020-05-06 20:52:15 +00:00
|
|
|
edid|img|io|keymap|nbd|pr-helper|storage-daemon) continue ;;
|
2016-10-15 15:45:40 +00:00
|
|
|
|
|
|
|
# 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
|
2020-05-06 20:52:15 +00:00
|
|
|
# provided by edk2-ovmf package
|
|
|
|
edk2-*) rm "$_blob"; continue ;;
|
|
|
|
|
2016-10-15 15:45:40 +00:00
|
|
|
# iPXE ROMs
|
|
|
|
efi-*|pxe-*) continue ;;
|
|
|
|
|
|
|
|
# core blobs
|
2020-05-06 20:52:15 +00:00
|
|
|
bios-microvm.bin|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
|
|
|
esac
|
|
|
|
|
|
|
|
mv "$_blob" "$srcdir/extra-arch-$1/usr/share/qemu"
|
|
|
|
done
|
2020-05-06 20:52:15 +00:00
|
|
|
|
|
|
|
# provided by edk2-ovmf package
|
|
|
|
rm -r firmware
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
if [ "$1" = headless ]; then rm -r {applications,icons}; fi
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_qemu-arch-extra() {
|
|
|
|
pkgdesc="QEMU for foreign architectures"
|
2021-10-14 17:36:38 +00:00
|
|
|
depends=(
|
|
|
|
dtc
|
|
|
|
fuse3
|
|
|
|
gcc-libs
|
|
|
|
gnutls
|
|
|
|
libaio
|
|
|
|
libbpf libbpf.so
|
|
|
|
glib2 libgio-2.0.so libglib-2.0.so libgobject-2.0.so libgmodule-2.0.so
|
|
|
|
libjpeg libjpeg.so
|
|
|
|
libpng
|
|
|
|
libsasl
|
|
|
|
libseccomp libseccomp.so
|
|
|
|
libslirp libslirp.so
|
|
|
|
liburing liburing.so
|
|
|
|
lzo
|
|
|
|
ndctl
|
|
|
|
pam libpam.so
|
|
|
|
pixman libpixman-1.so
|
|
|
|
snappy
|
|
|
|
systemd-libs
|
|
|
|
libudev.so
|
|
|
|
qemu
|
|
|
|
vde2
|
|
|
|
zlib
|
|
|
|
zstd
|
|
|
|
libzstd.so
|
|
|
|
)
|
|
|
|
optdepends=(
|
|
|
|
'edk2-armvirt: for aarch64 UEFI support'
|
|
|
|
'edk2-ovmf: for ia32 and x64 UEFI support'
|
|
|
|
)
|
2016-10-15 15:45:40 +00:00
|
|
|
provides=(qemu-headless-arch-extra)
|
|
|
|
conflicts=(qemu-headless-arch-extra)
|
|
|
|
options=(!strip)
|
|
|
|
|
2021-10-14 17:36:38 +00:00
|
|
|
mv -v extra-arch-full/usr "$pkgdir"
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_qemu-headless-arch-extra() {
|
|
|
|
pkgdesc="QEMU without GUI, for foreign architectures"
|
2021-10-14 17:36:38 +00:00
|
|
|
depends=(
|
|
|
|
dtc
|
|
|
|
fuse3
|
|
|
|
gcc-libs
|
|
|
|
gnutls
|
|
|
|
libaio
|
|
|
|
libbpf libbpf.so
|
|
|
|
glib2 libgio-2.0.so libglib-2.0.so libgobject-2.0.so libgmodule-2.0.so
|
|
|
|
libjpeg libjpeg.so
|
|
|
|
libpng
|
|
|
|
libsasl
|
|
|
|
libseccomp libseccomp.so
|
|
|
|
libslirp libslirp.so
|
|
|
|
liburing liburing.so
|
|
|
|
lzo
|
|
|
|
ndctl
|
|
|
|
pam libpam.so
|
|
|
|
pixman libpixman-1.so
|
|
|
|
snappy
|
|
|
|
qemu-headless
|
|
|
|
systemd-libs libudev.so
|
|
|
|
vde2
|
|
|
|
zlib
|
|
|
|
zstd libzstd.so
|
|
|
|
)
|
|
|
|
optdepends=(
|
|
|
|
'edk2-armvirt: for aarch64 UEFI support'
|
|
|
|
'edk2-ovmf: for ia32 and x64 UEFI support'
|
|
|
|
)
|
2016-10-15 15:45:40 +00:00
|
|
|
options=(!strip)
|
|
|
|
|
2021-10-14 17:36:38 +00:00
|
|
|
mv -v extra-arch-headless/usr "$pkgdir"
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_qemu-block-iscsi() {
|
|
|
|
pkgdesc="QEMU iSCSI block module"
|
2021-10-14 17:36:38 +00:00
|
|
|
depends=(glibc libiscsi)
|
2016-10-15 15:45:40 +00:00
|
|
|
|
2021-10-14 17:36:38 +00:00
|
|
|
install -vDm 755 build-full/block-iscsi.so -t "$pkgdir/usr/lib/qemu/"
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_qemu-block-gluster() {
|
|
|
|
pkgdesc="QEMU GlusterFS block module"
|
2021-10-14 17:36:38 +00:00
|
|
|
depends=(glibc glusterfs)
|
2016-10-15 15:45:40 +00:00
|
|
|
|
2021-10-14 17:36:38 +00:00
|
|
|
install -vDm 755 build-full/block-gluster.so -t "$pkgdir/usr/lib/qemu/"
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_qemu-guest-agent() {
|
|
|
|
pkgdesc="QEMU Guest Agent"
|
2020-12-10 19:45:24 +00:00
|
|
|
depends=(gcc-libs glib2 libudev.so liburing)
|
2020-11-08 20:05:46 +00:00
|
|
|
install=qemu-guest-agent.install
|
2016-10-15 15:45:40 +00:00
|
|
|
|
2021-10-14 17:36:38 +00:00
|
|
|
install -vDm 755 build-full/qga/qemu-ga -t "$pkgdir/usr/bin/"
|
|
|
|
install -vDm 644 qemu-guest-agent.service -t "$pkgdir/usr/lib/systemd/system/"
|
|
|
|
install -vDm 755 "$srcdir/qemu-$pkgver/scripts/qemu-guest-agent/fsfreeze-hook" -t "$pkgdir/etc/qemu/"
|
2016-10-15 15:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|