From d2567bfbdf0e9fa6db0a6ed1534831ec859a3e03 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 15 Jun 2022 20:02:02 +0100 Subject: added deps for qemu --- repo/qemu/qemu.xibuild | 127 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 repo/qemu/qemu.xibuild (limited to 'repo/qemu/qemu.xibuild') diff --git a/repo/qemu/qemu.xibuild b/repo/qemu/qemu.xibuild new file mode 100644 index 0000000..4f9327b --- /dev/null +++ b/repo/qemu/qemu.xibuild @@ -0,0 +1,127 @@ +#!/bin/sh + +NAME="qemu" +DESC="QEMU is a generic machine emulator and virtualizer" + +MAKEDEPS=" meson bash alsa-lib bison curl flex glib glib gnutls gtk3 libaio libcap libcap-ng libjpeg-turbo libnfs libpng libseccomp libssh2 liburing libusb libxml2 linux-headers lzo ncurses numactl perl pulseaudio python python-sphinx sdl2 snappy spice texinfo usbredir util-linux vde2 virglrenderer vte3 xfsprogs zlib zlib zstd zstd ceph" + +PKG_VER=7.0.0 +SOURCE="https://wiki.qemu-project.org/download/qemu-$PKG_VER.tar.xz" + +ADDITIONAL=" +0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch +80-kvm.rules +CVE-2021-20255.patch +MAP_SYNC-fix.patch +bridge.conf +fix-sockios-header.patch +guest-agent-shutdown.patch +mips-softfloat.patch +musl-initialise-msghdr.patch +qemu-guest-agent.confd +qemu-guest-agent.initd +qemu.post-install +qemu.pre-install +qemu.pre-upgrade +xattr_size_max.patch +" + +prepare () { + apply_patches +} + +compile_common() { + CFLAGS="$CFLAGS -O2" "$BUILD_ROOT"/configure \ + --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --libexecdir=/usr/lib/qemu \ + --python=/usr/bin/python \ + --disable-glusterfs \ + --disable-debug-info \ + --disable-bsd-user \ + --disable-werror \ + --disable-xen \ + --enable-kvm \ + --enable-seccomp \ + --cc="${CC:-gcc}" \ + "$@" + make ARFLAGS="rc" +} + +build() { + mkdir -p "$BUILD_ROOT"/build + cd "$BUILD_ROOT"/build + CFLAGS="$CFLAGS -O2" "$BUILD_ROOT"/configure \ + --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --libexecdir=/usr/lib/qemu \ + --python=/usr/bin/python \ + --disable-glusterfs \ + --disable-debug-info \ + --disable-bsd-user \ + --disable-werror \ + --disable-xen \ + --enable-kvm \ + --enable-seccomp \ + --cc="${CC:-gcc}" \ + --disable-linux-user \ + --audio-drv-list=oss,alsa,sdl,pa \ + --enable-cap-ng \ + --enable-curl \ + --enable-curses \ + --enable-docs \ + --enable-gtk \ + --enable-guest-agent \ + --enable-libnfs \ + --enable-libssh \ + --enable-linux-aio \ + --enable-lzo \ + --enable-modules \ + --enable-numa \ + --enable-pie \ + --enable-sdl \ + --enable-snappy \ + --enable-spice \ + --enable-tpm \ + --enable-usb-redir \ + --enable-vde \ + --enable-vhost-net \ + --enable-virglrenderer \ + --enable-virtfs \ + --enable-vnc \ + --enable-vnc-jpeg \ + --enable-vnc-png \ + --enable-zstd \ + --enable-rbd \ + --tls-priority=@QEMU,SYSTEM + make ARFLAGS="rc" +} + +package() { + cd "$BUILD_ROOT"/build + make DESTDIR="$PKG_DEST" install + + install -Dm640 -g qemu "$BUILD_ROOT"/bridge.conf \ + "$PKG_DEST"/etc/qemu/bridge.conf + + install -Dm644 "$BUILD_ROOT"/80-kvm.rules \ + "$PKG_DEST"/lib/udev/rules.d/80-kvm.rules + + # qemu-bridge-helper needs suid to create tunX devices; + # allow only users in the qemu group to run it. + chmod 04710 "$PKG_DEST"/usr/lib/qemu/qemu-bridge-helper + chgrp qemu "$PKG_DEST"/usr/lib/qemu/qemu-bridge-helper + + # Do not install HTML docs. + rm -rf "$PKG_DEST"/usr/share/doc + # remove accel-qtest-* modules, not needed for package + rm -f "$PKG_DEST"/usr/lib/qemu/accel-qtest-* +} + +postinstall () { + addgroup -S -g 34 kvm 2>/dev/null || true + addgroup -S -g 36 qemu 2>/dev/null || true + adduser -S -H -h /dev/null -u 36 -G kvm -s /sbin/nologin qemu 2>/dev/null || true +} -- cgit v1.2.1