summaryrefslogtreecommitdiffstats
path: root/main/xen/APKBUILD
blob: 373d0aae5f3ad91cc722833c1f1824834786f210 (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xen
pkgver=4.1.1
pkgrel=0
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
license="GPL"
depends="coreutils python sed gawk"
makedepends="libgcrypt-dev gnutls-dev pciutils-dev texinfo wget mesa-dev sdl-dev zlib-dev openssl-dev util-linux-ng-dev python-dev gettext-dev ncurses-dev perl"
install=
subpackages="$pkgname-doc"
source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz
	xen-blktap-uclibc.patch
	xen-blktap2-uclibc.patch
	xen-disable-firmware.patch
	xen-dont-use-lib64.patch
	xen-sed-is-broken-hack.patch
	blktap-write.patch
	xen-x86-pic.patch
	xen-gcc-4.6-Werror-fix.patch
	xencommons.initd
	xend.initd
	xendomains.initd"
arch="x86 x86_64"

_builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$_builddir"

	msg "Patching sources..."
	for i in $source; do
		case $i in
		*.patch)
			msg "Applying $i..."
			patch -s -p1 -N -i "$srcdir"/$i || return 1
			;;
		esac
	done
	msg "Sources have been patched successfully."

	# remove all -Werror
	msg "Eradicating -Werror..."
	find -name '*.mk' -o -name 'Make*' | xargs sed -i -e 's/-Werror//g'
}

build() {
	cd "$_builddir"

	# We unset $CFLAGS and $LDFLAGS because Xen's buildsystem does not
	# like these values being set.  Arguably this is a bug but I can't be
	# bothered to track it down.  --nenolod
	unset CFLAGS
	unset LDFLAGS

	# If we provide no parameters it tries to build a kernel image.  We
	# definitely don't want that.
	msg "Running preflight check..."
	(cd tools/check; ./chk build) || return 1

	msg "Building hypervisor..."
	make -j1 xen || return 1

	msg "Building tools..."
	make -j1 tools || return 1

	msg "Building stub domains..."
	make -j1 stubdom || return 1
}

package() {
	cd "$_builddir"

	# We unset $CFLAGS and $LDFLAGS because Xen's buildsystem does not
	# like these values being set.  Arguably this is a bug but I can't be
	# bothered to track it down.  --nenolod
	unset CFLAGS
	unset LDFLAGS

	make -j1 DESTDIR="$pkgdir" install-xen install-tools install-stubdom \
		|| return 1

	install -m755 -D "$srcdir"/xencommons.initd "$pkgdir"/etc/init.d/xencommons
	install -m755 -D "$srcdir"/xend.initd "$pkgdir"/etc/init.d/xend
	install -m755 -D "$srcdir"/xendomains.initd "$pkgdir"/etc/init.d/xendomains
}

md5sums="fab4bf74d73444ff9b43bced2e4fc5a2  xen-4.1.1.tar.gz
edb5c3e7fba8214702fac709f0e53124  xen-blktap-uclibc.patch
1f7f847ae0baa915c7b52d0ed5869fe6  xen-blktap2-uclibc.patch
a569f16a7e3c832ba3fab6154f657244  xen-disable-firmware.patch
20ce621f3a2fc8ae78e74b9b72da775c  xen-dont-use-lib64.patch
0cec6a97de9e4bc178f3e71190495cc3  xen-sed-is-broken-hack.patch
56af00443c8d40944082e26304452a5e  blktap-write.patch
c4fc42b11c5917a93f66acf0f83a8747  xen-x86-pic.patch
faafc199fa8cf33aac44e41c9e1659ea  xen-gcc-4.6-Werror-fix.patch
0b62c1fbe2699a32e745724fd301db5b  xencommons.initd
5ee6a16ec70dfbcd4944ded71b393fa2  xend.initd
a2b5234483f1b5892d22e9315d9c307f  xendomains.initd"