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