Gentoo Archives: gentoo-commits

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