aboutsummaryrefslogtreecommitdiffstats
path: root/main/qemu/APKBUILD
blob: 1743333ef5d4db184a690ccee4ad6e8ad7f638f7 (plain) (blame)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qemu
pkgver=1.7.1
pkgrel=0
pkgdesc="QEMU is a generic machine emulator and virtualizer"
url="http://qemu.org/"
arch="all"
license="GPL-2 LGPL-2"
makedepends="zlib-dev sdl-dev alsa-lib-dev gnutls-dev ncurses-dev glib-dev
	libjpeg-turbo-dev libpng-dev vde2-dev spice-dev paxctl curl-dev
	libcap-dev libcap-ng-dev libaio-dev usbredir-dev util-linux-dev
	gtk+2.0-dev vte-dev libusbx-dev flex bison"
depends=
install="qemu.pre-install"
subpackages="
$pkgname-alpha:alpha
$pkgname-arm:arm
$pkgname-armeb:armeb
$pkgname-cris:cris
$pkgname-i386:i386
$pkgname-m68k:m68k
$pkgname-microblaze:microblaze
$pkgname-microblazeel:microblazeel
$pkgname-mips:mips
$pkgname-mips64:mips64
$pkgname-mips64el:mips64el
$pkgname-mipsel:mipsel
$pkgname-mipsn32:mipsn32
$pkgname-mipsn32el:mipsn32el
$pkgname-or32:or32
$pkgname-ppc:ppc
$pkgname-ppc64:ppc64
$pkgname-ppc64abi32:ppc64abi32
$pkgname-s390x:s390x
$pkgname-sh4:sh4
$pkgname-sh4eb:sh4eb
$pkgname-sparc:sparc
$pkgname-sparc32plus:sparc32plus
$pkgname-sparc64:sparc64
$pkgname-system-alpha:system_alpha
$pkgname-system-arm:system_arm
$pkgname-system-cris:system_cris
$pkgname-system-i386:system_i386
$pkgname-system-lm32:system_lm32
$pkgname-system-m68k:system_m68k
$pkgname-system-microblaze:system_microblaze
$pkgname-system-microblazeel:system_microblazeel
$pkgname-system-mips:system_mips
$pkgname-system-mips64:system_mips64
$pkgname-system-mips64el:system_mips64el
$pkgname-system-mipsel:system_mipsel
$pkgname-system-moxie:system_moxie
$pkgname-system-or32:system_or32
$pkgname-system-ppc:system_ppc
$pkgname-system-ppc64:system_ppc64
$pkgname-system-ppcemb:system_ppcemb
$pkgname-system-s390x:system_s390x
$pkgname-system-sh4:system_sh4
$pkgname-system-sh4eb:system_sh4eb
$pkgname-system-sparc:system_sparc
$pkgname-system-sparc64:system_sparc64
$pkgname-system-unicore32:system_unicore32
$pkgname-system-x86_64:system_x86_64
$pkgname-system-xtensa:system_xtensa
$pkgname-system-xtensaeb:system_xtensaeb
$pkgname-unicore32:unicore32
$pkgname-x86_64:x86_64

$pkgname-lang
$pkgname-img
$pkgname-guest-agent:guest
"
source="http://wiki.qemu-project.org/download/qemu-$pkgver.tar.bz2
	0001-elfload-load-PIE-executables-to-right-address.patch
	qemu-170-ffsl.patch
	qemu-170-ffsll.patch
	qemu-170-openpty.patch
	qemu-170-sigset_t.patch
	uclibc-xattr-create.patch

	qemu-guest-agent.confd
	qemu-guest-agent.initd
	80-kvm.rules"

prepare() {
	cd "$srcdir"/$pkgname-$pkgver
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	# avoid fdt till an updated release appears
	sed -i -e 's:fdt="yes":fdt="no":' configure
	# prevent docs to get automatically installed
	sed -i '/$(DESTDIR)$(docdir)/d' Makefile
	# Alter target makefiles to accept CFLAGS
	sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
		Makefile Makefile.target tests/Makefile
	sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \
		Makefile.target
}

