~dricottone/huttese-apk

ref: e3c386882b3ef0f7b2c930c2813486f486718a72 huttese-apk/sr.ht/qemu-minimal-static/APKBUILD -rw-r--r-- 2.2 KiB
e3c38688 — Drew DeVault hub.sr.ht: new aport 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=qemu-minimal-static
pkgver=4.2.0
pkgrel=0
pkgdesc="A stripped down, chrooted version of qemu for untrusted guests"
url="https://qemu.org/"
arch="all"
license="GPL-2.0 LGPL-2"
makedepends="
	glib-dev
	glib-static
	libaio-dev
	libcap-dev
	libcap-ng-dev
	linux-headers
	lzo-dev
	perl
	pixman-static
	pixman-dev
	python3
	texinfo
	util-linux-dev
	vde2-dev
	zlib-dev
	zlib-static
	"
install="$pkgname.pre-install"
options="suid !strip !check" # strip fails on .img files; suid for chroot binary
source="
	https://wiki.qemu-project.org/download/qemu-$pkgver.tar.xz
	80-kvm.rules
	qemu-chroot.c
"
builddir="$srcdir/qemu-$pkgver"

prepare() {
	default_prepare
	sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \
		Makefile.target
}

build() {
	./configure \
		--prefix=/ \
		--static \
		--python=/usr/bin/python3 \
		--audio-drv-list="" \
		--disable-docs \
		--disable-debug-info \
		--disable-opengl \
		--disable-virglrenderer \
		--disable-vte \
		--disable-gtk \
		--disable-sdl \
		--disable-bluez \
		--disable-spice \
		--disable-vnc \
		--disable-curses \
		--disable-xen \
		--disable-smartcard \
		--disable-libnfs \
		--disable-libusb \
		--disable-glusterfs \
		--disable-tools \
		--disable-werror \
		--target-list="x86_64-softmmu,i386-softmmu,aarch64-softmmu,arm-softmmu,ppc64-softmmu,s390x-softmmu,riscv64-softmmu,mips-softmmu,mipsel-softmmu,mips64el-softmmu"
	cc -o qemu-chroot "$srcdir"/qemu-chroot.c
}

package() {
	make DESTDIR="$pkgdir/usr/lib/qemu-minimal-static" install
	install -Dm644 "$srcdir"/80-kvm.rules \
		"$pkgdir"/lib/udev/rules.d/80-kvm.rules
	mkdir -p "$pkgdir"/usr/bin
	install -Dm755 qemu-chroot "$pkgdir"/usr/bin/qemu-chroot
	chmod a+s "$pkgdir"/usr/bin/qemu-chroot
	rm "$pkgdir"/usr/lib/qemu-minimal-static/libexec/qemu-bridge-helper
}

sha512sums="2a79973c2b07c53e8c57a808ea8add7b6b2cbca96488ed5d4b669ead8c9318907dec2b6109f180fc8ca8f04c0f73a56e82b3a527b5626b799d7e849f2474ec56  qemu-4.2.0.tar.xz
9b7a89b20fcf737832cb7b4d5dc7d8301dd88169cbe5339eda69fbb51c2e537d8cb9ec7cf37600899e734209e63410d50d0821bce97e401421db39c294d97be2  80-kvm.rules
731b946f0c2fe188b8c4f7c96758359d86995d6ea45a8476c0e741268d03c7b65c0507f9298309224810558c825ee03bba13e8ebef0ee7d6dbd9e8194990312b  qemu-chroot.c"