~dricottone/huttese-apk

ref: 56ea7f0ef754051e1bf3bd6b76a0e075d3086aa4 huttese-apk/sr.ht/qemu-minimal-static/APKBUILD -rw-r--r-- 2.6 KiB
56ea7f0e — Drew DeVault pkgkit: generate new abuild keys if necessary 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
83
84
85
86
87
88
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=qemu-minimal-static
pkgver=5.0.0
pkgrel=2
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
	90-kvm.rules
	qemu-chroot.c
	xattr_size_max.patch
"
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-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
	mkdir -p "$pkgdir"/usr/lib/qemu-minimal-static/dev
	mkdir -p "$pkgdir"/usr/lib/qemu-minimal-static/base
	mkdir -p "$pkgdir"/usr/lib/qemu-minimal-static/var/tmp
	touch "$pkgdir"/usr/lib/qemu-minimal-static/dev/null
	touch "$pkgdir"/usr/lib/qemu-minimal-static/dev/kvm
	install -Dm644 "$srcdir"/90-kvm.rules \
		"$pkgdir"/lib/udev/rules.d/90-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="21ef0cbe107c468a40f0fa2635db2a40048c8790b629dfffca5cd62bb1b502ea8eb133bfc40df5ecf1489e2bffe87f6829aee041cb8a380ff04a8afa23b39fcf  qemu-5.0.0.tar.xz
9b7a89b20fcf737832cb7b4d5dc7d8301dd88169cbe5339eda69fbb51c2e537d8cb9ec7cf37600899e734209e63410d50d0821bce97e401421db39c294d97be2  90-kvm.rules
996d78a60d4283b31400a808916c774e7dd80ae5827aa25966a19a8134710bf4a010f1eccc680dc6a4fdbaef953323e50674d6b857f4197d32d266ff106904c7  qemu-chroot.c
4b1e26ba4d53f9f762cbd5cea8ef6f8062d827ae3ae07bc36c5b0c0be4e94fc1856ad2477e8e791b074b8a25d51ed6d0ddd75e605e54600e5dd0799143793ce4  xattr_size_max.patch"