build() {
	cd "$srcdir"/$pkgname-$pkgver
	if [ "x$CLIBC" = "xmusl" ]; then
		CFLAGS="$CFLAGS -D_GNU_SOURCE -Dflock64=flock"
		CFLAGS="$CFLAGS -DF_EXLCK=4 -DF_SHLCK=8"
		CFLAGS="$CFLAGS -D__SIGRTMIN=32 -D__SIGRTMAX=\(NSIG-1\)"
	else
		CFLAGS="$CFLAGS -DHAVE_FFSLL -DHAVE_FFSL"
	fi
	./configure \
		--prefix=/usr \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--audio-drv-list=oss,alsa,sdl \
		--enable-vde \
		--enable-spice \
		--enable-virtfs \
		--enable-curl \
		--enable-cap-ng \
		--enable-linux-aio \
		--enable-usb-redir \
		--enable-guest-agent \
		--enable-uuid \
		--enable-sdl \
		--enable-gtk \
		--disable-bsd-user \
		--enable-linux-user \
		--disable-werror \
		--cc="${CC:-gcc}" \
		|| return 1

	make ARFLAGS="rc" || return 1
# tests fails on x86
# http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg01429.html
# http://web.archiveorange.com/archive/v/21oVv8wOfpQGkyy8EK0N	
#	make check || return 1
}

package() {
	cd "$srcdir"/$pkgname-$pkgver
	make DESTDIR="$pkgdir" install || return 1
	install -Dm644 "$srcdir"/80-kvm.rules \
		"$pkgdir"/lib/udev/rules.d/80-kvm.rules || return 1
	paxctl -c -m "$pkgdir"/usr/bin/qemu-system-* || return 1
}

_subsys() {
	pkgdesc="Qemu ${1/-/ } emulator"
	depends="qemu"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/qemu-$1 "$subpkgdir"/usr/bin/ || return 1
}

alpha() { _subsys alpha; }
arm() { _subsys arm; }
armeb() { _subsys armeb; }
cris() { _subsys cris; }
i386() { _subsys i386; }
m68k() { _subsys m68k; }
microblaze() { _subsys microblaze; }
microblazeel() { _subsys microblazeel; }
mips() { _subsys mips; }
mips64() { _subsys mips64; }
mips64el() { _subsys mips64el; }
mipsel() { _subsys mipsel; }
mipsn32() { _subsys mipsn32; }
mipsn32el() { _subsys mipsn32el; }
or32() { _subsys or32; }
ppc() { _subsys ppc; }
ppc64() { _subsys ppc64; }
ppc64abi32() { _subsys ppc64abi32; }
s390x() { _subsys s390x; }
sh4() { _subsys sh4; }
sh4eb() { _subsys sh4eb; }
sparc() { _subsys sparc; }
sparc32plus() { _subsys sparc32plus; }
sparc64() { _subsys sparc64; }
system_alpha() { _subsys system-alpha; }
system_arm() { _subsys system-arm; }
system_cris() { _subsys system-cris; }
system_i386() { _subsys system-i386; }
system_lm32() { _subsys system-lm32; }
system_m68k() { _subsys system-m68k; }
system_microblaze() { _subsys system-microblaze; }
system_microblazeel() { _subsys system-microblazeel; }
system_mips() { _subsys system-mips; }
system_mips64() { _subsys system-mips64; }
system_mips64el() { _subsys system-mips64el; }
system_mipsel() { _subsys system-mipsel; }
system_moxie() { _subsys system-moxie; }
system_or32() { _subsys system-or32; }
system_ppc() { _subsys system-ppc; }
system_ppc64() { _subsys system-ppc64; }
system_ppcemb() { _subsys system-ppcemb; }
system_s390x() { _subsys system-s390x; }
system_sh4() { _subsys system-sh4; }
system_sh4eb() { _subsys system-sh4eb; }
system_sparc() { _subsys system-sparc; }
system_sparc64() { _subsys system-sparc64; }
system_unicore32() { _subsys system-unicore32; }
system_x86_64() { _subsys system-x86_64; }
system_xtensa() { _subsys system-xtensa; }
system_xtensaeb() { _subsys system-xtensaeb; }
unicore32() { _subsys unicore32; }
x86_64() { _subsys x86_64; }

img() {
	pkgdesc="QEMU command line tool for manipulating disk images"
	replaces="qemu"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/qemu-img \
		"$pkgdir"/usr/bin/qemu-io \
		"$subpkgdir"/usr/bin/

	# we exploit the fact that -img subpackage are created last
	# and check that we done have new systems that belongs in
	# subpackage
	local _bins= _ret=0
	for i in "$pkgdir"/usr/bin/qemu-system-*; do
		if [ -r "$i" ]; then
			error "Please create a subpackage for ${i##*/}"
			_ret=1
		fi
	done
	return $_ret
}

guest() {
	pkgdesc="QEMU guest agent"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/qemu-ga "$subpkgdir"/usr/bin/
	install -Dm755 "$srcdir"/qemu-guest-agent.initd \
		"$subpkgdir"/etc/init.d/qemu-guest-agent || return 1
	install -Dm644 "$srcdir"/qemu-guest-agent.confd \
		"$subpkgdir"/etc/conf.d/qemu-guest-agent || return 1
}

