aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/APKBUILD
blob: 4d95a0990950f3dbab06aa018ff3f1cb6b8b0fa6 (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xen
pkgver=4.1.4
pkgrel=6
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
arch="x86 x86_64"
license="GPL"
depends="udev syslinux bash python"
depends_dev="openssl-dev python-dev e2fsprogs-dev gettext zlib-dev ncurses-dev
	libiconv-dev dev86 texinfo perl iasl pciutils-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz
	blktap2_libvhd_add_iconv.patch
	detect_libiconv.patch
	fix_bswap_blktap.patch
	fix_bswap_blktap2.patch
	define_fsimage_dir.patch
	librt.patch
	busybox-sed.patch
	xsa33-4.1.patch
	xsa41.patch
	xsa45-4.1.patch
	xsa52-4.1.patch
	xsa53-4.1.patch
	xsa54.patch
	xsa55-4.1.patch
	xsa56.patch
	xsa57-4.1.patch
	xsa58-4.1.patch

	xencommons.initd
	xend.initd
	xendomains.initd"

_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="f71e0ffd2c31a855c28935f642ae94f8  xen-4.1.4.tar.gz
6d4b045ae56be6288733d0e078f591ea  blktap2_libvhd_add_iconv.patch
ed3283697cb1ddff066f4087eabf68c6  detect_libiconv.patch
503f0883f4a0b50fe4e37e09ed9a6177  fix_bswap_blktap.patch
b973dc1ffcc6872e222b36f3b7b4836b  fix_bswap_blktap2.patch
0bb8a435020a5a49b38b1a447fb69977  define_fsimage_dir.patch
fa06495a175571f4aa3b6cb88937953e  librt.patch
1bea3543ddc712330527b62fd9ff6520  busybox-sed.patch
25ba4efc5eee29daa12855fbadce84f8  xsa33-4.1.patch
ce56f00762139cd611dfc3332b7571cf  xsa41.patch
09c675a4a28ee00dd9abeacc07426edd  xsa45-4.1.patch
db1e5a92547c8c8ed2e1872efed99ab0  xsa52-4.1.patch
e11ae888997d11fcb91b431ebf609d4e  xsa53-4.1.patch
a8393d1ec6b886ea72ffe624a04ee10a  xsa54.patch
391d90e3851df0b42b2971e8b860e19a  xsa55-4.1.patch
e70b9128ffc2175cea314a533a7d8457  xsa56.patch
a065178b8f5ed028b97fa51db97e41e2  xsa57-4.1.patch
dd46795cf7bb7bb9baa50bfdf4813d4f  xsa58-4.1.patch
0b62c1fbe2699a32e745724fd301db5b  xencommons.initd
5ee6a16ec70dfbcd4944ded71b393fa2  xend.initd
a2b5234483f1b5892d22e9315d9c307f  xendomains.initd"