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