Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen-tools/files/, app-emulation/xen-tools/
Date: Wed, 22 Nov 2017 01:45:38
Message-Id: 1511315116.e4790f714f8ea5c71d728e4925389d17b6b6aa9c.dlan@gentoo
1 commit: e4790f714f8ea5c71d728e4925389d17b6b6aa9c
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Fri Nov 3 21:53:42 2017 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 22 01:45:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4790f71
7
8 app-emulation/xen-tools: bump to 4.9.0
9
10 Gentoo-Bug: 625406 634596
11 Closes: https://github.com/gentoo/gentoo/pull/6114
12
13 Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
14
15 app-emulation/xen-tools/Manifest | 2 +
16 app-emulation/xen-tools/files/gentoo-patches.conf | 9 +
17 app-emulation/xen-tools/xen-tools-4.9.0.ebuild | 462 ++++++++++++++++++++++
18 3 files changed, 473 insertions(+)
19
20 diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
21 index b550584363e..dcab98036c3 100644
22 --- a/app-emulation/xen-tools/Manifest
23 +++ b/app-emulation/xen-tools/Manifest
24 @@ -2,5 +2,7 @@ DIST ovmf-20151110.tar.bz2 27518370 SHA256 74199f6b5c6f756881323242742c396c52096
25 DIST seabios-1.10.0.tar.gz 588213 SHA256 8976fc4c1ebcda66ac96689762247dfc99115a5f7acb3a7d4e18d18ff5de12a9 SHA512 f1b83ce37b59070b488e19f98c95ca9f413cf4969663331b631c3ccb884c90b2db793d32a779ef05cead538c2fd123be4b73391ad2fa20c900a1f14237178d8c WHIRLPOOL 77718eac01a59f94c3fa81195925ae09c19e11f80f107b3387e910408d88d3ffc93eaca3b73d6a52b67514538c0e020b0f4078db8277a5ee6361fd0d3ada8598
26 DIST xen-4.8.2-upstream-patches-2.tar.xz 38852 SHA256 12c1f1fd2adba22b923d2ee944e6e66794701393966f9e9e2079961e202f6d64 SHA512 536823eabf03e92585a8c5cde90ce502672dd1ec080b28b39411d6a778b899436a57bfb633f11c94d48d2f963848b7771e469f5ea53e84b580976f631f69cc5d WHIRLPOOL 5baf92709da895eccbe8b154c1d1cdf4c2f0faf5166ef2e4bbf32ca6899d8b88aa67ccd765a15a2f9a6d5200d4a1eb832775891d41c00a950855e5d1d4358e35
27 DIST xen-4.8.2.tar.gz 22522336 SHA256 cb1cc2f0985e3d8651215e5d24c1fcc3036994fa7cc495a5091a2c85ece2aff9 SHA512 7805531f73d23ecfff3439770e62d387f4254a444875670d53a0a739323e5d4d8f8fcc478f8936ee1ae8aff3e0229549e47c01c606365a8ce060dd5c503e87da WHIRLPOOL 8e54e79219f89640162673da471a02ee8a39bb884e2376a79a09226462903185b49a771fef51ceca54c4dd42a110ee1214db6dbf94235a156a17d6c597634c3d
28 +DIST xen-4.9.0-upstream-patches-0.tar.xz 58780 SHA256 f3539c0f620d168e4dcfc4c11f895bd6850c1c566d53a9d3366907662c2960e3 SHA512 98c601d791661a306e3dce5befb37b80de8a71cdd1759f3da00b199d48e3b9468efd1332e26ae044ad616b41a02771ad07a1c96972103b7e0aa39b93fb556999 WHIRLPOOL 711d3a5bcc9bd9afded35252b2efc0d4ba39ab9edb595328e4ebd808513c863e447e3554600328982a440fe936b7f68baf0b925f9d8ef8d17965439eed35d98b
29 +DIST xen-4.9.0.tar.gz 23361741 SHA256 cade643fe3310d4d6f97d0c215c6fa323bc1130d7e64d7e2043ffaa73a96f33b SHA512 97f8075c49ef9ec0adbe95106c0cff4f9379578fd568777697565476c3fd948335d72ddcacf8be65fd9db219c0a35dcdc007f355f7e5874dd950fd4c0a0f966f WHIRLPOOL 354527ea01f69c6ab632cffe8f50ca93721d9a89cbc4d84886d24b53fabdb7f62132b80e36189c30c0c9fae66b367eec7e00bb4df5f7af054ec27cec912ecf47
30 DIST xen-gentoo-patches-10.tar.xz 27876 SHA256 aa91759d25611afa2e851e190c8445b18e4262037fc06da886f2fa4a4c500b94 SHA512 2033f4cb671971c73841cfaa7eb46623c37778c5746b47302eee252c4af287ccbeb8d1884ffdf32cd97a38cd7785257d56f13ef20d4c03dc0fb1cb196dc04ece WHIRLPOOL e02cc3c6ffd701b2f04df111ab33b18f7fa09e292b94a34af4d806509a564b896a7b677ab64654523ee992f363d59bf6bd4c2cbeaea7330f368cf657bfa2d538
31 DIST xen-ovmf-patches-2.tar.xz 4344 SHA256 495d61d718440057f8b0b54fb57061450dd764c6e87fe5f8bda1785bcddba770 SHA512 0bdc83029a01b613f5c1ca029bd45aebe211c332f09db91a0cc7d6b6f85a81dbbfdc20c62f0d20e973ee41b155a6551a4fad518cb792e1d508bf070e23d6a1d3 WHIRLPOOL 8346d68fa5d2a8e8a5c007b55e2b85cf48df045cc8c4818f09c756d28a52dd856671f37b4a53478e9b96ca9d2eca0c67fd15f009a94d1d2dfed8e83e596d9633
32
33 diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf
34 index 194798af0aa..14f11d99af1 100644
35 --- a/app-emulation/xen-tools/files/gentoo-patches.conf
36 +++ b/app-emulation/xen-tools/files/gentoo-patches.conf
37 @@ -109,3 +109,12 @@ ${_gx027} ${_gx032}
38 ${_gx028} ${_gx029}
39 ${_gx037} ${_gx040} ${_gx042}
40 "
41 +
42 +# xen-tools-4.9.0 patches set
43 +_gpv_xen_tools_490_0="
44 +${_gx008}
45 +${_gx038} ${_gx017} ${_gx039}
46 +${_gx027}
47 +${_gx028} ${_gx029}
48 +${_gx037} ${_gx042}
49 +"
50
51 diff --git a/app-emulation/xen-tools/xen-tools-4.9.0.ebuild b/app-emulation/xen-tools/xen-tools-4.9.0.ebuild
52 new file mode 100644
53 index 00000000000..e51036af94b
54 --- /dev/null
55 +++ b/app-emulation/xen-tools/xen-tools-4.9.0.ebuild
56 @@ -0,0 +1,462 @@
57 +# Copyright 1999-2017 Gentoo Foundation
58 +# Distributed under the terms of the GNU General Public License v2
59 +
60 +EAPI=6
61 +
62 +PYTHON_COMPAT=( python2_7 )
63 +PYTHON_REQ_USE='ncurses,xml,threads'
64 +
65 +inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs versionator
66 +
67 +MY_PV=${PV/_/-}
68 +MAJOR_V="$(get_version_component_range 1-2)"
69 +
70 +if [[ $PV == *9999 ]]; then
71 + inherit git-r3
72 + KEYWORDS=""
73 + REPO="xen.git"
74 + EGIT_REPO_URI="git://xenbits.xen.org/${REPO}"
75 + S="${WORKDIR}/${REPO}"
76 +else
77 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
78 + UPSTREAM_VER=0
79 + SECURITY_VER=
80 + # xen-tools's gentoo patches tarball
81 + GENTOO_VER=10
82 + # xen-tools's gentoo patches version which apply to this specific ebuild
83 + GENTOO_GPV=0
84 + # xen-tools ovmf's patches
85 + OVMF_VER=2
86 +
87 + SEABIOS_VER=1.10.0
88 + # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
89 + OVMF_PV=20151110
90 +
91 + [[ -n ${UPSTREAM_VER} ]] && \
92 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
93 + [[ -n ${SECURITY_VER} ]] && \
94 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
95 + [[ -n ${GENTOO_VER} ]] && \
96 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz"
97 + [[ -n ${OVMF_VER} ]] && \
98 + OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
99 +
100 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/xen-${MY_PV}.tar.gz
101 + http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
102 + https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
103 + ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2
104 + ${OVMF_PATCHSET_URI} )
105 + ${UPSTREAM_PATCHSET_URI}
106 + ${SECURITY_PATCHSET_URI}
107 + ${GENTOO_PATCHSET_URI}"
108 +
109 + S="${WORKDIR}/xen-${MY_PV}"
110 +fi
111 +
112 +DESCRIPTION="Xen tools including QEMU and xl"
113 +HOMEPAGE="https://www.xenproject.org"
114 +DOCS=( README docs/README.xen-bugtool )
115 +
116 +LICENSE="GPL-2"
117 +SLOT="0/${MAJOR_V}"
118 +# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
119 +# >=dev-lang/ocaml-4 stable
120 +# Masked in profiles/eapi-5-files instead
121 +IUSE="api custom-cflags debug doc flask hvm ocaml ovmf +pam pygrub python +qemu +qemu-traditional screen sdl static-libs system-qemu system-seabios"
122 +
123 +REQUIRED_USE="
124 + ${PYTHON_REQUIRED_USE}
125 + pygrub? ( python )
126 + ovmf? ( hvm )
127 + ^^ ( qemu system-qemu )"
128 +
129 +COMMON_DEPEND="
130 + sys-apps/pciutils
131 + dev-libs/lzo:2
132 + dev-libs/glib:2
133 + dev-libs/yajl
134 + dev-libs/libaio
135 + dev-libs/libgcrypt:0
136 + sys-libs/zlib
137 + ${PYTHON_DEPS}
138 +"
139 +
140 +DEPEND="${COMMON_DEPEND}
141 + >=sys-kernel/linux-headers-4.11
142 + dev-python/lxml[${PYTHON_USEDEP}]
143 + x86? ( sys-devel/dev86
144 + sys-power/iasl )
145 + pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
146 + api? ( dev-libs/libxml2
147 + net-misc/curl )
148 + ovmf? (
149 + !arm? ( !arm64? ( dev-lang/nasm ) )
150 + $(python_gen_impl_dep sqlite)
151 + )
152 + !amd64? ( >=sys-apps/dtc-1.4.0 )
153 + amd64? ( sys-devel/bin86
154 + system-seabios? ( sys-firmware/seabios )
155 + sys-firmware/ipxe
156 + sys-devel/dev86
157 + sys-power/iasl )
158 + dev-lang/perl
159 + app-misc/pax-utils
160 + doc? (
161 + app-text/ghostscript-gpl
162 + app-text/pandoc
163 + dev-python/markdown[${PYTHON_USEDEP}]
164 + dev-texlive/texlive-latexextra
165 + media-gfx/transfig
166 + )
167 + hvm? ( x11-proto/xproto
168 + !net-libs/libiscsi )
169 + qemu? (
170 + app-arch/snappy:=
171 + x11-libs/pixman
172 + sdl? ( media-libs/libsdl[X] )
173 + )
174 + system-qemu? ( app-emulation/qemu[xen] )
175 + ocaml? ( dev-ml/findlib
176 + >=dev-lang/ocaml-4 )"
177 +
178 +RDEPEND="${COMMON_DEPEND}
179 + sys-apps/iproute2[-minimal]
180 + net-misc/bridge-utils
181 + screen? (
182 + app-misc/screen
183 + app-admin/logrotate
184 + )"
185 +
186 +# hvmloader is used to bootstrap a fully virtualized kernel
187 +# Approved by QA team in bug #144032
188 +QA_WX_LOAD="
189 + usr/libexec/xen/boot/hvmloader
190 + usr/share/qemu-xen/qemu/s390-ccw.img
191 + usr/share/qemu-xen/qemu/u-boot.e500
192 +"
193 +
194 +QA_PREBUILT="
195 + usr/libexec/xen/bin/ivshmem-client
196 + usr/libexec/xen/bin/ivshmem-server
197 + usr/libexec/xen/bin/qemu-img
198 + usr/libexec/xen/bin/qemu-io
199 + usr/libexec/xen/bin/qemu-nbd
200 + usr/libexec/xen/bin/qemu-system-i386
201 + usr/libexec/xen/bin/virtfs-proxy-helper
202 + usr/libexec/xen/libexec/xen-bridge-helper
203 + usr/share/qemu-xen/qemu/s390-ccw.img
204 + usr/share/qemu-xen/qemu/u-boot.e500
205 +"
206 +
207 +RESTRICT="test"
208 +
209 +pkg_setup() {
210 + python_setup
211 + export "CONFIG_LOMOUNT=y"
212 +
213 + #bug 522642, disable compile tools/tests
214 + export "CONFIG_TESTS=n"
215 +
216 + if [[ -z ${XEN_TARGET_ARCH} ]] ; then
217 + if use x86 && use amd64; then
218 + die "Confusion! Both x86 and amd64 are set in your use flags!"
219 + elif use x86; then
220 + export XEN_TARGET_ARCH="x86_32"
221 + elif use amd64 ; then
222 + export XEN_TARGET_ARCH="x86_64"
223 + elif use arm; then
224 + export XEN_TARGET_ARCH="arm32"
225 + elif use arm64; then
226 + export XEN_TARGET_ARCH="arm64"
227 + else
228 + die "Unsupported architecture!"
229 + fi
230 + fi
231 +}
232 +
233 +src_prepare() {
234 + local i
235 +
236 + # Upstream's patchset
237 + if [[ -n ${UPSTREAM_VER} ]]; then
238 + einfo "Try to apply Xen Upstream patch set"
239 + EPATCH_SUFFIX="patch" \
240 + EPATCH_FORCE="yes" \
241 + EPATCH_OPTS="-p1" \
242 + epatch "${WORKDIR}"/patches-upstream
243 + fi
244 +
245 + # Security patchset
246 + if [[ -n ${SECURITY_VER} ]]; then
247 + einfo "Try to apply Xen Security patch set"
248 + # apply main xen patches
249 + # Two parallel systems, both work side by side
250 + # Over time they may concdense into one. This will suffice for now
251 + EPATCH_SUFFIX="patch"
252 + EPATCH_FORCE="yes"
253 +
254 + source "${WORKDIR}"/patches-security/${PV}.conf || die
255 +
256 + for i in ${XEN_SECURITY_MAIN}; do
257 + epatch "${WORKDIR}"/patches-security/xen/$i
258 + done
259 +
260 + # apply qemu-xen/upstream patches
261 + pushd "${S}"/tools/qemu-xen/ > /dev/null
262 + for i in ${XEN_SECURITY_QEMUU}; do
263 + epatch "${WORKDIR}"/patches-security/qemuu/$i
264 + done
265 + popd > /dev/null
266 +
267 + # apply qemu-traditional patches
268 + pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
269 + for i in ${XEN_SECURITY_QEMUT}; do
270 + epatch "${WORKDIR}"/patches-security/qemut/$i
271 + done
272 + popd > /dev/null
273 + fi
274 +
275 + # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
276 + mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
277 + pushd tools/firmware/ > /dev/null
278 + ln -s seabios-dir-remote seabios-dir || die
279 + popd > /dev/null
280 +
281 + # Gentoo's patchset
282 + if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
283 + einfo "Try to apply Gentoo specific patch set"
284 + source "${FILESDIR}"/gentoo-patches.conf || die
285 + _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
286 + for i in ${!_gpv}; do
287 + EPATCH_SUFFIX="patch" \
288 + EPATCH_FORCE="yes" \
289 + epatch "${WORKDIR}"/patches-gentoo/$i
290 + done
291 + fi
292 +
293 + # Ovmf's patchset
294 + if use ovmf; then
295 + if [[ -n ${OVMF_VER} ]];then
296 + einfo "Try to apply Ovmf patch set"
297 + pushd "${WORKDIR}"/ovmf-*/ > /dev/null
298 + EPATCH_SUFFIX="patch" \
299 + EPATCH_FORCE="yes" \
300 + EPATCH_OPTS="-p1" \
301 + epatch "${WORKDIR}"/patches-ovmf
302 + popd > /dev/null
303 + fi
304 + mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die
305 + fi
306 +
307 + mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
308 +
309 + # Fix texi2html build error with new texi2html, qemu.doc.html
310 + sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
311 +
312 + use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
313 + sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
314 + -i tools/firmware/Makefile || die
315 +
316 + # Drop .config, fixes to gcc-4.6
317 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
318 +
319 + # if the user *really* wants to use their own custom-cflags, let them
320 + if use custom-cflags; then
321 + einfo "User wants their own CFLAGS - removing defaults"
322 +
323 + # try and remove all the default cflags
324 + find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
325 + -exec sed \
326 + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
327 + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
328 + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
329 + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
330 + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
331 + -i {} + || die "failed to re-set custom-cflags"
332 + else
333 + unset CFLAGS
334 + unset LDFLAGS
335 + unset ASFLAGS
336 + unset CPPFLAGS
337 + fi
338 +
339 + if ! use pygrub; then
340 + sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
341 + fi
342 +
343 + if ! use python; then
344 + sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
345 + fi
346 +
347 + if ! use hvm; then
348 + sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
349 + # Bug 351648
350 + elif ! use x86 && ! has x86 $(get_all_abis); then
351 + mkdir -p "${WORKDIR}"/extra-headers/gnu || die
352 + touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
353 + export CPATH="${WORKDIR}"/extra-headers
354 + fi
355 +
356 + if use qemu; then
357 + if use sdl; then
358 + sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
359 + tools/Makefile || die
360 + else
361 + sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
362 + tools/qemu-xen-traditional/xen-setup || die
363 + sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
364 + tools/Makefile || die
365 + fi
366 + else
367 + # Don't bother with qemu, only needed for fully virtualised guests
368 + sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die
369 + fi
370 +
371 + # Reset bash completion dir; Bug 472438
372 + sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
373 + -i Config.mk || die
374 + sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
375 +
376 + # xencommons, Bug #492332, sed lighter weight than patching
377 + sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
378 + -i tools/hotplug/Linux/init.d/xencommons.in || die
379 +
380 + # fix bashishm
381 + sed -e '/Usage/s/\$//g' \
382 + -i tools/hotplug/Linux/init.d/xendriverdomain.in || die
383 +
384 + # respect multilib, usr/lib/libcacard.so.0.0.0
385 + sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
386 + -i tools/qemu-xen/configure || die
387 +
388 + #bug 518136, don't build 32bit exactuable for nomultilib profile
389 + if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
390 + sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
391 + fi
392 +
393 + # uncomment lines in xl.conf
394 + sed -e 's:^#autoballoon=:autoballoon=:' \
395 + -e 's:^#lockfile=:lockfile=:' \
396 + -e 's:^#vif.default.script=:vif.default.script=:' \
397 + -i tools/examples/xl.conf || die
398 +
399 + default
400 +}
401 +
402 +src_configure() {
403 + local myconf="--prefix=${PREFIX}/usr \
404 + --libdir=${PREFIX}/usr/$(get_libdir) \
405 + --libexecdir=${PREFIX}/usr/libexec \
406 + --localstatedir=${EPREFIX}/var \
407 + --disable-werror \
408 + --disable-xen \
409 + --enable-tools \
410 + --enable-docs \
411 + $(use_enable pam) \
412 + $(use_enable api xenapi) \
413 + $(use_enable ovmf) \
414 + $(use_enable ocaml ocamltools) \
415 + --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
416 + "
417 +
418 + use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
419 + use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
420 + use amd64 && myconf+=" $(use_enable qemu-traditional)"
421 + econf ${myconf}
422 +}
423 +
424 +src_compile() {
425 + local myopt
426 + use debug && myopt="${myopt} debug=y"
427 +
428 + if test-flag-CC -fno-strict-overflow; then
429 + append-flags -fno-strict-overflow
430 + fi
431 +
432 + emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" build-tools ${myopt}
433 +
434 + if use doc; then
435 + emake -C docs build
436 + else
437 + emake -C docs man-pages
438 + fi
439 +}
440 +
441 +src_install() {
442 + # Override auto-detection in the build system, bug #382573
443 + export INITD_DIR=/tmp/init.d
444 + export CONFIG_LEAF_DIR=../tmp/default
445 +
446 + # Let the build system compile installed Python modules.
447 + local PYTHONDONTWRITEBYTECODE
448 + export PYTHONDONTWRITEBYTECODE
449 +
450 + emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
451 + XEN_PYTHON_NATIVE_INSTALL=y install-tools
452 +
453 + # Created at runtime
454 + rm -rv "${ED%/}/var/run" || die
455 +
456 + # Fix the remaining Python shebangs.
457 + python_fix_shebang "${D}"
458 +
459 + # Remove RedHat-specific stuff
460 + rm -rf "${D}"tmp || die
461 +
462 + emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
463 + use doc && dodoc -r docs/{pdf,txt}
464 + dodoc ${DOCS[@]}
465 +
466 + newconfd "${FILESDIR}"/xendomains.confd xendomains
467 + newconfd "${FILESDIR}"/xenstored.confd xenstored
468 + newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
469 + newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
470 + newinitd "${FILESDIR}"/xenstored.initd-r1 xenstored
471 + newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
472 + newinitd "${FILESDIR}"/xencommons.initd xencommons
473 + newconfd "${FILESDIR}"/xencommons.confd xencommons
474 + newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
475 + newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
476 + newinitd "${FILESDIR}"/xen-watchdog.initd xen-watchdog
477 +
478 + if use screen; then
479 + cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
480 + cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
481 + keepdir /var/log/xen-consoles
482 + fi
483 +
484 + # For -static-libs wrt Bug 384355
485 + if ! use static-libs; then
486 + rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
487 + fi
488 +
489 + # for xendomains
490 + keepdir /etc/xen/auto
491 +
492 + # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
493 + find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
494 + -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
495 +}
496 +
497 +pkg_postinst() {
498 + elog "Official Xen Guide and the offical wiki page:"
499 + elog "https://wiki.gentoo.org/wiki/Xen"
500 + elog "https://wiki.xen.org/wiki/Main_Page"
501 + elog ""
502 + elog "Recommended to utilise the xencommons script to config sytem At boot"
503 + elog "Add by use of rc-update on completion of the install"
504 +
505 + if ! use hvm; then
506 + echo
507 + elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
508 + elog "support enable the hvm use flag."
509 + elog "An x86 or amd64 system is required to build HVM support."
510 + fi
511 +
512 + if use qemu; then
513 + elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
514 + elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
515 + elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
516 + elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
517 + fi
518 +}