aboutsummaryrefslogtreecommitdiffstats
path: root/main/qemu/APKBUILD
blob: 38b9e57ec7c2f066cd32dba8ab2fddf79e6a8780 (plain)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qemu
pkgver=1.4.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"
depends=
install="qemu.pre-install"
subpackages="
$pkgname-alpha
$pkgname-arm
$pkgname-cris
$pkgname-i386
$pkgname-lm32
$pkgname-m68k
$pkgname-microblaze
$pkgname-microblazeel
$pkgname-mips
$pkgname-mips64
$pkgname-mips64el
$pkgname-mipsel
$pkgname-ppc
$pkgname-ppc64
$pkgname-ppcemb
$pkgname-sh4
$pkgname-s390x
$pkgname-sh4eb
$pkgname-sparc
$pkgname-sparc64
$pkgname-x86_64
$pkgname-xtensa
$pkgname-xtensaeb
$pkgname-or32
$pkgname-unicore32
$pkgname-img
$pkgname-guest-agent:guest
"
source="http://wiki.qemu-project.org/download/qemu-$pkgver.tar.bz2
	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
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--audio-drv-list=oss,alsa,sdl \
		--audio-card-list=ac97,sb16,es1370,adlib,hda \
		--enable-vde \
		--enable-spice \
		--enable-virtfs \
		--enable-curl \
		--enable-cap-ng \
		--enable-linux-aio \
		--enable-usb-redir \
		--enable-guest-agent \
		--enable-uuid \
		--disable-bsd-user \
		--disable-linux-user \
		--disable-werror \
		--cc="${CC:-gcc}" \
		|| return 1

	make || 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 system emulator"
	depends="qemu"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/qemu-system-$1 "$subpkgdir"/usr/bin/
}

alpha() { _subsys alpha; }
arm() { _subsys arm; }
cris() { _subsys cris; }
i386() { _subsys i386; }
lm32() { _subsys lm32; }
m68k() { _subsys m68k; }
microblaze() { _subsys microblaze; }
microblazeel() { _subsys microblazeel; }
mips() { _subsys mips; }
mips64() { _subsys mips64; }
mips64el() { _subsys mips64el; }
mipsel() { _subsys mipsel; }
ppc() { _subsys ppc; }
ppc64() { _subsys ppc64; }
ppcemb() { _subsys ppcemb; }
s390x() { _subsys s390x; }
sh4() { _subsys sh4; }
sh4eb() { _subsys sh4eb; }
sparc() { _subsys sparc; }
sparc64() { _subsys sparc64; }
x86_64() { _subsys x86_64; }
xtensa() { _subsys xtensa; }
xtensaeb() { _subsys xtensaeb; }
or32() { _subsys or32; }
unicore32() { _subsys unicore32; }

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 craeted 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 $_err
}

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="eb2d696956324722b5ecfa46e41f9a75  qemu-1.4.1.tar.bz2
1663bc6977f6886a58394155b1bf3676  qemu-guest-agent.confd
2035cd781ea810e94bda250c609d8d90  qemu-guest-agent.initd
66660f143235201249dc0648b39b86ee  80-kvm.rules"
sha256sums="75063a9326221607de3599e89fb5af80f2d8080ddc55ca253fff113843432df1  qemu-1.4.1.tar.bz2
d84e53a94584f37f3bd1b21f44077b5de0d07094c6729f26ae20ab1f7b9cc298  qemu-guest-agent.confd
982fa8ba67c728405305e4cf5a36a41a780b3d1f388ebd6377e7964c271a1c92  qemu-guest-agent.initd
37f666f1cdb7d8a62171de69b531681dcb0fba74236729dac8b6c019232eba84  80-kvm.rules"
sha512sums="b655d2816b9393ca30bbba2bc8a30076e1c933d593653a1f61b4d5f3aaa9b8eb390fa3aa6f3486f1d066b1e078a3d9e1a280d0e8dac68745b128ddc01ca1b149  qemu-1.4.1.tar.bz2
d90c034cae3f9097466854ed1a9f32ab4b02089fcdf7320e8f4da13b2b1ff65067233f48809911485e4431d7ec1a22448b934121bc9522a2dc489009e87e2b1f  qemu-guest-agent.confd
761b4e2397569dae45ae3bb9e46e28746275297f629af9e9065525497fd26a48b65d8abcf4282727afd35309e338967acf6a1b14c3169577bdc16c1f42e618b3  qemu-guest-agent.initd
9b7a89b20fcf737832cb7b4d5dc7d8301dd88169cbe5339eda69fbb51c2e537d8cb9ec7cf37600899e734209e63410d50d0821bce97e401421db39c294d97be2  80-kvm.rules"