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/
Date: Fri, 11 Jun 2021 12:53:26
Message-Id: 1623415741.0917d6724141de60252c3eca91f6a17f0ca3945a.whissi@gentoo
1 commit: 0917d6724141de60252c3eca91f6a17f0ca3945a
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Wed Jun 9 07:20:05 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 11 12:49:01 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0917d672
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/21168
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 app-emulation/xen-tools/Manifest | 1 -
15 app-emulation/xen-tools/xen-tools-4.14.2.ebuild | 525 -----------------------
16 app-emulation/xen-tools/xen-tools-4.15.0.ebuild | 532 ------------------------
17 3 files changed, 1058 deletions(-)
18
19 diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
20 index 7361faa508b..8b92236e06b 100644
21 --- a/app-emulation/xen-tools/Manifest
22 +++ b/app-emulation/xen-tools/Manifest
23 @@ -9,7 +9,6 @@ DIST seabios-1.14.0.tar.gz 628985 BLAKE2B cc1126925dab1551a655680d20d06ebf28c12c
24 DIST xen-4.13.3.tar.gz 39044539 BLAKE2B 5d0e57c76e12e1b86b78bbf561e947d70b9569a24412617a640346d2358b141a2741e7a3be454df52d198ad63e58b1519288de62330417c70e72445703f3fac2 SHA512 622127d824b9c49b57282a887fb404e0bad05ff60bccade82e4e0e9b5ad975ff9aa1fba83392e6d8379e9a15340e8ae9785c0913eb11027816e4600432eea6b6
25 DIST xen-4.14.2-upstream-patches-0.tar.xz 23304 BLAKE2B 954e0a49e5c3ec122aefe52afe328f440b8a4c8db966e0fa91e0b6d6cb3c0462b75fb99b3e7392811bd2e680cd7945e8a4d68317245fd42fdf0ad6cab33fbc68 SHA512 64d243f0c8acfec87812e4d78e3d8b24a86315824853f4f3b17122b7119425d180650695bc12e1a30f5b30c6ef684be7c08b2bc677ca2f0668d0335d92e2bf78
26 DIST xen-4.14.2.tar.gz 39973157 BLAKE2B db5d3570f79e0fd97872f5e5dd57a4eb39e005728387bfef3b51fabe1c693cfd8108d09b1026f5a5a7eb79de71be6f4af36d252f7e0b35a65a1567b7949e3e29 SHA512 83c9333b70dbee3e29c6bf08e5ad030676e6c4a32b976f3f5e6a8f8d0dd9e4898bac88dd8e1c9d2ad3509cebb5d212e1745f9392a469d7afeb841d79801ccf39
27 -DIST xen-4.15.0-upstream-patches-0.tar.xz 15744 BLAKE2B e2abb68524a7c190db8d91beb79731aea5290e82f54fb21218739dab666f6f5ea85c203575ec248b46830f1862408d50d3ceea1104fcd9325babfccf3574c515 SHA512 f1a2800d15a61f08eda4d6bafaead95a9d72cc9e4d90a19278d89c696b7e2d5d6353b28dba7ed0eb0c9aeb8604d3697db6a8f4ac38047e2510279d88181752f9
28 DIST xen-4.15.0-upstream-patches-1.tar.xz 35180 BLAKE2B eb3b2a44b717a04daa4a2f158040cce78b42cba5a72c437d7b2f8f1237b808f6f13c2140d82e95056818db6c0eb706ebd7dead822a6a4e689e5d5e7c83523fdb SHA512 a7cfe2dbc82b15c48fa781a77b3ca1622fc2feac3874bf17cf56e82be46e9817913f94992e0e1a1cd2be2e719d4abb9a15744c8a1017e30c0d5c01d7db64dbb5
29 DIST xen-4.15.0.tar.gz 40785399 BLAKE2B 8b0530f5516c39656506f4bb705952da0555a8ab7f47323473b171caeb7692f3107e9d94f13171d40576600064589eed35f4d210af02db4cc4706dd4fc202100 SHA512 93683b8a97387ca5f003c635a11d163e61c87dbdc9a03081f9155fe87b49f1dfa74ce243fcd5e04dc009353a36e2375b786f1ebde828b5951a094cd64197b4c7
30 DIST xen-gentoo-patches-21.tar.xz 18280 BLAKE2B 95446da72fc16cb82e4e51df8796c64db05a30894a351a98dbd6700ce354c34956ca09a1af98125a4e56c337936e8fae296d806519b8afa23a82b078aa0db8f1 SHA512 3cffac162606a09b10b47dca604f167897e6ac8d153411d3464ef29a7a4d46ac5b92340884cb21279cb2d053b131f1ea5cb2111e3e9a21b3298b5ab3320ee34d
31
32 diff --git a/app-emulation/xen-tools/xen-tools-4.14.2.ebuild b/app-emulation/xen-tools/xen-tools-4.14.2.ebuild
33 deleted file mode 100644
34 index 112aaab069f..00000000000
35 --- a/app-emulation/xen-tools/xen-tools-4.14.2.ebuild
36 +++ /dev/null
37 @@ -1,525 +0,0 @@
38 -# Copyright 1999-2021 Gentoo Authors
39 -# Distributed under the terms of the GNU General Public License v2
40 -
41 -EAPI=7
42 -
43 -PYTHON_COMPAT=( python3_{7..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=
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="06dc822d045c2bb42e497487935485302486e151"
68 - EDK2_OPENSSL_VERSION="1_1_1g"
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://www.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 flask +hvm +ipxe ocaml ovmf +pam pygrub python +qemu +qemu-traditional +rombios screen 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 -DEPEND="${COMMON_DEPEND}
133 - app-misc/pax-utils
134 - dev-lang/perl
135 - >=sys-kernel/linux-headers-4.11
136 - x11-libs/pixman
137 - $(python_gen_cond_dep '
138 - dev-python/lxml[${PYTHON_MULTI_USEDEP}]
139 - pam? ( dev-python/pypam[${PYTHON_MULTI_USEDEP}] )
140 - ')
141 - x86? ( sys-devel/dev86
142 - system-ipxe? ( sys-firmware/ipxe[qemu] )
143 - sys-power/iasl )
144 - api? ( dev-libs/libxml2
145 - net-misc/curl )
146 -
147 - ovmf? (
148 - !arm? ( !arm64? ( dev-lang/nasm ) )
149 - $(python_gen_impl_dep sqlite)
150 - )
151 - !amd64? ( >=sys-apps/dtc-1.4.0 )
152 - amd64? ( sys-power/iasl
153 - system-seabios? ( sys-firmware/seabios )
154 - system-ipxe? ( sys-firmware/ipxe[qemu] )
155 - rombios? ( sys-devel/bin86 sys-devel/dev86 ) )
156 - doc? (
157 - app-text/ghostscript-gpl
158 - app-text/pandoc
159 - $(python_gen_cond_dep '
160 - dev-python/markdown[${PYTHON_MULTI_USEDEP}]
161 - ')
162 - dev-texlive/texlive-latexextra
163 - media-gfx/transfig
164 - )
165 - hvm? ( x11-base/xorg-proto )
166 - qemu? (
167 - app-arch/snappy:=
168 - sdl? (
169 - media-libs/libsdl[X]
170 - media-libs/libsdl2[X]
171 - )
172 - )
173 - system-qemu? ( app-emulation/qemu[xen] )
174 - ocaml? ( dev-ml/findlib
175 - >=dev-lang/ocaml-4 )
176 - python? ( >=dev-lang/swig-4.0.0 )"
177 -
178 -RDEPEND="${COMMON_DEPEND}
179 - sys-apps/iproute2[-minimal]
180 - net-misc/bridge-utils
181 - screen? (
182 - app-misc/screen
183 - app-admin/logrotate
184 - )"
185 -
186 -# hvmloader is used to bootstrap a fully virtualized kernel
187 -# Approved by QA team in bug #144032
188 -QA_WX_LOAD="
189 - usr/libexec/xen/boot/hvmloader
190 - usr/share/qemu-xen/qemu/hppa-firmware.img
191 - usr/share/qemu-xen/qemu/s390-ccw.img
192 - usr/share/qemu-xen/qemu/u-boot.e500
193 -"
194 -
195 -QA_PREBUILT="
196 - usr/libexec/xen/bin/elf2dmp
197 - usr/libexec/xen/bin/ivshmem-client
198 - usr/libexec/xen/bin/ivshmem-server
199 - usr/libexec/xen/bin/qemu-edid
200 - usr/libexec/xen/bin/qemu-img
201 - usr/libexec/xen/bin/qemu-io
202 - usr/libexec/xen/bin/qemu-keymap
203 - usr/libexec/xen/bin/qemu-nbd
204 - usr/libexec/xen/bin/qemu-pr-helper
205 - usr/libexec/xen/bin/qemu-system-i386
206 - usr/libexec/xen/bin/virtfs-proxy-helper
207 - usr/libexec/xen/libexec/xen-bridge-helper
208 - usr/share/qemu-xen/qemu/s390-ccw.img
209 - usr/share/qemu-xen/qemu/s390-netboot.img
210 - usr/share/qemu-xen/qemu/u-boot.e500
211 -"
212 -
213 -RESTRICT="test"
214 -
215 -pkg_setup() {
216 - python_setup
217 - export "CONFIG_LOMOUNT=y"
218 -
219 - #bug 522642, disable compile tools/tests
220 - export "CONFIG_TESTS=n"
221 -
222 - if [[ -z ${XEN_TARGET_ARCH} ]] ; then
223 - if use x86 && use amd64; then
224 - die "Confusion! Both x86 and amd64 are set in your use flags!"
225 - elif use x86; then
226 - export XEN_TARGET_ARCH="x86_32"
227 - elif use amd64 ; then
228 - export XEN_TARGET_ARCH="x86_64"
229 - elif use arm; then
230 - export XEN_TARGET_ARCH="arm32"
231 - elif use arm64; then
232 - export XEN_TARGET_ARCH="arm64"
233 - else
234 - die "Unsupported architecture!"
235 - fi
236 - fi
237 -}
238 -
239 -src_prepare() {
240 - local i
241 -
242 - # Upstream's patchset
243 - if [[ -n ${UPSTREAM_VER} ]]; then
244 - einfo "Try to apply Xen Upstream patch set"
245 - eapply "${WORKDIR}"/patches-upstream
246 - fi
247 -
248 - # Security patchset
249 - if [[ -n ${SECURITY_VER} ]]; then
250 - einfo "Try to apply Xen Security patch set"
251 - # apply main xen patches
252 - # Two parallel systems, both work side by side
253 - # Over time they may concdense into one. This will suffice for now
254 - EPATCH_SUFFIX="patch"
255 - EPATCH_FORCE="yes"
256 -
257 - source "${WORKDIR}"/patches-security/${PV}.conf || die
258 -
259 - for i in ${XEN_SECURITY_MAIN}; do
260 - eapply "${WORKDIR}"/patches-security/xen/$i
261 - done
262 -
263 - # apply qemu-xen/upstream patches
264 - pushd "${S}"/tools/qemu-xen/ > /dev/null
265 - for i in ${XEN_SECURITY_QEMUU}; do
266 - eapply "${WORKDIR}"/patches-security/qemuu/$i
267 - done
268 - popd > /dev/null
269 -
270 - # apply qemu-traditional patches
271 - pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
272 - for i in ${XEN_SECURITY_QEMUT}; do
273 - eapply "${WORKDIR}"/patches-security/qemut/$i
274 - done
275 - popd > /dev/null
276 - fi
277 -
278 - # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
279 - mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
280 - pushd tools/firmware/ > /dev/null
281 - ln -s seabios-dir-remote seabios-dir || die
282 - popd > /dev/null
283 -
284 - # Gentoo's patchset
285 - if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
286 - einfo "Try to apply Gentoo specific patch set"
287 - source "${FILESDIR}"/gentoo-patches.conf || die
288 - _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
289 - for i in ${!_gpv}; do
290 - eapply "${WORKDIR}"/patches-gentoo/$i
291 - done
292 - fi
293 -
294 - # Ovmf's patchset
295 - if use ovmf; then
296 - if [[ -n ${OVMF_VER} ]];then
297 - einfo "Try to apply Ovmf patch set"
298 - pushd "${WORKDIR}"/edk2-*/ > /dev/null
299 - eapply "${WORKDIR}"/patches-ovmf
300 - popd > /dev/null
301 - fi
302 - mv ../edk2-${EDK2_COMMIT} tools/firmware/ovmf-dir-remote || die
303 - rm -r tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl || die
304 - rm -r tools/firmware/ovmf-dir-remote/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 || die
305 - rm -r tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli || die
306 - rm -r tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli || die
307 - mv ../openssl-OpenSSL_${EDK2_OPENSSL_VERSION} tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl || die
308 - mv ../berkeley-softfloat-3-${EDK2_SOFTFLOAT_COMMIT} tools/firmware/ovmf-dir-remote/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 || die
309 - cp -r ../brotli-${EDK2_BROTLI_COMMIT} tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli || die
310 - cp -r ../brotli-${EDK2_BROTLI_COMMIT} tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli || die
311 - cp tools/firmware/ovmf-makefile tools/firmware/ovmf-dir-remote/Makefile || die
312 - fi
313 -
314 - # ipxe
315 - if use ipxe; then
316 - cp "${DISTDIR}/ipxe-git-${IPXE_COMMIT}.tar.gz" tools/firmware/etherboot/_ipxe.tar.gz || die
317 -
318 - # gcc 11
319 - cp "${WORKDIR}/patches-gentoo/xen-tools-4.15.0-ipxe-gcc11.patch" tools/firmware/etherboot/patches/ipxe-gcc11.patch || die
320 - echo ipxe-gcc11.patch >> tools/firmware/etherboot/patches/series || die
321 - fi
322 -
323 - mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
324 -
325 - # Fix texi2html build error with new texi2html, qemu.doc.html
326 - sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
327 -
328 - use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
329 - sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
330 - -i tools/firmware/Makefile || die
331 -
332 - # Drop .config, fixes to gcc-4.6
333 - sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
334 -
335 - # drop flags
336 - unset CFLAGS
337 - unset LDFLAGS
338 - unset ASFLAGS
339 - unset CPPFLAGS
340 -
341 - if ! use pygrub; then
342 - sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
343 - fi
344 -
345 - if ! use python; then
346 - sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
347 - fi
348 -
349 - if ! use hvm; then
350 - sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
351 - # Bug 351648
352 - elif ! use x86 && ! has x86 $(get_all_abis); then
353 - mkdir -p "${WORKDIR}"/extra-headers/gnu || die
354 - touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
355 - export CPATH="${WORKDIR}"/extra-headers
356 - fi
357 -
358 - if use qemu; then
359 - if use sdl; then
360 - sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
361 - tools/Makefile || die
362 - else
363 - sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
364 - tools/qemu-xen-traditional/xen-setup || die
365 - sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
366 - tools/Makefile || die
367 - fi
368 - else
369 - # Don't bother with qemu, only needed for fully virtualised guests
370 - sed -i '/SUBDIRS-$(CONFIG_QEMU_XEN)/s/^/#/g' tools/Makefile || die
371 - fi
372 -
373 - # Reset bash completion dir; Bug 472438
374 - sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
375 - -i Config.mk || die
376 - sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
377 -
378 - # xencommons, Bug #492332, sed lighter weight than patching
379 - sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
380 - -i tools/hotplug/Linux/init.d/xencommons.in || die
381 -
382 - # fix bashishm
383 - sed -e '/Usage/s/\$//g' \
384 - -i tools/hotplug/Linux/init.d/xendriverdomain.in || die
385 -
386 - # respect multilib, usr/lib/libcacard.so.0.0.0
387 - sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
388 - -i tools/qemu-xen/configure || die
389 -
390 - #bug 518136, don't build 32bit exactuable for nomultilib profile
391 - if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
392 - sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
393 - fi
394 -
395 - # uncomment lines in xl.conf
396 - sed -e 's:^#autoballoon=:autoballoon=:' \
397 - -e 's:^#lockfile=:lockfile=:' \
398 - -e 's:^#vif.default.script=:vif.default.script=:' \
399 - -i tools/examples/xl.conf || die
400 -
401 - # disable capstone (Bug #673474)
402 - sed -e "s:\$\$source/configure:\0 --disable-capstone:" \
403 - -i tools/Makefile || die
404 -
405 - # disable glusterfs
406 - sed -e "s:\$\$source/configure:\0 --disable-glusterfs:" \
407 - -i tools/Makefile || die
408 -
409 - # disable jpeg automagic
410 - sed -e "s:\$\$source/configure:\0 --disable-vnc-jpeg:" \
411 - -i tools/Makefile || die
412 -
413 - # disable png automagic
414 - sed -e "s:\$\$source/configure:\0 --disable-vnc-png:" \
415 - -i tools/Makefile || die
416 -
417 - # disable docker (Bug #732970)
418 - sed -e "s:\$\$source/configure:\0 --disable-containers:" \
419 - -i tools/Makefile || die
420 -
421 - default
422 -}
423 -
424 -src_configure() {
425 - local myconf="--prefix=${PREFIX}/usr \
426 - --libdir=${PREFIX}/usr/$(get_libdir) \
427 - --libexecdir=${PREFIX}/usr/libexec \
428 - --localstatedir=${EPREFIX}/var \
429 - --disable-golang \
430 - --disable-werror \
431 - --disable-xen \
432 - --enable-tools \
433 - --enable-docs \
434 - $(use_enable api xenapi) \
435 - $(use_enable ipxe) \
436 - $(usex system-ipxe '--with-system-ipxe=/usr/share/ipxe' '') \
437 - $(use_enable ocaml ocamltools) \
438 - $(use_enable ovmf) \
439 - $(use_enable pam) \
440 - $(use_enable rombios) \
441 - --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
442 - "
443 -
444 - use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
445 - use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
446 - use amd64 && myconf+=" $(use_enable qemu-traditional)"
447 - tc-ld-disable-gold # Bug 669570
448 - econf ${myconf}
449 -}
450 -
451 -src_compile() {
452 - local myopt
453 - use debug && myopt="${myopt} debug=y"
454 - use python && myopt="${myopt} XENSTAT_PYTHON_BINDINGS=y"
455 -
456 - if test-flag-CC -fno-strict-overflow; then
457 - append-flags -fno-strict-overflow
458 - fi
459 -
460 - emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" build-tools ${myopt}
461 -
462 - if use doc; then
463 - emake -C docs build
464 - else
465 - emake -C docs man-pages
466 - fi
467 -}
468 -
469 -src_install() {
470 - # Override auto-detection in the build system, bug #382573
471 - export INITD_DIR=/tmp/init.d
472 - export CONFIG_LEAF_DIR=../tmp/default
473 -
474 - # Let the build system compile installed Python modules.
475 - local PYTHONDONTWRITEBYTECODE
476 - export PYTHONDONTWRITEBYTECODE
477 -
478 - emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
479 - XEN_PYTHON_NATIVE_INSTALL=y install-tools
480 -
481 - # Created at runtime
482 - rm -rv "${ED}/var/run" || die
483 -
484 - # Fix the remaining Python shebangs.
485 - python_fix_shebang "${D}"
486 -
487 - # Remove RedHat-specific stuff
488 - rm -rf "${D}"/tmp || die
489 -
490 - if use doc; then
491 - emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
492 - dodoc -r docs/{pdf,txt}
493 - else
494 - emake -C docs DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-man-pages # Bug 668032
495 - fi
496 - dodoc ${DOCS[@]}
497 -
498 - newconfd "${FILESDIR}"/xendomains.confd xendomains
499 - newconfd "${FILESDIR}"/xenstored.confd xenstored
500 - newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
501 - newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
502 - newinitd "${FILESDIR}"/xenstored.initd-r1 xenstored
503 - newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
504 - newinitd "${FILESDIR}"/xencommons.initd xencommons
505 - newconfd "${FILESDIR}"/xencommons.confd xencommons
506 - newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
507 - newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
508 - newinitd "${FILESDIR}"/xen-watchdog.initd xen-watchdog
509 -
510 - if use screen; then
511 - cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
512 - cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
513 - keepdir /var/log/xen-consoles
514 - fi
515 -
516 - # For -static-libs wrt Bug 384355
517 - if ! use static-libs; then
518 - rm -f "${D}"/usr/$(get_libdir)/*.a "${D}"/usr/$(get_libdir)/ocaml/*/*.a
519 - fi
520 -
521 - # for xendomains
522 - keepdir /etc/xen/auto
523 -
524 - # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
525 - find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
526 - -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
527 -
528 - keepdir /var/lib/xen/dump
529 - keepdir /var/lib/xen/xenpaging
530 - keepdir /var/lib/xenstored
531 - keepdir /var/log/xen
532 -
533 - if use python; then
534 - python_domodule "${S}/tools/xenstat/libxenstat/bindings/swig/python/xenstat.py"
535 - python_domodule "${S}/tools/xenstat/libxenstat/bindings/swig/python/_xenstat.so"
536 - fi
537 -
538 - python_optimize
539 -}
540 -
541 -pkg_postinst() {
542 - elog "Official Xen Guide and the offical wiki page:"
543 - elog "https://wiki.gentoo.org/wiki/Xen"
544 - elog "https://wiki.xen.org/wiki/Main_Page"
545 - elog ""
546 - elog "Recommended to utilise the xencommons script to config system at boot"
547 - elog "Add by use of rc-update on completion of the install"
548 -
549 - if ! use hvm; then
550 - echo
551 - elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
552 - elog "support enable the hvm use flag."
553 - elog "An x86 or amd64 system is required to build HVM support."
554 - fi
555 -
556 - if use qemu; then
557 - elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
558 - elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
559 - elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
560 - elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
561 - fi
562 -}
563
564 diff --git a/app-emulation/xen-tools/xen-tools-4.15.0.ebuild b/app-emulation/xen-tools/xen-tools-4.15.0.ebuild
565 deleted file mode 100644
566 index c19f2eb37ad..00000000000
567 --- a/app-emulation/xen-tools/xen-tools-4.15.0.ebuild
568 +++ /dev/null
569 @@ -1,532 +0,0 @@
570 -# Copyright 1999-2021 Gentoo Authors
571 -# Distributed under the terms of the GNU General Public License v2
572 -
573 -EAPI=7
574 -
575 -PYTHON_COMPAT=( python3_{7..9} )
576 -PYTHON_REQ_USE='ncurses,xml,threads(+)'
577 -
578 -inherit bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs
579 -
580 -MY_PV=${PV/_/-}
581 -
582 -if [[ ${PV} == *9999 ]]; then
583 - inherit git-r3
584 - REPO="xen.git"
585 - EGIT_REPO_URI="git://xenbits.xen.org/${REPO}"
586 - S="${WORKDIR}/${REPO}"
587 -else
588 - KEYWORDS="~amd64 ~arm ~arm64 ~x86"
589 - UPSTREAM_VER=0
590 - SECURITY_VER=
591 - # xen-tools's gentoo patches tarball
592 - GENTOO_VER=23
593 - # xen-tools's gentoo patches version which apply to this specific ebuild
594 - GENTOO_GPV=0
595 - # xen-tools ovmf's patches
596 - OVMF_VER=
597 -
598 - SEABIOS_VER="1.14.0"
599 - EDK2_COMMIT="06dc822d045c2bb42e497487935485302486e151"
600 - EDK2_OPENSSL_VERSION="1_1_1g"
601 - EDK2_SOFTFLOAT_COMMIT="b64af41c3276f97f0e181920400ee056b9c88037"
602 - EDK2_BROTLI_COMMIT="666c3280cc11dc433c303d79a83d4ffbdd12cc8d"
603 - IPXE_COMMIT="988d2c13cdf0f0b4140685af35ced70ac5b3283c"
604 -
605 - [[ -n ${UPSTREAM_VER} ]] && \
606 - UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz
607 - https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
608 - [[ -n ${SECURITY_VER} ]] && \
609 - SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz
610 - https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${PN/-tools/}-security-patches-${SECURITY_VER}.tar.xz"
611 - [[ -n ${GENTOO_VER} ]] && \
612 - GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz
613 - https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${PN/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
614 - [[ -n ${OVMF_VER} ]] && \
615 - OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
616 -
617 - SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/xen-${MY_PV}.tar.gz
618 - https://www.seabios.org/downloads/seabios-${SEABIOS_VER}.tar.gz
619 - ipxe? ( http://xenbits.xen.org/xen-extfiles/ipxe-git-${IPXE_COMMIT}.tar.gz )
620 - ovmf? ( https://github.com/tianocore/edk2/archive/${EDK2_COMMIT}.tar.gz -> edk2-${EDK2_COMMIT}.tar.gz
621 - https://github.com/openssl/openssl/archive/OpenSSL_${EDK2_OPENSSL_VERSION}.tar.gz
622 - https://github.com/ucb-bar/berkeley-softfloat-3/archive/${EDK2_SOFTFLOAT_COMMIT}.tar.gz -> berkeley-softfloat-${EDK2_SOFTFLOAT_COMMIT}.tar.gz
623 - https://github.com/google/brotli/archive/${EDK2_BROTLI_COMMIT}.tar.gz -> brotli-${EDK2_BROTLI_COMMIT}.tar.gz
624 - ${OVMF_PATCHSET_URI} )
625 - ${UPSTREAM_PATCHSET_URI}
626 - ${SECURITY_PATCHSET_URI}
627 - ${GENTOO_PATCHSET_URI}"
628 -
629 - S="${WORKDIR}/xen-${MY_PV}"
630 -fi
631 -
632 -DESCRIPTION="Xen tools including QEMU and xl"
633 -HOMEPAGE="https://www.xenproject.org"
634 -DOCS=( README )
635 -
636 -LICENSE="GPL-2"
637 -SLOT="0/$(ver_cut 1-2)"
638 -# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
639 -# >=dev-lang/ocaml-4 stable
640 -# Masked in profiles/eapi-5-files instead
641 -IUSE="api debug doc flask +hvm +ipxe ocaml ovmf +pam pygrub python +qemu +qemu-traditional +rombios screen sdl static-libs system-ipxe system-qemu system-seabios"
642 -
643 -REQUIRED_USE="
644 - ${PYTHON_REQUIRED_USE}
645 - ipxe? ( rombios )
646 - ovmf? ( hvm )
647 - pygrub? ( python )
648 - rombios? ( hvm )
649 - system-ipxe? ( rombios )
650 - ?? ( ipxe system-ipxe )
651 - ?? ( qemu system-qemu )"
652 -
653 -COMMON_DEPEND="
654 - sys-apps/pciutils
655 - dev-libs/lzo:2
656 - dev-libs/glib:2
657 - dev-libs/yajl
658 - dev-libs/libaio
659 - dev-libs/libgcrypt:0
660 - sys-libs/zlib
661 - ${PYTHON_DEPS}
662 -"
663 -
664 -DEPEND="${COMMON_DEPEND}
665 - app-misc/pax-utils
666 - dev-lang/perl
667 - >=sys-kernel/linux-headers-4.11
668 - x11-libs/pixman
669 - $(python_gen_cond_dep '
670 - dev-python/lxml[${PYTHON_MULTI_USEDEP}]
671 - pam? ( dev-python/pypam[${PYTHON_MULTI_USEDEP}] )
672 - ')
673 - x86? ( sys-devel/dev86
674 - system-ipxe? ( sys-firmware/ipxe[qemu] )
675 - sys-power/iasl )
676 - api? ( dev-libs/libxml2
677 - net-misc/curl )
678 -
679 - ovmf? (
680 - !arm? ( !arm64? ( dev-lang/nasm ) )
681 - $(python_gen_impl_dep sqlite)
682 - )
683 - !amd64? ( >=sys-apps/dtc-1.4.0 )
684 - amd64? ( sys-power/iasl
685 - system-seabios? ( sys-firmware/seabios )
686 - system-ipxe? ( sys-firmware/ipxe[qemu] )
687 - rombios? ( sys-devel/bin86 sys-devel/dev86 ) )
688 - doc? (
689 - app-text/ghostscript-gpl
690 - app-text/pandoc
691 - $(python_gen_cond_dep '
692 - dev-python/markdown[${PYTHON_MULTI_USEDEP}]
693 - ')
694 - dev-texlive/texlive-latexextra
695 - media-gfx/transfig
696 - )
697 - hvm? ( x11-base/xorg-proto )
698 - qemu? (
699 - app-arch/snappy:=
700 - sdl? (
701 - media-libs/libsdl[X]
702 - media-libs/libsdl2[X]
703 - )
704 - )
705 - system-qemu? ( app-emulation/qemu[xen] )
706 - ocaml? ( dev-ml/findlib
707 - >=dev-lang/ocaml-4 )
708 - python? ( >=dev-lang/swig-4.0.0 )"
709 -
710 -RDEPEND="${COMMON_DEPEND}
711 - sys-apps/iproute2[-minimal]
712 - net-misc/bridge-utils
713 - screen? (
714 - app-misc/screen
715 - app-admin/logrotate
716 - )"
717 -
718 -# hvmloader is used to bootstrap a fully virtualized kernel
719 -# Approved by QA team in bug #144032
720 -QA_WX_LOAD="
721 - usr/libexec/xen/boot/hvmloader
722 - usr/libexec/xen/boot/xen-shim
723 - usr/share/qemu-xen/qemu/hppa-firmware.img
724 - usr/share/qemu-xen/qemu/s390-ccw.img
725 - usr/share/qemu-xen/qemu/u-boot.e500
726 -"
727 -
728 -QA_PREBUILT="
729 - usr/libexec/xen/bin/elf2dmp
730 - usr/libexec/xen/bin/ivshmem-client
731 - usr/libexec/xen/bin/ivshmem-server
732 - usr/libexec/xen/bin/qemu-edid
733 - usr/libexec/xen/bin/qemu-img
734 - usr/libexec/xen/bin/qemu-io
735 - usr/libexec/xen/bin/qemu-keymap
736 - usr/libexec/xen/bin/qemu-nbd
737 - usr/libexec/xen/bin/qemu-pr-helper
738 - usr/libexec/xen/bin/qemu-storage-daemon
739 - usr/libexec/xen/bin/qemu-system-i386
740 - usr/libexec/xen/bin/virtfs-proxy-helper
741 - usr/libexec/xen/boot/xen-shim
742 - usr/libexec/xen/libexec/qemu-pr-helper
743 - usr/libexec/xen/libexec/virtfs-proxy-helper
744 - usr/libexec/xen/libexec/virtiofsd
745 - usr/libexec/xen/libexec/xen-bridge-helper
746 - usr/share/qemu-xen/qemu/s390-ccw.img
747 - usr/share/qemu-xen/qemu/s390-netboot.img
748 - usr/share/qemu-xen/qemu/u-boot.e500
749 -"
750 -
751 -RESTRICT="test"
752 -
753 -pkg_setup() {
754 - python_setup
755 - export "CONFIG_LOMOUNT=y"
756 -
757 - #bug 522642, disable compile tools/tests
758 - export "CONFIG_TESTS=n"
759 -
760 - if [[ -z ${XEN_TARGET_ARCH} ]] ; then
761 - if use x86 && use amd64; then
762 - die "Confusion! Both x86 and amd64 are set in your use flags!"
763 - elif use x86; then
764 - export XEN_TARGET_ARCH="x86_32"
765 - elif use amd64 ; then
766 - export XEN_TARGET_ARCH="x86_64"
767 - elif use arm; then
768 - export XEN_TARGET_ARCH="arm32"
769 - elif use arm64; then
770 - export XEN_TARGET_ARCH="arm64"
771 - else
772 - die "Unsupported architecture!"
773 - fi
774 - fi
775 -}
776 -
777 -src_prepare() {
778 - local i
779 -
780 - # Upstream's patchset
781 - if [[ -n ${UPSTREAM_VER} ]]; then
782 - einfo "Try to apply Xen Upstream patch set"
783 - eapply "${WORKDIR}"/patches-upstream
784 - fi
785 -
786 - # Security patchset
787 - if [[ -n ${SECURITY_VER} ]]; then
788 - einfo "Try to apply Xen Security patch set"
789 - # apply main xen patches
790 - # Two parallel systems, both work side by side
791 - # Over time they may concdense into one. This will suffice for now
792 - EPATCH_SUFFIX="patch"
793 - EPATCH_FORCE="yes"
794 -
795 - source "${WORKDIR}"/patches-security/${PV}.conf || die
796 -
797 - for i in ${XEN_SECURITY_MAIN}; do
798 - eapply "${WORKDIR}"/patches-security/xen/$i
799 - done
800 -
801 - # apply qemu-xen/upstream patches
802 - pushd "${S}"/tools/qemu-xen/ > /dev/null
803 - for i in ${XEN_SECURITY_QEMUU}; do
804 - eapply "${WORKDIR}"/patches-security/qemuu/$i
805 - done
806 - popd > /dev/null
807 -
808 - # apply qemu-traditional patches
809 - pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
810 - for i in ${XEN_SECURITY_QEMUT}; do
811 - eapply "${WORKDIR}"/patches-security/qemut/$i
812 - done
813 - popd > /dev/null
814 - fi
815 -
816 - # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
817 - mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
818 - pushd tools/firmware/ > /dev/null
819 - ln -s seabios-dir-remote seabios-dir || die
820 - popd > /dev/null
821 -
822 - # Gentoo's patchset
823 - if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
824 - einfo "Try to apply Gentoo specific patch set"
825 - source "${FILESDIR}"/gentoo-patches.conf || die
826 - _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
827 - for i in ${!_gpv}; do
828 - eapply "${WORKDIR}"/patches-gentoo/$i
829 - done
830 - fi
831 -
832 - # Ovmf's patchset
833 - if use ovmf; then
834 - if [[ -n ${OVMF_VER} ]];then
835 - einfo "Try to apply Ovmf patch set"
836 - pushd "${WORKDIR}"/edk2-*/ > /dev/null
837 - eapply "${WORKDIR}"/patches-ovmf
838 - popd > /dev/null
839 - fi
840 - mv ../edk2-${EDK2_COMMIT} tools/firmware/ovmf-dir-remote || die
841 - rm -r tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl || die
842 - rm -r tools/firmware/ovmf-dir-remote/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 || die
843 - rm -r tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli || die
844 - rm -r tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli || die
845 - mv ../openssl-OpenSSL_${EDK2_OPENSSL_VERSION} tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl || die
846 - mv ../berkeley-softfloat-3-${EDK2_SOFTFLOAT_COMMIT} tools/firmware/ovmf-dir-remote/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 || die
847 - cp -r ../brotli-${EDK2_BROTLI_COMMIT} tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli || die
848 - cp -r ../brotli-${EDK2_BROTLI_COMMIT} tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli || die
849 - cp tools/firmware/ovmf-makefile tools/firmware/ovmf-dir-remote/Makefile || die
850 - fi
851 -
852 - # ipxe
853 - if use ipxe; then
854 - cp "${DISTDIR}/ipxe-git-${IPXE_COMMIT}.tar.gz" tools/firmware/etherboot/_ipxe.tar.gz || die
855 -
856 - # gcc 11
857 - cp "${WORKDIR}/patches-gentoo/${P}-ipxe-gcc11.patch" tools/firmware/etherboot/patches/ipxe-gcc11.patch || die
858 - echo ipxe-gcc11.patch >> tools/firmware/etherboot/patches/series || die
859 - fi
860 -
861 - mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
862 -
863 - # Fix texi2html build error with new texi2html, qemu.doc.html
864 - sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
865 -
866 - use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
867 - sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
868 - -i tools/firmware/Makefile || die
869 -
870 - # Drop .config, fixes to gcc-4.6
871 - sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
872 -
873 - # drop flags
874 - unset CFLAGS
875 - unset LDFLAGS
876 - unset ASFLAGS
877 - unset CPPFLAGS
878 -
879 - if ! use pygrub; then
880 - sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
881 - fi
882 -
883 - if ! use python; then
884 - sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
885 - fi
886 -
887 - if ! use hvm; then
888 - sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
889 - # Bug 351648
890 - elif ! use x86 && ! has x86 $(get_all_abis); then
891 - mkdir -p "${WORKDIR}"/extra-headers/gnu || die
892 - touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
893 - export CPATH="${WORKDIR}"/extra-headers
894 - fi
895 -
896 - if use qemu; then
897 - if use sdl; then
898 - sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
899 - tools/Makefile || die
900 - else
901 - sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
902 - tools/qemu-xen-traditional/xen-setup || die
903 - sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
904 - tools/Makefile || die
905 - fi
906 - else
907 - # Don't bother with qemu, only needed for fully virtualised guests
908 - sed -i '/SUBDIRS-$(CONFIG_QEMU_XEN)/s/^/#/g' tools/Makefile || die
909 - fi
910 -
911 - # Reset bash completion dir; Bug 472438
912 - sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
913 - -i Config.mk || die
914 -
915 - # xencommons, Bug #492332, sed lighter weight than patching
916 - sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
917 - -i tools/hotplug/Linux/init.d/xencommons.in || die
918 -
919 - # fix bashishm
920 - sed -e '/Usage/s/\$//g' \
921 - -i tools/hotplug/Linux/init.d/xendriverdomain.in || die
922 -
923 - # respect multilib, usr/lib/libcacard.so.0.0.0
924 - sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
925 - -i tools/qemu-xen/configure || die
926 -
927 - #bug 518136, don't build 32bit exactuable for nomultilib profile
928 - if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
929 - sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
930 - fi
931 -
932 - # uncomment lines in xl.conf
933 - sed -e 's:^#autoballoon=:autoballoon=:' \
934 - -e 's:^#lockfile=:lockfile=:' \
935 - -e 's:^#vif.default.script=:vif.default.script=:' \
936 - -i tools/examples/xl.conf || die
937 -
938 - # disable capstone (Bug #673474)
939 - sed -e "s:\$\$source/configure:\0 --disable-capstone:" \
940 - -i tools/Makefile || die
941 -
942 - # disable glusterfs
943 - sed -e "s:\$\$source/configure:\0 --disable-glusterfs:" \
944 - -i tools/Makefile || die
945 -
946 - # disable jpeg automagic
947 - sed -e "s:\$\$source/configure:\0 --disable-vnc-jpeg:" \
948 - -i tools/Makefile || die
949 -
950 - # disable png automagic
951 - sed -e "s:\$\$source/configure:\0 --disable-vnc-png:" \
952 - -i tools/Makefile || die
953 -
954 - # disable docker (Bug #732970)
955 - sed -e "s:\$\$source/configure:\0 --disable-containers:" \
956 - -i tools/Makefile || die
957 -
958 - default
959 -}
960 -
961 -src_configure() {
962 - local myconf="--prefix=${PREFIX}/usr \
963 - --libdir=${PREFIX}/usr/$(get_libdir) \
964 - --libexecdir=${PREFIX}/usr/libexec \
965 - --localstatedir=${EPREFIX}/var \
966 - --disable-golang \
967 - --disable-werror \
968 - --disable-xen \
969 - --enable-tools \
970 - --enable-docs \
971 - $(use_enable api xenapi) \
972 - $(use_enable ipxe) \
973 - $(usex system-ipxe '--with-system-ipxe=/usr/share/ipxe' '') \
974 - $(use_enable ocaml ocamltools) \
975 - $(use_enable ovmf) \
976 - $(use_enable pam) \
977 - $(use_enable rombios) \
978 - --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
979 - "
980 -
981 - use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
982 - use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
983 - use amd64 && myconf+=" $(use_enable qemu-traditional)"
984 - tc-ld-disable-gold # Bug 669570
985 - econf ${myconf}
986 -}
987 -
988 -src_compile() {
989 - local myopt
990 - use debug && myopt="${myopt} debug=y"
991 - # Currently broken
992 - #use python && myopt="${myopt} XENSTAT_PYTHON_BINDINGS=y"
993 -
994 - if test-flag-CC -fno-strict-overflow; then
995 - append-flags -fno-strict-overflow
996 - fi
997 -
998 - emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" build-tools ${myopt}
999 -
1000 - if use doc; then
1001 - emake -C docs build
1002 - else
1003 - emake -C docs man-pages
1004 - fi
1005 -}
1006 -
1007 -src_install() {
1008 - # Override auto-detection in the build system, bug #382573
1009 - export INITD_DIR=/tmp/init.d
1010 - export CONFIG_LEAF_DIR=../tmp/default
1011 -
1012 - # Let the build system compile installed Python modules.
1013 - local PYTHONDONTWRITEBYTECODE
1014 - export PYTHONDONTWRITEBYTECODE
1015 -
1016 - emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
1017 - XEN_PYTHON_NATIVE_INSTALL=y install-tools
1018 -
1019 - # Created at runtime
1020 - rm -rv "${ED}/var/run" || die
1021 -
1022 - # Fix the remaining Python shebangs.
1023 - python_fix_shebang "${D}"
1024 -
1025 - # Remove RedHat-specific stuff
1026 - rm -rf "${D}"/tmp || die
1027 -
1028 - if use doc; then
1029 - emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
1030 - dodoc -r docs/{pdf,txt}
1031 - else
1032 - emake -C docs DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-man-pages # Bug 668032
1033 - fi
1034 - dodoc ${DOCS[@]}
1035 -
1036 - newconfd "${FILESDIR}"/xendomains.confd xendomains
1037 - newconfd "${FILESDIR}"/xenstored.confd xenstored
1038 - newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
1039 - newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
1040 - newinitd "${FILESDIR}"/xenstored.initd-r1 xenstored
1041 - newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
1042 - newinitd "${FILESDIR}"/xencommons.initd xencommons
1043 - newconfd "${FILESDIR}"/xencommons.confd xencommons
1044 - newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
1045 - newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
1046 - newinitd "${FILESDIR}"/xen-watchdog.initd xen-watchdog
1047 -
1048 - if use screen; then
1049 - cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
1050 - cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
1051 - keepdir /var/log/xen-consoles
1052 - fi
1053 -
1054 - # For -static-libs wrt Bug 384355
1055 - if ! use static-libs; then
1056 - rm -f "${D}"/usr/$(get_libdir)/*.a "${D}"/usr/$(get_libdir)/ocaml/*/*.a
1057 - fi
1058 -
1059 - # for xendomains
1060 - keepdir /etc/xen/auto
1061 -
1062 - # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
1063 - find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
1064 - -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
1065 -
1066 - keepdir /var/lib/xen/dump
1067 - keepdir /var/lib/xen/xenpaging
1068 - keepdir /var/lib/xenstored
1069 - keepdir /var/log/xen
1070 -
1071 - # Currently broken
1072 - #if use python; then
1073 - #python_domodule "${S}/tools/libs/stat/bindings/swig/python/xenstat.py"
1074 - #python_domodule "${S}/tools/libs/stat/bindings/swig/python/_xenstat.so"
1075 - #fi
1076 -
1077 - python_optimize
1078 -}
1079 -
1080 -pkg_postinst() {
1081 - elog "Official Xen Guide and the offical wiki page:"
1082 - elog "https://wiki.gentoo.org/wiki/Xen"
1083 - elog "https://wiki.xen.org/wiki/Main_Page"
1084 - elog ""
1085 - elog "Recommended to utilise the xencommons script to config system at boot"
1086 - elog "Add by use of rc-update on completion of the install"
1087 -
1088 - if ! use hvm; then
1089 - echo
1090 - elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
1091 - elog "support enable the hvm use flag."
1092 - elog "An x86 or amd64 system is required to build HVM support."
1093 - fi
1094 -
1095 - if use qemu; then
1096 - elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
1097 - elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
1098 - elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
1099 - elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
1100 - fi
1101 -}