1 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
2 # Contributor: David Runge <dvzrv@archlinux.org>
3 # Contributor: Sébastien "Seblu" Luttringer <seblu@seblu.net>
10 qemu-headless-arch-extra
11 qemu-block-{iscsi,rbd,gluster}
14 pkgdesc="A generic and open source machine emulator and virtualizer"
18 license=(GPL2 LGPL2.1)
19 url="https://wiki.qemu.org/"
20 # TODO: consider providing rdma-core
21 # TODO: consider providing lzfse
65 python-sphinx_rtd_theme
81 source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig}
82 fix_unix_sockets.diff::https://gitlab.com/qemu-project/qemu/-/commit/118d527f2e4baec5fe8060b22a6212468b8e4d3f.diff
83 qemu-guest-agent.service
85 sha512sums=('3378ae21c75b77ee6a759827f1fcf7b2a50a0fef07e3b0e89117108022a8d8655fa977e4d65596f4f24f7c735c6594d44b0c6f69732ea4465e88a7406b1d5d3c'
87 'a87b0da1d49b4d17e9128544c2b0f00f1ac5242adc7fd9e8c9efd24ab6791ed702b2a0866383d31c1bff3259c281c95a60a96453ad998256a8b133cfd7107a59'
88 '269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4'
89 'bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99')
90 validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584') # Michael Roth <flukshun@gmail.com>
93 i?86) _corearch=i386 ;;
94 x86_64) _corearch=x86_64 ;;
98 mkdir build-{full,headless}
99 mkdir -p extra-arch-{full,headless}/usr/{bin,share/qemu}
101 cd ${pkgname}-${pkgver}
102 patch -p1 < ../fix_unix_sockets.diff # FS#72115
107 --audio-drv-list="pa alsa sdl jack"
116 --disable-virglrenderer
122 ../${pkgname}-${pkgver}/configure \
125 --localstatedir=/var \
126 --libexecdir=/usr/lib/qemu \
127 --smbd=/usr/bin/smbd \
130 --enable-slirp=system \
139 alsa-lib libasound.so
146 gdk-pixbuf2 libgdk_pixbuf-2.0.so
147 glib2 libgio-2.0.so libglib-2.0.so libgmodule-2.0.so libgobject-2.0.so
149 gtk3 libgdk-3.so libgtk-3.so
154 libcap-ng libcap-ng.so
161 libseccomp libseccomp.so
167 libxkbcommon libxkbcommon.so
170 ncurses libncursesw.so
174 pixman libpixman-1.so
179 spice libspice-server.so
180 systemd-libs libudev.so
189 'brltty: for braille device support'
190 'qemu-arch-extra: extra architectures support'
192 provides=(qemu-headless)
193 conflicts=(qemu-headless)
199 package_qemu-headless() {
200 pkgdesc="QEMU without GUI"
207 glib2 libgio-2.0.so libglib-2.0.so libgmodule-2.0.so libgobject-2.0.so
212 libcap-ng libcap-ng.so
217 libseccomp libseccomp.so
222 libxkbcommon libxkbcommon.so
226 ncurses libncursesw.so
228 pixman libpixman-1.so
231 spice libspice-server.so
232 systemd-libs libudev.so
238 optdepends=('qemu-headless-arch-extra: extra architectures support')
244 optdepends+=('samba: SMB/CIFS server support'
245 'qemu-block-iscsi: iSCSI block support'
246 'qemu-block-rbd: RBD block support'
247 'qemu-block-gluster: glusterfs block support')
249 options=(!strip !emptydirs)
251 DESTDIR="$pkgdir" ninja -C build-$1 install "${@:2}"
254 install -Dm644 65-kvm.rules "$pkgdir/usr/lib/udev/rules.d/65-kvm.rules"
256 # remove conflicting /var/run directory
262 # bridge_helper needs suid
263 # https://bugs.archlinux.org/task/32565
264 chmod u+s qemu/qemu-bridge-helper
266 # remove split block modules
267 rm qemu/block-{iscsi,rbd,gluster}.so
272 for _bin in qemu-*; do
273 [[ -f $_bin ]] || continue
275 case ${_bin#qemu-} in
277 ga) rm "$_bin"; continue ;;
280 edid|img|io|keymap|nbd|pr-helper|storage-daemon) continue ;;
283 system-${_corearch}) continue ;;
286 mv "$_bin" "$srcdir/extra-arch-$1/usr/bin"
291 [[ -f $_blob ]] || continue
294 # provided by seabios package
295 bios.bin|bios-256k.bin|vgabios-cirrus.bin|vgabios-qxl.bin|\
296 vgabios-stdvga.bin|vgabios-vmware.bin|vgabios-virtio.bin|vgabios-bochs-display.bin|\
297 vgabios-ramfb.bin) rm "$_blob"; continue ;;
299 # provided by edk2-ovmf package
300 edk2-*) rm "$_blob"; continue ;;
303 efi-*|pxe-*) continue ;;
306 bios-microvm.bin|kvmvapic.bin|linuxboot*|multiboot.bin|sgabios.bin|vgabios*) continue ;;
308 # Trace events definitions
309 trace-events*) continue ;;
312 mv "$_blob" "$srcdir/extra-arch-$1/usr/share/qemu"
315 # provided by edk2-ovmf package
319 if [ "$1" = headless ]; then rm -r {applications,icons}; fi
322 package_qemu-arch-extra() {
323 pkgdesc="QEMU for foreign architectures"
331 glib2 libgio-2.0.so libglib-2.0.so libgobject-2.0.so libgmodule-2.0.so
335 libseccomp libseccomp.so
342 pixman libpixman-1.so
353 'edk2-armvirt: for aarch64 UEFI support'
354 'edk2-ovmf: for ia32 and x64 UEFI support'
356 provides=(qemu-headless-arch-extra)
357 conflicts=(qemu-headless-arch-extra)
360 mv -v extra-arch-full/usr "$pkgdir"
363 package_qemu-headless-arch-extra() {
364 pkgdesc="QEMU without GUI, for foreign architectures"
372 glib2 libgio-2.0.so libglib-2.0.so libgobject-2.0.so libgmodule-2.0.so
376 libseccomp libseccomp.so
383 pixman libpixman-1.so
386 systemd-libs libudev.so
392 'edk2-armvirt: for aarch64 UEFI support'
393 'edk2-ovmf: for ia32 and x64 UEFI support'
397 mv -v extra-arch-headless/usr "$pkgdir"
400 package_qemu-block-iscsi() {
401 pkgdesc="QEMU iSCSI block module"
402 depends=(glibc libiscsi)
404 install -vDm 755 build-full/block-iscsi.so -t "$pkgdir/usr/lib/qemu/"
407 package_qemu-block-rbd() {
408 pkgdesc="QEMU RBD block module"
409 depends=(glibc ceph-libs)
411 install -vDm 755 build-full/block-rbd.so -t "$pkgdir/usr/lib/qemu/"
414 package_qemu-block-gluster() {
415 pkgdesc="QEMU GlusterFS block module"
416 depends=(glibc glusterfs)
418 install -vDm 755 build-full/block-gluster.so -t "$pkgdir/usr/lib/qemu/"
421 package_qemu-guest-agent() {
422 pkgdesc="QEMU Guest Agent"
423 depends=(gcc-libs glib2 libudev.so liburing)
424 install=qemu-guest-agent.install
426 install -vDm 755 build-full/qga/qemu-ga -t "$pkgdir/usr/bin/"
427 install -vDm 644 qemu-guest-agent.service -t "$pkgdir/usr/lib/systemd/system/"
428 install -vDm 755 "$srcdir/qemu-$pkgver/scripts/qemu-guest-agent/fsfreeze-hook" -t "$pkgdir/etc/qemu/"
431 # vim:set ts=2 sw=2 et: