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