Gentoo Archives: gentoo-commits

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