Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen-tools/, app-emulation/xen-tools/files/
Date: Sun, 20 Feb 2022 00:31:39
Message-Id: 1645316671.d394efbc1a9320e50a7f9c16dc1a185994bb72f2.sam@gentoo
1 commit: d394efbc1a9320e50a7f9c16dc1a185994bb72f2
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Sat Feb 19 17:34:35 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 20 00:24:31 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d394efbc
7
8 app-emulation/xen-tools: bump to 4.15.2
9
10 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 app-emulation/xen-tools/Manifest | 2 +
14 app-emulation/xen-tools/files/gentoo-patches.conf | 41 +-
15 app-emulation/xen-tools/xen-tools-4.15.2.ebuild | 556 ++++++++++++++++++++++
16 3 files changed, 562 insertions(+), 37 deletions(-)
17
18 diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
19 index 34f961248c85..4ab68d105403 100644
20 --- a/app-emulation/xen-tools/Manifest
21 +++ b/app-emulation/xen-tools/Manifest
22 @@ -8,6 +8,8 @@ DIST ipxe-git-988d2c13cdf0f0b4140685af35ced70ac5b3283c.tar.gz 3931642 BLAKE2B bf
23 DIST seabios-1.14.0.tar.gz 628985 BLAKE2B cc1126925dab1551a655680d20d06ebf28c12c386500d1ee4df9e1a99403b4c5bc6a66c2cc5ef58b4c3d6d7226f35007506a6a1855c2cf2742469dcb7aba05bb SHA512 215c42f59425f8abd062be7b11fc0e39c977cee5001a2381551b0f851ac337d0dd53c065267e6dee0e710ffd700fa635f9007b89da8dfce0f47122c984ee8146
24 DIST xen-4.15.1-upstream-patches-1.tar.xz 15476 BLAKE2B 9f0cf8f3dd993e32939ff1ee35244224bd3d16fbd345500ff01e51eb5828d3e44bddc539462c39d8c37b6497d4bf8887261a8df5d31b17b413b0c21f7faf3a84 SHA512 aac3f91c3c753aa8430abad055252cba5dbdfd9e548f219df1452388ef2f82b65c428755363aa0645824431e812f3b799af4f9468669e42a0f5b6b8874397c75
25 DIST xen-4.15.1.tar.gz 40800852 BLAKE2B 39475ea33f029fb0e84b82b4a2b13fd613bab01e3ef6c241dfede3d190ee9be53c99b62121d37d83b1e078764b3e4d88d1dfb99be1b5623691e56519850c6798 SHA512 8d3cbdf708f46477e32ee7cbd16a490c82efa855cecd84ee712b8680df4d69c987ba9ab00ff3851f627b98a8ebbc5dab71f92f142ed958ee2bc538bc792cd4b9
26 +DIST xen-4.15.2-upstream-patches-0.tar.xz 33368 BLAKE2B f22c0e9ce6b859a2741f09c0c52479e8acb38440b631882850993fcfcdc445c28fbeac4353df6bac1b2be89e39a99bae1a920796d505f888e3701a98f17ed29d SHA512 10a996cd87404ff6536119deeedfe67143c02475c4ca2d7f741e087197aaffa10c5831aad1f9ee2f9070461dd8cdc7af4851fbafb634a2f65235603d6fb0848f
27 +DIST xen-4.15.2.tar.gz 40773378 BLAKE2B 7c3e3bb066505f9838cd7c56d85debc64e5ed32cf4d4edf699ff843db49bee916e6eb46d07e5cd9021c2644bba0628a2aa567f60ace26c6d7ee5922643e04104 SHA512 1cbf988fa8ed38b7ad724978958092ca0e5506e38c709c7d1af196fb8cb8ec0197a79867782761ef230b268624b3d7a0d5d0cd186f37d25f495085c71bf70d54
28 DIST xen-4.16.0.tar.gz 44982322 BLAKE2B 7e16a93b3f1131e2b10307fabc10641a9c5983173155b9a35eaf6ff317b6a747bccf6b8c87c06686830acc2c4bd3e19e5867eb443eabac9a1e4ee59124dfa87f SHA512 2869ed90d1779c9754d7f2397f5fc67a655304d9c32953ac20655ef96cb154521d8fce9f23915ac0c91f984dc54f72c67e5e619e2da318b5997748f44cf21b87
29 DIST xen-gentoo-patches-23.tar.xz 20536 BLAKE2B 0064f79f8794a21ab13047a4ee296e37efa616e16ca6cd65b31fdafeb458fd9b80f0443758343c8328b1901d7169618346becfe75f16dcaeff08fc975f1d08d5 SHA512 09248e17ff7865feb2a505169d62ee5c8c60bd672fa8c4c7c4e3a2e4af58bfad0379d37b395bab3e3393af8d53d882f56749dfeb560edeea6b7ab56c902a3c49
30 DIST xen-gentoo-patches-24.tar.xz 20952 BLAKE2B 292ea384f007a9615ca840068c45cd0e37a63a59e596c9c87a278a0136805327c85f5e5576eac751e40bda616559e413b396d313d43f2d36d904f09a41b0d302 SHA512 26b7344cea40ef44d1eaec330465071c96ee27a5b0ca91f787fc80c6801abed47cab9050a40ef80f20471a7cd9ee0dc7aaa46b16e5af7d0e50643ccc7d3a828b
31
32 diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf
33 index fc52db69dccd..d6fce26a06c0 100644
34 --- a/app-emulation/xen-tools/files/gentoo-patches.conf
35 +++ b/app-emulation/xen-tools/files/gentoo-patches.conf
36 @@ -51,44 +51,11 @@ _gx056=" xen-tools-4.12.2-libxenstat-makefile.patch"
37 # Fix building with gcc 10, bug #722930
38 _gx060=" xen-tools-4.13.0-gcc10.patch"
39
40 -# xen-tools-4.14.2 patches set
41 -_gpv_xen_tools_4142_0="
42 - xen-tools-4.12.0-gcc8.patch
43 - xen-tools-4.12.0-shim.patch
44 - xen-tools-4.12.0-unbundle-ipxe.patch
45 - xen-tools-4.12.2-libxenstat-makefile.patch
46 - xen-tools-4.14-ar-cc.patch
47 - xen-tools-4.14-qemu-bridge.patch
48 - xen-tools-4.15.0-disable-werror.patch
49 - xen-tools-4.15.0-gcc11.patch
50 - xen-tools-4.4.1-tinfo.patch
51 - xen-tools-4.6-increase-stack-size.patch
52 - xen-tools-4-anti-ovmf-download.patch
53 - xen-tools-4-qemu-fix-po-collision.patch
54 -"
55 -
56 -# xen-tools-4.14.3 patches set
57 -_gpv_xen_tools_4143_0="
58 - xen-tools-4.12.0-gcc8.patch
59 - xen-tools-4.12.0-shim.patch
60 - xen-tools-4.12.0-unbundle-ipxe.patch
61 - xen-tools-4.12.2-libxenstat-makefile.patch
62 - xen-tools-4.14-ar-cc.patch
63 - xen-tools-4.14-qemu-bridge.patch
64 - xen-tools-4.15.0-disable-werror.patch
65 - xen-tools-4.4.1-tinfo.patch
66 - xen-tools-4.6-increase-stack-size.patch
67 - xen-tools-4-anti-ovmf-download.patch
68 - xen-tools-4-qemu-fix-po-collision.patch
69 -"
70 -
71 -# xen-tools-4.15.0 patches set
72 -_gpv_xen_tools_4150_0="
73 +# xen-tools-4.15.1 patches set
74 +_gpv_xen_tools_4151_0="
75 xen-tools-4.14-ar-cc.patch
76 xen-tools-4.15.0-disable-werror.patch
77 - xen-tools-4.15.0-gcc11.patch
78 xen-tools-4.15.0-libxenstat-makefile.patch
79 - xen-tools-4.15.0-no-ld-no-pie.patch
80 xen-tools-4.15.0-qemu-bridge.patch
81 xen-tools-4.15.0-unbundle-ipxe.patch
82 xen-tools-4.4.1-tinfo.patch
83 @@ -96,8 +63,8 @@ _gpv_xen_tools_4150_0="
84 xen-tools-4-qemu-fix-po-collision.patch
85 "
86
87 -# xen-tools-4.15.1 patches set
88 -_gpv_xen_tools_4151_0="
89 +# xen-tools-4.15.2 patches set
90 +_gpv_xen_tools_4152_0="
91 xen-tools-4.14-ar-cc.patch
92 xen-tools-4.15.0-disable-werror.patch
93 xen-tools-4.15.0-libxenstat-makefile.patch
94
95 diff --git a/app-emulation/xen-tools/xen-tools-4.15.2.ebuild b/app-emulation/xen-tools/xen-tools-4.15.2.ebuild
96 new file mode 100644
97 index 000000000000..e15386a8efc6
98 --- /dev/null
99 +++ b/app-emulation/xen-tools/xen-tools-4.15.2.ebuild
100 @@ -0,0 +1,556 @@
101 +# Copyright 1999-2022 Gentoo Authors
102 +# Distributed under the terms of the GNU General Public License v2
103 +
104 +EAPI=7
105 +
106 +PYTHON_COMPAT=( python3_{8..10} )
107 +PYTHON_REQ_USE='ncurses,xml,threads(+)'
108 +
109 +inherit bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs
110 +
111 +MY_PV=${PV/_/-}
112 +
113 +if [[ ${PV} == *9999 ]]; then
114 + inherit git-r3
115 + REPO="xen.git"
116 + EGIT_REPO_URI="git://xenbits.xen.org/${REPO}"
117 + S="${WORKDIR}/${REPO}"
118 +else
119 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
120 + UPSTREAM_VER=0
121 + SECURITY_VER=
122 + # xen-tools's gentoo patches tarball
123 + GENTOO_VER=23
124 + # xen-tools's gentoo patches version which apply to this specific ebuild
125 + GENTOO_GPV=0
126 + # xen-tools ovmf's patches
127 + OVMF_VER=
128 +
129 + SEABIOS_VER="1.14.0"
130 + EDK2_COMMIT="a3741780fe3535e19e02efa869a7cac481891129"
131 + EDK2_OPENSSL_VERSION="1_1_1j"
132 + EDK2_SOFTFLOAT_COMMIT="b64af41c3276f97f0e181920400ee056b9c88037"
133 + EDK2_BROTLI_COMMIT="666c3280cc11dc433c303d79a83d4ffbdd12cc8d"
134 + IPXE_COMMIT="988d2c13cdf0f0b4140685af35ced70ac5b3283c"
135 +
136 + [[ -n ${UPSTREAM_VER} ]] && \
137 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz
138 + https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
139 + [[ -n ${SECURITY_VER} ]] && \
140 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz
141 + https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${PN/-tools/}-security-patches-${SECURITY_VER}.tar.xz"
142 + [[ -n ${GENTOO_VER} ]] && \
143 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz
144 + https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${PN/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
145 + [[ -n ${OVMF_VER} ]] && \
146 + OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
147 +
148 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/xen-${MY_PV}.tar.gz
149 + https://www.seabios.org/downloads/seabios-${SEABIOS_VER}.tar.gz
150 + ipxe? ( http://xenbits.xen.org/xen-extfiles/ipxe-git-${IPXE_COMMIT}.tar.gz )
151 + ovmf? ( https://github.com/tianocore/edk2/archive/${EDK2_COMMIT}.tar.gz -> edk2-${EDK2_COMMIT}.tar.gz
152 + https://github.com/openssl/openssl/archive/OpenSSL_${EDK2_OPENSSL_VERSION}.tar.gz
153 + https://github.com/ucb-bar/berkeley-softfloat-3/archive/${EDK2_SOFTFLOAT_COMMIT}.tar.gz -> berkeley-softfloat-${EDK2_SOFTFLOAT_COMMIT}.tar.gz
154 + https://github.com/google/brotli/archive/${EDK2_BROTLI_COMMIT}.tar.gz -> brotli-${EDK2_BROTLI_COMMIT}.tar.gz
155 + ${OVMF_PATCHSET_URI} )
156 + ${UPSTREAM_PATCHSET_URI}
157 + ${SECURITY_PATCHSET_URI}
158 + ${GENTOO_PATCHSET_URI}"
159 +
160 + S="${WORKDIR}/xen-${MY_PV}"
161 +fi
162 +
163 +DESCRIPTION="Xen tools including QEMU and xl"
164 +HOMEPAGE="https://www.xenproject.org"
165 +DOCS=( README )
166 +
167 +LICENSE="GPL-2"
168 +SLOT="0/$(ver_cut 1-2)"
169 +# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
170 +# >=dev-lang/ocaml-4 stable
171 +# Masked in profiles/eapi-5-files instead
172 +IUSE="api debug doc +hvm +ipxe ocaml ovmf +pam pygrub python +qemu +qemu-traditional +rombios screen selinux sdl static-libs system-ipxe system-qemu system-seabios"
173 +
174 +REQUIRED_USE="
175 + ${PYTHON_REQUIRED_USE}
176 + ipxe? ( rombios )
177 + ovmf? ( hvm )
178 + pygrub? ( python )
179 + rombios? ( hvm )
180 + system-ipxe? ( rombios )
181 + ?? ( ipxe system-ipxe )
182 + ?? ( qemu system-qemu )"
183 +
184 +COMMON_DEPEND="
185 + sys-apps/pciutils
186 + dev-libs/lzo:2
187 + dev-libs/glib:2
188 + dev-libs/yajl
189 + dev-libs/libaio
190 + dev-libs/libgcrypt:0
191 + sys-libs/zlib
192 + ${PYTHON_DEPS}
193 +"
194 +
195 +RDEPEND="${COMMON_DEPEND}
196 + sys-apps/iproute2[-minimal]
197 + net-misc/bridge-utils
198 + screen? (
199 + app-misc/screen
200 + app-admin/logrotate
201 + )
202 + selinux? ( sec-policy/selinux-xen )"
203 +
204 +DEPEND="${COMMON_DEPEND}
205 + app-misc/pax-utils
206 + >=sys-kernel/linux-headers-4.11
207 + x11-libs/pixman
208 + $(python_gen_cond_dep '
209 + dev-python/lxml[${PYTHON_USEDEP}]
210 + pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
211 + ')
212 + x86? ( sys-devel/dev86
213 + system-ipxe? ( sys-firmware/ipxe[qemu] )
214 + sys-power/iasl )
215 + api? ( dev-libs/libxml2
216 + net-misc/curl )
217 +
218 + ovmf? (
219 + !arm? ( !arm64? ( dev-lang/nasm ) )
220 + $(python_gen_impl_dep sqlite)
221 + )
222 + !amd64? ( >=sys-apps/dtc-1.4.0 )
223 + amd64? ( sys-power/iasl
224 + system-seabios? ( sys-firmware/seabios )
225 + system-ipxe? ( sys-firmware/ipxe[qemu] )
226 + rombios? ( sys-devel/bin86 sys-devel/dev86 ) )
227 + doc? (
228 + app-text/ghostscript-gpl
229 + app-text/pandoc
230 + $(python_gen_cond_dep '
231 + dev-python/markdown[${PYTHON_USEDEP}]
232 + ')
233 + dev-texlive/texlive-latexextra
234 + media-gfx/transfig
235 + )
236 + hvm? ( x11-base/xorg-proto )
237 + qemu? (
238 + app-arch/snappy:=
239 + sdl? (
240 + media-libs/libsdl[X]
241 + media-libs/libsdl2[X]
242 + )
243 + )
244 + system-qemu? ( app-emulation/qemu[xen] )
245 + ocaml? ( dev-ml/findlib
246 + dev-lang/ocaml[ocamlopt] )
247 + python? ( >=dev-lang/swig-4.0.0 )"
248 +
249 +BDEPEND="dev-lang/perl
250 + sys-devel/bison
251 + sys-devel/gettext"
252 +
253 +# hvmloader is used to bootstrap a fully virtualized kernel
254 +# Approved by QA team in bug #144032
255 +QA_WX_LOAD="
256 + usr/libexec/xen/boot/hvmloader
257 + usr/libexec/xen/boot/xen-shim
258 + usr/share/qemu-xen/qemu/hppa-firmware.img
259 + usr/share/qemu-xen/qemu/s390-ccw.img
260 + usr/share/qemu-xen/qemu/u-boot.e500
261 +"
262 +
263 +QA_PREBUILT="
264 + usr/libexec/xen/bin/elf2dmp
265 + usr/libexec/xen/bin/ivshmem-client
266 + usr/libexec/xen/bin/ivshmem-server
267 + usr/libexec/xen/bin/qemu-edid
268 + usr/libexec/xen/bin/qemu-img
269 + usr/libexec/xen/bin/qemu-io
270 + usr/libexec/xen/bin/qemu-keymap
271 + usr/libexec/xen/bin/qemu-nbd
272 + usr/libexec/xen/bin/qemu-pr-helper
273 + usr/libexec/xen/bin/qemu-storage-daemon
274 + usr/libexec/xen/bin/qemu-system-i386
275 + usr/libexec/xen/bin/virtfs-proxy-helper
276 + usr/libexec/xen/boot/xen-shim
277 + usr/libexec/xen/libexec/qemu-pr-helper
278 + usr/libexec/xen/libexec/virtfs-proxy-helper
279 + usr/libexec/xen/libexec/virtiofsd
280 + usr/libexec/xen/libexec/xen-bridge-helper
281 + usr/share/qemu-xen/qemu/s390-ccw.img
282 + usr/share/qemu-xen/qemu/s390-netboot.img
283 + usr/share/qemu-xen/qemu/u-boot.e500
284 +"
285 +
286 +RESTRICT="test"
287 +
288 +PATCHES=( "${FILESDIR}/${PN}-4.15.0-fix-xenstat-python-bindings.patch" )
289 +
290 +pkg_setup() {
291 + python_setup
292 + export "CONFIG_LOMOUNT=y"
293 +
294 + #bug 522642, disable compile tools/tests
295 + export "CONFIG_TESTS=n"
296 +
297 + if [[ -z ${XEN_TARGET_ARCH} ]] ; then
298 + if use x86 && use amd64; then
299 + die "Confusion! Both x86 and amd64 are set in your use flags!"
300 + elif use x86; then
301 + export XEN_TARGET_ARCH="x86_32"
302 + elif use amd64 ; then
303 + export XEN_TARGET_ARCH="x86_64"
304 + elif use arm; then
305 + export XEN_TARGET_ARCH="arm32"
306 + elif use arm64; then
307 + export XEN_TARGET_ARCH="arm64"
308 + else
309 + die "Unsupported architecture!"
310 + fi
311 + fi
312 +}
313 +
314 +src_prepare() {
315 + local i
316 +
317 + # Upstream's patchset
318 + if [[ -n ${UPSTREAM_VER} ]]; then
319 + einfo "Try to apply Xen Upstream patch set"
320 + eapply "${WORKDIR}"/patches-upstream
321 + fi
322 +
323 + # Security patchset
324 + if [[ -n ${SECURITY_VER} ]]; then
325 + einfo "Try to apply Xen Security patch set"
326 + # apply main xen patches
327 + # Two parallel systems, both work side by side
328 + # Over time they may concdense into one. This will suffice for now
329 + EPATCH_SUFFIX="patch"
330 + EPATCH_FORCE="yes"
331 +
332 + source "${WORKDIR}"/patches-security/${PV}.conf || die
333 +
334 + for i in ${XEN_SECURITY_MAIN}; do
335 + eapply "${WORKDIR}"/patches-security/xen/$i
336 + done
337 +
338 + # apply qemu-xen/upstream patches
339 + pushd "${S}"/tools/qemu-xen/ > /dev/null
340 + for i in ${XEN_SECURITY_QEMUU}; do
341 + eapply "${WORKDIR}"/patches-security/qemuu/$i
342 + done
343 + popd > /dev/null
344 +
345 + # apply qemu-traditional patches
346 + pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
347 + for i in ${XEN_SECURITY_QEMUT}; do
348 + eapply "${WORKDIR}"/patches-security/qemut/$i
349 + done
350 + popd > /dev/null
351 + fi
352 +
353 + # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
354 + mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
355 + pushd tools/firmware/ > /dev/null
356 + ln -s seabios-dir-remote seabios-dir || die
357 + popd > /dev/null
358 +
359 + # Gentoo's patchset
360 + if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
361 + einfo "Try to apply Gentoo specific patch set"
362 + source "${FILESDIR}"/gentoo-patches.conf || die
363 + _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
364 + for i in ${!_gpv}; do
365 + eapply "${WORKDIR}"/patches-gentoo/$i
366 + done
367 + fi
368 +
369 + # Ovmf's patchset
370 + if use ovmf; then
371 + if [[ -n ${OVMF_VER} ]];then
372 + einfo "Try to apply Ovmf patch set"
373 + pushd "${WORKDIR}"/edk2-*/ > /dev/null
374 + eapply "${WORKDIR}"/patches-ovmf
375 + popd > /dev/null
376 + fi
377 + mv ../edk2-${EDK2_COMMIT} tools/firmware/ovmf-dir-remote || die
378 + rm -r tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl || die
379 + rm -r tools/firmware/ovmf-dir-remote/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 || die
380 + rm -r tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli || die
381 + rm -r tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli || die
382 + mv ../openssl-OpenSSL_${EDK2_OPENSSL_VERSION} tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl || die
383 + mv ../berkeley-softfloat-3-${EDK2_SOFTFLOAT_COMMIT} tools/firmware/ovmf-dir-remote/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 || die
384 + cp -r ../brotli-${EDK2_BROTLI_COMMIT} tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli || die
385 + cp -r ../brotli-${EDK2_BROTLI_COMMIT} tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli || die
386 + cp tools/firmware/ovmf-makefile tools/firmware/ovmf-dir-remote/Makefile || die
387 +
388 + # Bug #816987
389 + pushd tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli > /dev/null
390 + eapply "${FILESDIR}/${PN}-4.15.1-brotli-gcc11.patch"
391 + popd > /dev/null
392 +
393 + pushd tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli > /dev/null
394 + eapply "${FILESDIR}/${PN}-4.15.1-brotli-gcc11.patch"
395 + popd > /dev/null
396 +
397 + pushd tools/firmware/ovmf-dir-remote > /dev/null
398 + eapply "${FILESDIR}/${PN}-4.15.1-edk2-python3.9.patch"
399 + popd > /dev/null
400 + fi
401 +
402 + # Fix building with ocaml 4.12 #818100
403 + eapply "${FILESDIR}/${PN}-4.15.1-ocaml-4.12.patch"
404 +
405 + # ipxe
406 + if use ipxe; then
407 + cp "${DISTDIR}/ipxe-git-${IPXE_COMMIT}.tar.gz" tools/firmware/etherboot/_ipxe.tar.gz || die
408 +
409 + # gcc 11
410 + cp "${WORKDIR}/patches-gentoo/${PN}-4.15.0-ipxe-gcc11.patch" tools/firmware/etherboot/patches/ipxe-gcc11.patch || die
411 + echo ipxe-gcc11.patch >> tools/firmware/etherboot/patches/series || die
412 + fi
413 +
414 + mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
415 +
416 + # Fix texi2html build error with new texi2html, qemu.doc.html
417 + sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
418 +
419 + use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
420 + sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
421 + -i tools/firmware/Makefile || die
422 +
423 + # Drop .config, fixes to gcc-4.6
424 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
425 +
426 + # drop flags
427 + unset CFLAGS
428 + unset LDFLAGS
429 + unset ASFLAGS
430 + unset CPPFLAGS
431 +
432 + if ! use pygrub; then
433 + sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
434 + fi
435 +
436 + if ! use python; then
437 + sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
438 + fi
439 +
440 + if ! use hvm; then
441 + sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
442 + # Bug 351648
443 + elif ! use x86 && ! has x86 $(get_all_abis); then
444 + mkdir -p "${WORKDIR}"/extra-headers/gnu || die
445 + touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
446 + export CPATH="${WORKDIR}"/extra-headers
447 + fi
448 +
449 + if use qemu; then
450 + if use sdl; then
451 + sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
452 + tools/Makefile || die
453 + else
454 + sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
455 + tools/qemu-xen-traditional/xen-setup || die
456 + sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
457 + tools/Makefile || die
458 + fi
459 + else
460 + # Don't bother with qemu, only needed for fully virtualised guests
461 + sed -i '/SUBDIRS-$(CONFIG_QEMU_XEN)/s/^/#/g' tools/Makefile || die
462 + fi
463 +
464 + # Reset bash completion dir; Bug 472438
465 + sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
466 + -i Config.mk || die
467 +
468 + # xencommons, Bug #492332, sed lighter weight than patching
469 + sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
470 + -i tools/hotplug/Linux/init.d/xencommons.in || die
471 +
472 + # fix bashishm
473 + sed -e '/Usage/s/\$//g' \
474 + -i tools/hotplug/Linux/init.d/xendriverdomain.in || die
475 +
476 + # respect multilib, usr/lib/libcacard.so.0.0.0
477 + sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
478 + -i tools/qemu-xen/configure || die
479 +
480 + #bug 518136, don't build 32bit exactuable for nomultilib profile
481 + if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
482 + sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
483 + fi
484 +
485 + # uncomment lines in xl.conf
486 + sed -e 's:^#autoballoon=:autoballoon=:' \
487 + -e 's:^#lockfile=:lockfile=:' \
488 + -e 's:^#vif.default.script=:vif.default.script=:' \
489 + -i tools/examples/xl.conf || die
490 +
491 + # disable capstone (Bug #673474)
492 + sed -e "s:\$\$source/configure:\0 --disable-capstone:" \
493 + -i tools/Makefile || die
494 +
495 + # disable glusterfs
496 + sed -e "s:\$\$source/configure:\0 --disable-glusterfs:" \
497 + -i tools/Makefile || die
498 +
499 + # disable jpeg automagic
500 + sed -e "s:\$\$source/configure:\0 --disable-vnc-jpeg:" \
501 + -i tools/Makefile || die
502 +
503 + # disable png automagic
504 + sed -e "s:\$\$source/configure:\0 --disable-vnc-png:" \
505 + -i tools/Makefile || die
506 +
507 + # disable docker (Bug #732970)
508 + sed -e "s:\$\$source/configure:\0 --disable-containers:" \
509 + -i tools/Makefile || die
510 +
511 + # disable abi-dumper (Bug #791172)
512 + sed -e 's/$(ABI_DUMPER) /echo /g' \
513 + -i tools/libs/libs.mk || die
514 +
515 + default
516 +}
517 +
518 +src_configure() {
519 + local myconf="--prefix=${PREFIX}/usr \
520 + --libdir=${PREFIX}/usr/$(get_libdir) \
521 + --libexecdir=${PREFIX}/usr/libexec \
522 + --localstatedir=${EPREFIX}/var \
523 + --disable-golang \
524 + --disable-werror \
525 + --disable-xen \
526 + --enable-tools \
527 + --enable-docs \
528 + $(use_enable api xenapi) \
529 + $(use_enable ipxe) \
530 + $(usex system-ipxe '--with-system-ipxe=/usr/share/ipxe' '') \
531 + $(use_enable ocaml ocamltools) \
532 + $(use_enable ovmf) \
533 + $(use_enable pam) \
534 + $(use_enable rombios) \
535 + --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
536 + "
537 +
538 + use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
539 + use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
540 + use amd64 && myconf+=" $(use_enable qemu-traditional)"
541 + tc-ld-disable-gold # Bug 669570
542 + econf ${myconf}
543 +}
544 +
545 +src_compile() {
546 + local myopt
547 + use debug && myopt="${myopt} debug=y"
548 + use python && myopt="${myopt} XENSTAT_PYTHON_BINDINGS=y"
549 +
550 + if test-flag-CC -fno-strict-overflow; then
551 + append-flags -fno-strict-overflow
552 + fi
553 +
554 + emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" build-tools ${myopt}
555 +
556 + if use doc; then
557 + emake -C docs build
558 + else
559 + emake -C docs man-pages
560 + fi
561 +}
562 +
563 +src_install() {
564 + # Override auto-detection in the build system, bug #382573
565 + export INITD_DIR=/tmp/init.d
566 + export CONFIG_LEAF_DIR=../tmp/default
567 +
568 + # Let the build system compile installed Python modules.
569 + local PYTHONDONTWRITEBYTECODE
570 + export PYTHONDONTWRITEBYTECODE
571 +
572 + emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
573 + XEN_PYTHON_NATIVE_INSTALL=y install-tools
574 +
575 + # Created at runtime
576 + rm -rv "${ED}/var/run" || die
577 +
578 + # Fix the remaining Python shebangs.
579 + python_fix_shebang "${D}"
580 +
581 + # Remove RedHat-specific stuff
582 + rm -rf "${D}"/tmp || die
583 +
584 + if use doc; then
585 + emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
586 + dodoc -r docs/{pdf,txt}
587 + else
588 + emake -C docs DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-man-pages # Bug 668032
589 + fi
590 + dodoc ${DOCS[@]}
591 +
592 + newconfd "${FILESDIR}"/xendomains.confd xendomains
593 + newconfd "${FILESDIR}"/xenstored.confd xenstored
594 + newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
595 + newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
596 + newinitd "${FILESDIR}"/xenstored.initd-r1 xenstored
597 + newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
598 + newinitd "${FILESDIR}"/xencommons.initd xencommons
599 + newconfd "${FILESDIR}"/xencommons.confd xencommons
600 + newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
601 + newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
602 + newinitd "${FILESDIR}"/xen-watchdog.initd xen-watchdog
603 +
604 + if use screen; then
605 + cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
606 + cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
607 + keepdir /var/log/xen-consoles
608 + fi
609 +
610 + # For -static-libs wrt Bug 384355
611 + if ! use static-libs; then
612 + rm -f "${D}"/usr/$(get_libdir)/*.a "${D}"/usr/$(get_libdir)/ocaml/*/*.a
613 + fi
614 +
615 + # for xendomains
616 + keepdir /etc/xen/auto
617 +
618 + # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
619 + find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
620 + -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
621 +
622 + keepdir /var/lib/xen/dump
623 + keepdir /var/lib/xen/xenpaging
624 + keepdir /var/lib/xenstored
625 + keepdir /var/log/xen
626 +
627 + if use python; then
628 + python_domodule "${S}/tools/libs/stat/bindings/swig/python/xenstat.py"
629 + python_domodule "${S}/tools/libs/stat/bindings/swig/python/_xenstat.so"
630 + fi
631 +
632 + python_optimize
633 +}
634 +
635 +pkg_postinst() {
636 + elog "Official Xen Guide and the offical wiki page:"
637 + elog "https://wiki.gentoo.org/wiki/Xen"
638 + elog "https://wiki.xen.org/wiki/Main_Page"
639 + elog ""
640 + elog "Recommended to utilise the xencommons script to config system at boot"
641 + elog "Add by use of rc-update on completion of the install"
642 +
643 + if ! use hvm; then
644 + echo
645 + elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
646 + elog "support enable the hvm use flag."
647 + elog "An x86 or amd64 system is required to build HVM support."
648 + fi
649 +
650 + if use qemu; then
651 + elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
652 + elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
653 + elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
654 + elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
655 + fi
656 +}