1 |
commit: 26de43996e912461ca65825c61c0aa4cd07a14fc |
2 |
Author: Yixun Lan <dlan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 9 03:15:39 2015 +0000 |
4 |
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 9 03:29:16 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26de4399 |
7 |
|
8 |
app-emulation/xen-tools: version bump to 4.6.0 |
9 |
|
10 |
Package-Manager: portage-2.2.22 |
11 |
|
12 |
app-emulation/xen-tools/Manifest | 1 + |
13 |
app-emulation/xen-tools/files/gentoo-patches.conf | 43 +- |
14 |
app-emulation/xen-tools/xen-tools-4.6.0.ebuild | 458 ++++++++++++++++++++++ |
15 |
3 files changed, 465 insertions(+), 37 deletions(-) |
16 |
|
17 |
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest |
18 |
index e42d51c..2970466 100644 |
19 |
--- a/app-emulation/xen-tools/Manifest |
20 |
+++ b/app-emulation/xen-tools/Manifest |
21 |
@@ -5,6 +5,7 @@ DIST xen-4.2.5-upstream-patches-9.tar.xz 23208 SHA256 2206e9a8aeeed207abbae995c5 |
22 |
DIST xen-4.2.5.tar.gz 15671925 SHA256 3cf440866315e8085050eb0586f0447b6b47a08dbed6a72226bf5ed5d89ec567 SHA512 42c0fc241952fc55fc44480fb6752b004b54ae40e946159ec047adf229b65cbfbd810271d01b064ad8fdbddb73c640dcdcb6bc19f91e8968829889c129920dac WHIRLPOOL 762a91c0111892b33e6bd3e7f7714709b04697ad7c2b0919fef6cc9570a343a77fd5a2b82833e75dac9d12d4e41acdcf0743b0d593595910ddd326f5cd721368 |
23 |
DIST xen-4.5.1-upstream-patches-0.tar.xz 18236 SHA256 95910023cb99f11b4df6d57d82000bbd67714d4ed0700e152619c5b82c1bc6e5 SHA512 531e5bbe6b9920a58361f11bb1bb6df65ebaf01e3af13f9aca018e8512727d950009257dfc9b3d0b0f847968da499cf9423716de8a04869cec6f92f5274462e2 WHIRLPOOL 3e6dda862d1bbe736b85422117148c3db91a308a58eb1476e27bbb7355ea7793269cdfc489697c9e5eea5f0ac5319df5c88f2707b10c9a96b8142927a4169819 |
24 |
DIST xen-4.5.1.tar.gz 18410400 SHA256 668c11d4fca67ac44329e369f810356eacd37b28d28fb96e66aac77f3c5e1371 SHA512 9436243e26bc64bc836a179abdc3a6b1b6fa9d3f2170453092c18be71fa62e18cd4465a9154c0f28a7ac8d69d08361ba1defef240a51197f058c012c3855ba04 WHIRLPOOL 71d8559f86683dd9fb3eb09d3f602de227f281fbd3c8cc258bfdb67c425d9e7c4d21cb0284c123e4263262c1b821fea6d28109861ce60d627f6426d352808d99 |
25 |
+DIST xen-4.6.0.tar.gz 19694350 SHA256 6fa1c2431df55aa5950d248e6093b8c8c0f11c357a0adbd348a2186478e80909 SHA512 b4b02f306ffea360f539dd8c231b2f58c00c3638fdb665cb659c7291b475b40f1075bc59d49a6144767729e57b8bc40a1cfd9030d61de2b8fa4ac97d43655c2b WHIRLPOOL d3f01183440ca1875b6e850bd116db0c382383433e50c0902d3268e9e36b39d184fc65e925bdb5363ef4ca7a232fee15b4749c89baf789137b8a8248565c75a8 |
26 |
DIST xen-gentoo-patches-1.tar.xz 23044 SHA256 dcff35bbc4b6946473c9b55ad595a5fea88e8dac1bd977cbe18a644b2cced2e0 SHA512 a4c66382d44112e7be09711e3ecf0f8ebd9a30b29e04d8aca536430172bdd111ab8bab7700433e0dc35165f876eb7e9cd2e554d74ce2a166fb2dfd4de482cb7a WHIRLPOOL d0443e1501ac813ac3226df32a6b050c03302c3d74e3b3bd1293ab4ad929b5c314cc0eac13505ce8a826ee357117e8eeaf0713fd8b9c55f40296966fda082c2e |
27 |
DIST xen-gentoo-patches-4.tar.xz 23632 SHA256 5cdb0f93ee32d0a5fc4fc7282270ace73acfdc4df694f7b29c1135180d902049 SHA512 3006ce4cd67e80a9f79d9ba3814a64704b0d762159a439a140b1ec0a2699473cd5537950f0913b55f8f7e3d0fd2e9861f3199793120d8d2502aa3f8ef7816c8f WHIRLPOOL 4a921103df2825ccd8b0481708e7cd692fa45d5aadae286c1522c144a1576920e7d3567648565bb9af85bb6bb597ea9d0ec04ea6abd2115db4caf7e739717b1a |
28 |
DIST xen-ovmf-patches-1.tar.xz 4724 SHA256 d14e98e62c78c9f4b8a7e7b4a04de6dabf300f393eff44154d06f93aa43d7703 SHA512 a17467762f6d92018ff9bce783ce148039f23159405e801ec2aef4c3db72c3976c6f1e41d8c2a2cb704a9654556a2050302f284cfe8e32f28f393b8e2c6d2f1c WHIRLPOOL de53ad07f20aa14fe76d974db92d5b6808f0a2dd26a627b818914990add7adad8e6135d42641819dc22947031981c5815bae5aeeed0f28785c90beda0a6ff6c8 |
29 |
|
30 |
diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf |
31 |
index 696ff18..e21b516 100644 |
32 |
--- a/app-emulation/xen-tools/files/gentoo-patches.conf |
33 |
+++ b/app-emulation/xen-tools/files/gentoo-patches.conf |
34 |
@@ -87,49 +87,18 @@ ${_gx011} ${_gx012} ${_gx013} ${_gx014} ${_gx015} |
35 |
${_gx016} ${_gx017} ${_gx018} ${_gx019} |
36 |
" |
37 |
|
38 |
-# xen-tools-4.4.1 patches set |
39 |
-_gpv_xen_tools_441_2=" |
40 |
-${_gx007} ${_gx008} ${_gx009} |
41 |
-${_gx024} ${_gx021} ${_gx014} |
42 |
-${_gx022} ${_gx017} ${_gx025} |
43 |
-${_gx026} ${_gx027} ${_gx019} |
44 |
-${_gx028} ${_gx029} |
45 |
-" |
46 |
- |
47 |
-# xen-tools-4.4.2 patches set |
48 |
-_gpv_xen_tools_442_0=" |
49 |
-${_gx007} ${_gx008} ${_gx009} |
50 |
-${_gx024} ${_gx021} ${_gx014} |
51 |
-${_gx022} ${_gx017} ${_gx025} |
52 |
-${_gx026} ${_gx027} ${_gx019} |
53 |
-${_gx028} ${_gx029} |
54 |
-" |
55 |
-_gpv_xen_tools_442_1=" |
56 |
-${_gx007} ${_gx008} ${_gx009} |
57 |
-${_gx024} ${_gx021} ${_gx014} |
58 |
-${_gx022} ${_gx017} ${_gx025} |
59 |
-${_gx026} ${_gx027} ${_gx019} |
60 |
-${_gx028} ${_gx029} ${_gx033} |
61 |
-" |
62 |
- |
63 |
-# xen-tools-4.5.0 patches set |
64 |
-_gpv_xen_tools_450_0=" |
65 |
-${_gx008} ${_gx024} ${_gx021} |
66 |
-${_gx022} ${_gx017} ${_gx031} |
67 |
-${_gx027} ${_gx032} |
68 |
-${_gx028} ${_gx029} |
69 |
-" |
70 |
-_gpv_xen_tools_450_1=" |
71 |
+# xen-tools-4.5.1 patches set |
72 |
+_gpv_xen_tools_451_0=" |
73 |
${_gx008} ${_gx024} ${_gx021} |
74 |
${_gx022} ${_gx017} ${_gx031} |
75 |
${_gx027} ${_gx032} |
76 |
${_gx028} ${_gx029} ${_gx034} |
77 |
" |
78 |
|
79 |
-# xen-tools-4.5.1 patches set |
80 |
-_gpv_xen_tools_451_0=" |
81 |
-${_gx008} ${_gx024} ${_gx021} |
82 |
+# xen-tools-4.6.0 patches set |
83 |
+_gpv_xen_tools_460_0=" |
84 |
+${_gx008} ${_gx021} |
85 |
${_gx022} ${_gx017} ${_gx031} |
86 |
${_gx027} ${_gx032} |
87 |
-${_gx028} ${_gx029} ${_gx034} |
88 |
+${_gx028} ${_gx029} |
89 |
" |
90 |
|
91 |
diff --git a/app-emulation/xen-tools/xen-tools-4.6.0.ebuild b/app-emulation/xen-tools/xen-tools-4.6.0.ebuild |
92 |
new file mode 100644 |
93 |
index 0000000..f4f221e |
94 |
--- /dev/null |
95 |
+++ b/app-emulation/xen-tools/xen-tools-4.6.0.ebuild |
96 |
@@ -0,0 +1,458 @@ |
97 |
+# Copyright 1999-2015 Gentoo Foundation |
98 |
+# Distributed under the terms of the GNU General Public License v2 |
99 |
+# $Id$ |
100 |
+ |
101 |
+EAPI=5 |
102 |
+ |
103 |
+MY_PV=${PV/_/-} |
104 |
+ |
105 |
+PYTHON_COMPAT=( python2_7 ) |
106 |
+PYTHON_REQ_USE='xml,threads' |
107 |
+ |
108 |
+if [[ $PV == *9999 ]]; then |
109 |
+ KEYWORDS="" |
110 |
+ REPO="xen-unstable.hg" |
111 |
+ EHG_REPO_URI="http://xenbits.xensource.com/${REPO}" |
112 |
+ S="${WORKDIR}/${REPO}" |
113 |
+ live_eclass="mercurial" |
114 |
+else |
115 |
+ KEYWORDS="~amd64 ~arm ~arm64 -x86" |
116 |
+ UPSTREAM_VER= |
117 |
+ SECURITY_VER= |
118 |
+ # xen-tools's gentoo patches tarball |
119 |
+ GENTOO_VER=4 |
120 |
+ # xen-tools's gentoo patches version which apply to this specific ebuild |
121 |
+ GENTOO_GPV=0 |
122 |
+ # xen-tools ovmf's patches |
123 |
+ OVMF_VER=1 |
124 |
+ |
125 |
+ SEABIOS_VER=1.7.5 |
126 |
+ OVMF_PV=20150629 |
127 |
+ |
128 |
+ [[ -n ${UPSTREAM_VER} ]] && \ |
129 |
+ UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz" |
130 |
+ [[ -n ${SECURITY_VER} ]] && \ |
131 |
+ SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz" |
132 |
+ [[ -n ${GENTOO_VER} ]] && \ |
133 |
+ GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz" |
134 |
+ [[ -n ${OVMF_VER} ]] && \ |
135 |
+ OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz" |
136 |
+ |
137 |
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz |
138 |
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz |
139 |
+ https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz |
140 |
+ ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2 |
141 |
+ ${OVMF_PATCHSET_URI} ) |
142 |
+ ${UPSTREAM_PATCHSET_URI} |
143 |
+ ${SECURITY_PATCHSET_URI} |
144 |
+ ${GENTOO_PATCHSET_URI}" |
145 |
+ S="${WORKDIR}/xen-${MY_PV}" |
146 |
+fi |
147 |
+ |
148 |
+inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass} |
149 |
+ |
150 |
+DESCRIPTION="Xend daemon and tools" |
151 |
+HOMEPAGE="http://xen.org/" |
152 |
+DOCS=( README docs/README.xen-bugtool ) |
153 |
+ |
154 |
+LICENSE="GPL-2" |
155 |
+SLOT="0" |
156 |
+# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make |
157 |
+# >=dev-lang/ocaml-4 stable |
158 |
+# Masked in profiles/eapi-5-files instead |
159 |
+IUSE="api custom-cflags debug doc flask hvm qemu ocaml ovmf +pam python pygrub screen static-libs system-qemu system-seabios" |
160 |
+ |
161 |
+REQUIRED_USE="hvm? ( || ( qemu system-qemu ) ) |
162 |
+ ${PYTHON_REQUIRED_USE} |
163 |
+ pygrub? ( python ) |
164 |
+ ovmf? ( hvm ) |
165 |
+ qemu? ( !system-qemu )" |
166 |
+ |
167 |
+COMMON_DEPEND=" |
168 |
+ dev-libs/lzo:2 |
169 |
+ dev-libs/glib:2 |
170 |
+ dev-libs/yajl |
171 |
+ dev-libs/libaio |
172 |
+ dev-libs/libgcrypt:0 |
173 |
+ sys-libs/zlib |
174 |
+" |
175 |
+ |
176 |
+DEPEND="${COMMON_DEPEND} |
177 |
+ dev-python/lxml[${PYTHON_USEDEP}] |
178 |
+ pam? ( dev-python/pypam[${PYTHON_USEDEP}] ) |
179 |
+ hvm? ( media-libs/libsdl ) |
180 |
+ ${PYTHON_DEPS} |
181 |
+ api? ( dev-libs/libxml2 |
182 |
+ net-misc/curl ) |
183 |
+ pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} ) |
184 |
+ ovmf? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/sqlite} ) |
185 |
+ !amd64? ( >=sys-apps/dtc-1.4.0 ) |
186 |
+ amd64? ( sys-devel/bin86 |
187 |
+ system-seabios? ( sys-firmware/seabios ) |
188 |
+ sys-firmware/ipxe |
189 |
+ sys-devel/dev86 |
190 |
+ sys-power/iasl ) |
191 |
+ dev-lang/perl |
192 |
+ app-misc/pax-utils |
193 |
+ dev-python/markdown[${PYTHON_USEDEP}] |
194 |
+ doc? ( |
195 |
+ app-doc/doxygen |
196 |
+ dev-tex/latex2html[png,gif] |
197 |
+ media-gfx/graphviz |
198 |
+ dev-tex/xcolor |
199 |
+ media-gfx/transfig |
200 |
+ dev-texlive/texlive-latexextra |
201 |
+ virtual/latex-base |
202 |
+ dev-tex/latexmk |
203 |
+ dev-texlive/texlive-latex |
204 |
+ dev-texlive/texlive-pictures |
205 |
+ dev-texlive/texlive-latexrecommended |
206 |
+ ) |
207 |
+ hvm? ( x11-proto/xproto |
208 |
+ !net-libs/libiscsi ) |
209 |
+ qemu? ( x11-libs/pixman ) |
210 |
+ system-qemu? ( app-emulation/qemu[xen] ) |
211 |
+ ocaml? ( dev-ml/findlib |
212 |
+ >=dev-lang/ocaml-4 )" |
213 |
+ |
214 |
+RDEPEND="${COMMON_DEPEND} |
215 |
+ sys-apps/iproute2 |
216 |
+ net-misc/bridge-utils |
217 |
+ screen? ( |
218 |
+ app-misc/screen |
219 |
+ app-admin/logrotate |
220 |
+ ) |
221 |
+ virtual/udev" |
222 |
+ |
223 |
+# hvmloader is used to bootstrap a fully virtualized kernel |
224 |
+# Approved by QA team in bug #144032 |
225 |
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader |
226 |
+ usr/share/qemu-xen/qemu/s390-ccw.img" |
227 |
+ |
228 |
+RESTRICT="test" |
229 |
+ |
230 |
+pkg_setup() { |
231 |
+ python-single-r1_pkg_setup |
232 |
+ export "CONFIG_LOMOUNT=y" |
233 |
+ |
234 |
+ #bug 522642, disable compile tools/tests |
235 |
+ export "CONFIG_TESTS=n" |
236 |
+ |
237 |
+ if has_version dev-libs/libgcrypt:0; then |
238 |
+ export "CONFIG_GCRYPT=y" |
239 |
+ fi |
240 |
+ |
241 |
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then |
242 |
+ if use x86 && use amd64; then |
243 |
+ die "Confusion! Both x86 and amd64 are set in your use flags!" |
244 |
+ elif use x86; then |
245 |
+ export XEN_TARGET_ARCH="x86_32" |
246 |
+ elif use amd64 ; then |
247 |
+ export XEN_TARGET_ARCH="x86_64" |
248 |
+ elif use arm; then |
249 |
+ export XEN_TARGET_ARCH="arm32" |
250 |
+ elif use arm64; then |
251 |
+ export XEN_TARGET_ARCH="arm64" |
252 |
+ else |
253 |
+ die "Unsupported architecture!" |
254 |
+ fi |
255 |
+ fi |
256 |
+} |
257 |
+ |
258 |
+src_prepare() { |
259 |
+ # Upstream's patchset |
260 |
+ if [[ -n ${UPSTREAM_VER} ]]; then |
261 |
+ einfo "Try to apply Xen Upstream patcheset" |
262 |
+ EPATCH_SUFFIX="patch" \ |
263 |
+ EPATCH_FORCE="yes" \ |
264 |
+ EPATCH_OPTS="-p1" \ |
265 |
+ epatch "${WORKDIR}"/patches-upstream |
266 |
+ fi |
267 |
+ |
268 |
+ # Security patchset |
269 |
+ if [[ -n ${SECURITY_VER} ]]; then |
270 |
+ einfo "Try to apply Xen Security patcheset" |
271 |
+ source "${WORKDIR}"/patches-security/${PV}.conf |
272 |
+ # apply main xen patches |
273 |
+ for i in ${XEN_SECURITY_MAIN}; do |
274 |
+ EPATCH_SUFFIX="patch" \ |
275 |
+ EPATCH_FORCE="yes" \ |
276 |
+ epatch "${WORKDIR}"/patches-security/xen/$i |
277 |
+ done |
278 |
+ |
279 |
+ # apply qemu-traditional patches |
280 |
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null |
281 |
+ for i in ${XEN_SECURITY_QEMUT}; do |
282 |
+ EPATCH_SUFFIX="patch" \ |
283 |
+ EPATCH_FORCE="yes" \ |
284 |
+ epatch "${WORKDIR}"/patches-security/qemut/$i |
285 |
+ done |
286 |
+ popd > /dev/null |
287 |
+ |
288 |
+ # apply qemu-xen/upstream patches |
289 |
+ pushd "${S}"/tools/qemu-xen/ > /dev/null |
290 |
+ for i in ${XEN_SECURITY_QEMUU}; do |
291 |
+ EPATCH_SUFFIX="patch" \ |
292 |
+ EPATCH_FORCE="yes" \ |
293 |
+ epatch "${WORKDIR}"/patches-security/qemuu/$i |
294 |
+ done |
295 |
+ popd > /dev/null |
296 |
+ fi |
297 |
+ |
298 |
+ # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err |
299 |
+ mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die |
300 |
+ pushd tools/firmware/ > /dev/null |
301 |
+ ln -s seabios-dir-remote seabios-dir || die |
302 |
+ popd > /dev/null |
303 |
+ |
304 |
+ # Gentoo's patchset |
305 |
+ if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then |
306 |
+ einfo "Try to apply Gentoo specific patcheset" |
307 |
+ source "${FILESDIR}"/gentoo-patches.conf |
308 |
+ _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV} |
309 |
+ for i in ${!_gpv}; do |
310 |
+ EPATCH_SUFFIX="patch" \ |
311 |
+ EPATCH_FORCE="yes" \ |
312 |
+ epatch "${WORKDIR}"/patches-gentoo/$i |
313 |
+ done |
314 |
+ fi |
315 |
+ |
316 |
+ # Ovmf's patchset |
317 |
+ if [[ -n ${OVMF_VER} ]] && use ovmf; then |
318 |
+ einfo "Try to apply Ovmf patcheset" |
319 |
+ pushd "${WORKDIR}"/ovmf-*/ > /dev/null |
320 |
+ EPATCH_SUFFIX="patch" \ |
321 |
+ EPATCH_FORCE="yes" \ |
322 |
+ EPATCH_OPTS="-p1" \ |
323 |
+ epatch "${WORKDIR}"/patches-ovmf |
324 |
+ popd > /dev/null |
325 |
+ mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die |
326 |
+ fi |
327 |
+ |
328 |
+ mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die |
329 |
+ |
330 |
+ # Fix texi2html build error with new texi2html, qemu.doc.html |
331 |
+ sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die |
332 |
+ |
333 |
+ use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die |
334 |
+ sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \ |
335 |
+ -i tools/firmware/Makefile || die |
336 |
+ |
337 |
+ # Drop .config, fixes to gcc-4.6 |
338 |
+ sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop" |
339 |
+ |
340 |
+ # if the user *really* wants to use their own custom-cflags, let them |
341 |
+ if use custom-cflags; then |
342 |
+ einfo "User wants their own CFLAGS - removing defaults" |
343 |
+ |
344 |
+ # try and remove all the default cflags |
345 |
+ find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \ |
346 |
+ -exec sed \ |
347 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \ |
348 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \ |
349 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \ |
350 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \ |
351 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ |
352 |
+ -i {} + || die "failed to re-set custom-cflags" |
353 |
+ fi |
354 |
+ |
355 |
+ if ! use pygrub; then |
356 |
+ sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die |
357 |
+ fi |
358 |
+ |
359 |
+ if ! use python; then |
360 |
+ sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die |
361 |
+ fi |
362 |
+ |
363 |
+ if ! use hvm; then |
364 |
+ sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die |
365 |
+ # Bug 351648 |
366 |
+ elif ! use x86 && ! has x86 $(get_all_abis); then |
367 |
+ mkdir -p "${WORKDIR}"/extra-headers/gnu || die |
368 |
+ touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die |
369 |
+ export CPATH="${WORKDIR}"/extra-headers |
370 |
+ fi |
371 |
+ |
372 |
+ # Don't bother with qemu, only needed for fully virtualised guests |
373 |
+ if ! use qemu; then |
374 |
+ sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die |
375 |
+ fi |
376 |
+ |
377 |
+ # Reset bash completion dir; Bug 472438 |
378 |
+ sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \ |
379 |
+ -i Config.mk || die |
380 |
+ sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die |
381 |
+ |
382 |
+ # xencommons, Bug #492332, sed lighter weight than patching |
383 |
+ sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \ |
384 |
+ -i tools/hotplug/Linux/init.d/xencommons.in || die |
385 |
+ |
386 |
+ # respect multilib, usr/lib/libcacard.so.0.0.0 |
387 |
+ sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \ |
388 |
+ -i tools/qemu-xen/configure || die |
389 |
+ |
390 |
+ #bug 518136, don't build 32bit exactuable for nomultilib profile |
391 |
+ if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then |
392 |
+ sed -i -e "/x86_emulator/d" tools/tests/Makefile || die |
393 |
+ fi |
394 |
+ |
395 |
+ # use /var instead of /var/lib, consistat with previous ebuild |
396 |
+ sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \ |
397 |
+ m4/paths.m4 configure tools/configure || die |
398 |
+ # use /run instead of /var/run |
399 |
+ sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \ |
400 |
+ m4/paths.m4 configure tools/configure || die |
401 |
+ |
402 |
+ # uncomment lines in xl.conf |
403 |
+ sed -e 's:^#autoballoon=:autoballoon=:' \ |
404 |
+ -e 's:^#lockfile=:lockfile=:' \ |
405 |
+ -e 's:^#vif.default.script=:vif.default.script=:' \ |
406 |
+ -i tools/examples/xl.conf || die |
407 |
+ |
408 |
+ epatch_user |
409 |
+} |
410 |
+ |
411 |
+src_configure() { |
412 |
+ local myconf="--prefix=${PREFIX}/usr \ |
413 |
+ --libdir=${PREFIX}/usr/$(get_libdir) \ |
414 |
+ --libexecdir=${PREFIX}/usr/libexec \ |
415 |
+ --disable-werror \ |
416 |
+ --disable-xen \ |
417 |
+ --enable-tools \ |
418 |
+ --enable-docs \ |
419 |
+ $(use_with system-qemu) \ |
420 |
+ $(use_enable pam) \ |
421 |
+ $(use_enable api xenapi) \ |
422 |
+ $(use_enable ovmf) \ |
423 |
+ $(use_enable ocaml ocamltools) \ |
424 |
+ " |
425 |
+ use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin" |
426 |
+ use qemu || myconf+=" --with-system-qemu" |
427 |
+ use amd64 && myconf+=" --enable-qemu-traditional" |
428 |
+ econf ${myconf} |
429 |
+} |
430 |
+ |
431 |
+src_compile() { |
432 |
+ export VARTEXFONTS="${T}/fonts" |
433 |
+ local myopt |
434 |
+ use debug && myopt="${myopt} debug=y" |
435 |
+ |
436 |
+ use custom-cflags || unset CFLAGS |
437 |
+ if test-flag-CC -fno-strict-overflow; then |
438 |
+ append-flags -fno-strict-overflow |
439 |
+ fi |
440 |
+ |
441 |
+ unset LDFLAGS |
442 |
+ unset CFLAGS |
443 |
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt} |
444 |
+ |
445 |
+ use doc && emake -C docs txt html |
446 |
+ emake -C docs man-pages |
447 |
+} |
448 |
+ |
449 |
+src_install() { |
450 |
+ # Override auto-detection in the build system, bug #382573 |
451 |
+ export INITD_DIR=/tmp/init.d |
452 |
+ export CONFIG_LEAF_DIR=../tmp/default |
453 |
+ |
454 |
+ # Let the build system compile installed Python modules. |
455 |
+ local PYTHONDONTWRITEBYTECODE |
456 |
+ export PYTHONDONTWRITEBYTECODE |
457 |
+ |
458 |
+ emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \ |
459 |
+ XEN_PYTHON_NATIVE_INSTALL=y install-tools |
460 |
+ |
461 |
+ # Fix the remaining Python shebangs. |
462 |
+ python_fix_shebang "${D}" |
463 |
+ |
464 |
+ # Remove RedHat-specific stuff |
465 |
+ rm -rf "${D}"tmp || die |
466 |
+ |
467 |
+ if use doc; then |
468 |
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs |
469 |
+ |
470 |
+ dohtml -r docs/ |
471 |
+ docinto pdf |
472 |
+ dodoc ${DOCS[@]} |
473 |
+ [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html |
474 |
+ fi |
475 |
+ |
476 |
+ rm -rf "${D}"/usr/share/doc/xen/ |
477 |
+ doman docs/man?/* |
478 |
+ |
479 |
+ newconfd "${FILESDIR}"/xendomains.confd xendomains |
480 |
+ newconfd "${FILESDIR}"/xenstored.confd xenstored |
481 |
+ newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled |
482 |
+ newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains |
483 |
+ newinitd "${FILESDIR}"/xenstored.initd xenstored |
484 |
+ newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled |
485 |
+ newinitd "${FILESDIR}"/xencommons.initd xencommons |
486 |
+ newconfd "${FILESDIR}"/xencommons.confd xencommons |
487 |
+ newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev |
488 |
+ newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev |
489 |
+ |
490 |
+ if use screen; then |
491 |
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die |
492 |
+ cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die |
493 |
+ keepdir /var/log/xen-consoles |
494 |
+ fi |
495 |
+ |
496 |
+ # For -static-libs wrt Bug 384355 |
497 |
+ if ! use static-libs; then |
498 |
+ rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a |
499 |
+ fi |
500 |
+ |
501 |
+ # for xendomains |
502 |
+ keepdir /etc/xen/auto |
503 |
+ |
504 |
+ # Temp QA workaround |
505 |
+ dodir "$(get_udevdir)" |
506 |
+ mv "${D}"/etc/udev/* "${D}/$(get_udevdir)" |
507 |
+ rm -rf "${D}"/etc/udev |
508 |
+ |
509 |
+ # Remove files failing QA AFTER emake installs them, avoiding seeking absent files |
510 |
+ find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \ |
511 |
+ -o -name openbios-ppc -o -name palcode-clipper \) -delete || die |
512 |
+} |
513 |
+ |
514 |
+pkg_postinst() { |
515 |
+ elog "Official Xen Guide and the offical wiki page:" |
516 |
+ elog "https://wiki.gentoo.org/wiki/Xen" |
517 |
+ elog "http://wiki.xen.org/wiki/Main_Page" |
518 |
+ elog "" |
519 |
+ elog "Recommended to utilise the xencommons script to config sytem At boot" |
520 |
+ elog "Add by use of rc-update on completion of the install" |
521 |
+ |
522 |
+ # TODO: we need to have the current Python slot here. |
523 |
+ if ! has_version "dev-lang/python[ncurses]"; then |
524 |
+ echo |
525 |
+ ewarn "NB: Your dev-lang/python is built without USE=ncurses." |
526 |
+ ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py." |
527 |
+ fi |
528 |
+ |
529 |
+ if has_version "sys-apps/iproute2[minimal]"; then |
530 |
+ echo |
531 |
+ ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking" |
532 |
+ ewarn "will not work until you rebuild iproute2 without USE=minimal." |
533 |
+ fi |
534 |
+ |
535 |
+ if ! use hvm; then |
536 |
+ echo |
537 |
+ elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm" |
538 |
+ elog "support enable the hvm use flag." |
539 |
+ elog "An x86 or amd64 system is required to build HVM support." |
540 |
+ fi |
541 |
+ |
542 |
+ if use qemu; then |
543 |
+ elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source" |
544 |
+ elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently" |
545 |
+ elog "with the qemu capable xen. It is up to the user to distinguish between and utilise" |
546 |
+ elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise" |
547 |
+ fi |
548 |
+ |
549 |
+ if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then |
550 |
+ echo |
551 |
+ elog "xensv is broken upstream (Gentoo bug #142011)." |
552 |
+ elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed." |
553 |
+ fi |
554 |
+} |