md5sums="9541063d999cf9659ed7fdce71314f31  qemu-1.7.1.tar.bz2
672727bb1d8c8ab7b5def65dd1793c33  0001-elfload-load-PIE-executables-to-right-address.patch
a51a526312535019de143f2e6a54e3ce  qemu-170-ffsl.patch
78f4d1b13ddee47887b6d59378e8e44e  qemu-170-ffsll.patch
6589d3ba6975d245feefa0ad436eed76  qemu-170-openpty.patch
f5e8ee9c5cd1ebc37194f3c151f420a8  qemu-170-sigset_t.patch
1d317f1b54eb88391e28a62eabb97660  uclibc-xattr-create.patch
1663bc6977f6886a58394155b1bf3676  qemu-guest-agent.confd
2035cd781ea810e94bda250c609d8d90  qemu-guest-agent.initd
66660f143235201249dc0648b39b86ee  80-kvm.rules"
sha256sums="d68942a004222eebae5d156ceefb308fabd98edb282d1dde49ec810bbf01bef4  qemu-1.7.1.tar.bz2
af35304b165622a53f7557b59ffd8da5030f5fd444e669c862f9410131f3b987  0001-elfload-load-PIE-executables-to-right-address.patch
63adefe8f34a6859e5f7a1e2de49538267c93955231ef0c4c2bfd6de919711e0  qemu-170-ffsl.patch
373ca5c783913645c6fc6c4c3b7740b0cc011aeed30bc8b848d5b26cf5d81070  qemu-170-ffsll.patch
6cffdccc3e270e7ab65701cc4e68692b577540f02763b14c66bf2225edb20f8b  qemu-170-openpty.patch
fbc907e09c04110992a75bd4cc2f74fbc33e5b4a1cf0ebaa51c2a1dc4512ce5c  qemu-170-sigset_t.patch
fa8e174c57c58483f2798b249c4aad967a705498936be0d87c2944174c0b645e  uclibc-xattr-create.patch
d84e53a94584f37f3bd1b21f44077b5de0d07094c6729f26ae20ab1f7b9cc298  qemu-guest-agent.confd
982fa8ba67c728405305e4cf5a36a41a780b3d1f388ebd6377e7964c271a1c92  qemu-guest-agent.initd
37f666f1cdb7d8a62171de69b531681dcb0fba74236729dac8b6c019232eba84  80-kvm.rules"
sha512sums="deaa209d85b10465a69a0ffffefe1987723bb242cef64d7344adfed5de08e48f53f6096e83821a9d1221df392e3a43b44b666a86aa4fa26d3d95ba631676947b  qemu-1.7.1.tar.bz2
405008589cad1c8b609eca004d520bf944366e8525f85a19fc6e283c95b84b6c2429822ba064675823ab69f1406a57377266a65021623d1cd581e7db000134fd  0001-elfload-load-PIE-executables-to-right-address.patch
13ac2ba2835764ad97d55dc62313a4626a4e4e12a5f932d26b8579101bd875411faf9ffd5642c94e7b8da7d41b5ca48507c3a08ce4d087b8306110e23206877e  qemu-170-ffsl.patch
80168f5eadb518dbae8277cc2ff78cc494783e2180dfbf78d7b5c068c3efecd0bbb3d61dfb0079e365c632c1a80b82d6955de9718ff0b8e8613a52407bd5a2af  qemu-170-ffsll.patch
b2cbb121c8ac85ee0aff835ecff59e2b4e886ddb9c5084286eaf735b5a3868043dad36e5e2289b6e6505bca4cfe971c9a35109a3638357d4b5b10168f921c984  qemu-170-openpty.patch
d867db00b0ac83c8dabd45c9ef0f07559f1f2045f3a4b7fd507a1ee276325e693f772b22511e2d5e1fce866de0ef4cd9da057119cfc39b905471a8995b36619e  qemu-170-sigset_t.patch
2e2ef2d5eb313f5bc89c11622278dfc67075a0eca8492e866cd8d9d4cf1171304c23822ed581b89ad36f951787cca858cb640cc8d7f3246f5f29861fc316c4e0  uclibc-xattr-create.patch
d90c034cae3f9097466854ed1a9f32ab4b02089fcdf7320e8f4da13b2b1ff65067233f48809911485e4431d7ec1a22448b934121bc9522a2dc489009e87e2b1f  qemu-guest-agent.confd
761b4e2397569dae45ae3bb9e46e28746275297f629af9e9065525497fd26a48b65d8abcf4282727afd35309e338967acf6a1b14c3169577bdc16c1f42e618b3  qemu-guest-agent.initd
9b7a89b20fcf737832cb7b4d5dc7d8301dd88169cbe5339eda69fbb51c2e537d8cb9ec7cf37600899e734209e63410d50d0821bce97e401421db39c294d97be2  80-kvm.rules"