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