Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen/
Date: Wed, 28 Dec 2016 09:06:28
Message-Id: 1482915754.1892523f1f74df2ff565f7c9858b97334a0b7dfd.dlan@gentoo
1 commit: 1892523f1f74df2ff565f7c9858b97334a0b7dfd
2 Author: Yixun Lan <dlan <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 28 09:02:34 2016 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 28 09:02:34 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1892523f
7
8 app-emulation/xen: cleanup old vulnerables
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 app-emulation/xen/Manifest | 3 -
13 app-emulation/xen/xen-4.6.4-r3.ebuild | 193 ----------------------------------
14 app-emulation/xen/xen-4.6.4-r4.ebuild | 193 ----------------------------------
15 app-emulation/xen/xen-4.7.1-r3.ebuild | 193 ----------------------------------
16 4 files changed, 582 deletions(-)
17
18 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
19 index fd25026..c516bbb 100644
20 --- a/app-emulation/xen/Manifest
21 +++ b/app-emulation/xen/Manifest
22 @@ -1,7 +1,4 @@
23 -DIST xen-4.6.4-upstream-patches-0.tar.xz 15280 SHA256 0f2d55e44e2c98fb7caf76997c05f44fe1efdbf7eaa971a4bf234ea3bc95e244 SHA512 26be1b03af1ac0d6a413b0ab8a30d59c733d6d5c4e29ce3b5b90818a1589cbb5c46a50b9ee42b273ef3b37df8ff403241d68e1e2221ce969054fb7e5f13516ab WHIRLPOOL 52420897c49cd1bcfd8896df45a1f9c8df6337cb68dd7a6ff962361e7ab2eab1e6d6699ae8236b105e6b700b5d5b6c8da302ff477ac6493a60a665e4225cff02
24 -DIST xen-4.6.4.tar.gz 19709274 SHA256 b795d5631a85fb68295361067195ecd00003656dacede4ec57533fce33ab5109 SHA512 e6278061a16829628030579e115a500970ff575eb6796189bfa1e2d7a8cbbf8aec2c2bd04c77cdc87226d6cc5eaee59d6c62cacb4e74b06e1f1379734b872938 WHIRLPOOL a982f7bbf2ba16781ac0f310ef27a32e9115596e91117609d22827bc1999facb12df4f33d1ba0b7015cbfae90a24302243d508e8c38ba45ea998341b76ba0567
25 DIST xen-4.7.1-upstream-patches-0.tar.xz 16420 SHA256 cb4724fedadc408ec390f99e9928a44ec75e793fb55cb97793f09980855b6a32 SHA512 79e117c48c6cc3d5783c818218ac11ec494735ce89755b5e263a64c23fb1f0a425bc65b567a24ce2e348b6e3839b26133c7e2c36411e5cc7acb54b855149dfbe WHIRLPOOL 982165da62cbb28cd72d32662c366ca7dac91a511b356eb58bced4b4af5cbc0d94c7e280a2400e5d9c92938d2afee86abd7c688926c2b9cb191d4554be828844
26 DIST xen-4.7.1.tar.gz 20706864 SHA256 e87f4b0575e78657ee23d31470a15ecf1ce8c3a92a771cda46bbcd4d0d671ffe SHA512 eb03244f5fa7b54402fcc1d38f1e69c0ea4536d5ab2f9859b41b5e94920ad9db20fb146e3c3d3635e9ca1d12e93ce0429e57f24bf53d4a2c4b69babc76ec724e WHIRLPOOL 5d7ba29ea58bdedb6a237f7cb1c0aacf361dc35ebb07ec8e55773e07b1f38c1b151615b526e14daeca7c2db235114bde0b6d124219e8818c6e529873b5151fec
27 DIST xen-4.8.0.tar.gz 22499917 SHA256 1e15c713ab7ba3bfda8b4a285ed973529364fd1100e6dd5a61f29583dc667b04 SHA512 70b95553f9813573b12e52999a4df8701dec430f23c36a8dc70d25a46bb4bc9234e5b7feb74a04062af4c8d6b6bcfe947d90b2b172416206812e54bac9797454 WHIRLPOOL 1296c25a05e3ab81730a2587ea1c07c7c022f05cfefc580224185c8d5fc9853531031c1292f69eff944ae2752492c4b95f13e160be3c449a7626aeadf1a21102
28 -DIST xen-security-patches-19.tar.xz 3336 SHA256 497a01fbd20fa45df19b41d337be0a87f4808101ac33cc9649461726abf43720 SHA512 d8a4a8ceeab9e2efedf880e7a2007b312a7f528cdb8fb1f748096621bbdc447ff8ee09b8fbe1aae657ccd7b2557e436cf60f6e70dcaef65e8959204e91f3ec57 WHIRLPOOL 26473bc9d7c2648f78f1fbf722e1ebcf42983d9d0e04d40f66eaad73c5a7ec232a397392dd5f66adb1258c571238a8faf0497ceb468674b93f7f86b91539f9b9
29 DIST xen-security-patches-20.tar.xz 5608 SHA256 5bb4b6d93a07a3aa74497848ecdc9b7f0729f38d8a3e90d964c9aa85851ebfba SHA512 17171ca9f212153e49636c84455ec034b08e73be26f912e43995ac245d1927e6d4aa97a160f96d55f05e2c19c44d7ed8617ad10d8f4f27dc75f8f936624f73ce WHIRLPOOL 68e6f0033102298c31bdca88ac426fbcf3ee986250795404cead9e7577cf9bdb73c153f01d40b5cac31a2e845d862fe1dfcbb9022b550abb00779cf784f9b523
30
31 diff --git a/app-emulation/xen/xen-4.6.4-r3.ebuild b/app-emulation/xen/xen-4.6.4-r3.ebuild
32 deleted file mode 100644
33 index 785a285..00000000
34 --- a/app-emulation/xen/xen-4.6.4-r3.ebuild
35 +++ /dev/null
36 @@ -1,193 +0,0 @@
37 -# Copyright 1999-2016 Gentoo Foundation
38 -# Distributed under the terms of the GNU General Public License v2
39 -# $Id$
40 -
41 -EAPI=5
42 -
43 -PYTHON_COMPAT=( python2_7 )
44 -
45 -inherit eutils multilib mount-boot flag-o-matic python-any-r1 toolchain-funcs
46 -
47 -MY_PV=${PV/_/-}
48 -MY_P=${PN}-${PV/_/-}
49 -
50 -if [[ $PV == *9999 ]]; then
51 - inherit git-r3
52 - KEYWORDS=""
53 - EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
54 - SRC_URI=""
55 -else
56 - KEYWORDS="amd64 ~arm -x86"
57 - UPSTREAM_VER=0
58 - SECURITY_VER=19
59 - GENTOO_VER=
60 -
61 - [[ -n ${UPSTREAM_VER} ]] && \
62 - UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
63 - [[ -n ${SECURITY_VER} ]] && \
64 - SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
65 - [[ -n ${GENTOO_VER} ]] && \
66 - GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
67 - SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/${MY_P}.tar.gz
68 - ${UPSTREAM_PATCHSET_URI}
69 - ${SECURITY_PATCHSET_URI}
70 - ${GENTOO_PATCHSET_URI}"
71 -fi
72 -
73 -DESCRIPTION="The Xen virtual machine monitor"
74 -HOMEPAGE="http://xen.org/"
75 -LICENSE="GPL-2"
76 -SLOT="0"
77 -IUSE="custom-cflags debug efi flask"
78 -
79 -DEPEND="${PYTHON_DEPS}
80 - efi? ( >=sys-devel/binutils-2.22[multitarget] )
81 - !efi? ( >=sys-devel/binutils-2.22 )"
82 -RDEPEND=""
83 -PDEPEND="~app-emulation/xen-tools-${PV}"
84 -
85 -# no tests are available for the hypervisor
86 -# prevent the silliness of /usr/lib/debug/usr/lib/debug files
87 -# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
88 -RESTRICT="test splitdebug strip"
89 -
90 -# Approved by QA team in bug #144032
91 -QA_WX_LOAD="boot/xen-syms-${PV}"
92 -
93 -REQUIRED_USE="arm? ( debug )"
94 -
95 -S="${WORKDIR}/${MY_P}"
96 -
97 -pkg_setup() {
98 - python-any-r1_pkg_setup
99 - if [[ -z ${XEN_TARGET_ARCH} ]]; then
100 - if use amd64; then
101 - export XEN_TARGET_ARCH="x86_64"
102 - elif use arm; then
103 - export XEN_TARGET_ARCH="arm32"
104 - elif use arm64; then
105 - export XEN_TARGET_ARCH="arm64"
106 - else
107 - die "Unsupported architecture!"
108 - fi
109 - fi
110 -
111 - if use flask ; then
112 - export "XSM_ENABLE=y"
113 - export "FLASK_ENABLE=y"
114 - fi
115 -}
116 -
117 -src_prepare() {
118 - # Upstream's patchset
119 - if [[ -n ${UPSTREAM_VER} ]]; then
120 - EPATCH_SUFFIX="patch" \
121 - EPATCH_FORCE="yes" \
122 - EPATCH_OPTS="-p1" \
123 - epatch "${WORKDIR}"/patches-upstream
124 - fi
125 -
126 - # Security patchset
127 - if [[ -n ${SECURITY_VER} ]]; then
128 - einfo "Try to apply Xen Security patch set"
129 - # apply main xen patches
130 - # Two parallel systems, both work side by side
131 - # Over time they may concdense into one. This will suffice for now
132 - EPATCH_SUFFIX="patch"
133 - EPATCH_FORCE="yes"
134 -
135 - source "${WORKDIR}"/patches-security/${PV}.conf
136 -
137 - for i in ${XEN_SECURITY_MAIN}; do
138 - epatch "${WORKDIR}"/patches-security/xen/$i
139 - done
140 - fi
141 -
142 - # Gentoo's patchset
143 - if [[ -n ${GENTOO_VER} ]]; then
144 - EPATCH_SUFFIX="patch" \
145 - EPATCH_FORCE="yes" \
146 - epatch "${WORKDIR}"/patches-gentoo
147 - fi
148 -
149 - epatch "${FILESDIR}"/${PN}-4.6-efi.patch
150 -
151 - # Drop .config
152 - sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
153 -
154 - if use efi; then
155 - export EFI_VENDOR="gentoo"
156 - export EFI_MOUNTPOINT="boot"
157 - fi
158 -
159 - # if the user *really* wants to use their own custom-cflags, let them
160 - if use custom-cflags; then
161 - einfo "User wants their own CFLAGS - removing defaults"
162 - # try and remove all the default custom-cflags
163 - find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
164 - -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
165 - -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
166 - -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
167 - -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
168 - -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
169 - -i {} \; || die "failed to re-set custom-cflags"
170 - fi
171 -
172 - # remove -Werror for gcc-4.6's sake
173 - find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
174 - xargs sed -i 's/ *-Werror */ /'
175 - # not strictly necessary to fix this
176 - sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
177 -
178 - # Bug #575868 converted to a sed statement, typo of one char
179 - sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die
180 -
181 - epatch_user
182 -}
183 -
184 -src_configure() {
185 - use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
186 -
187 - use debug && myopt="${myopt} debug=y"
188 -
189 - if use custom-cflags; then
190 - filter-flags -fPIE -fstack-protector
191 - replace-flags -O3 -O2
192 - else
193 - unset CFLAGS
194 - unset LDFLAGS
195 - unset ASFLAGS
196 - fi
197 -}
198 -
199 -src_compile() {
200 - # Send raw LDFLAGS so that --as-needed works
201 - emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
202 -}
203 -
204 -src_install() {
205 - local myopt
206 - use debug && myopt="${myopt} debug=y"
207 -
208 - # The 'make install' doesn't 'mkdir -p' the subdirs
209 - if use efi; then
210 - mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
211 - fi
212 -
213 - emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
214 -
215 - # make install likes to throw in some extra EFI bits if it built
216 - use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
217 -}
218 -
219 -pkg_postinst() {
220 - elog "Official Xen Guide and the unoffical wiki page:"
221 - elog " https://wiki.gentoo.org/wiki/Xen"
222 - elog " http://en.gentoo-wiki.com/wiki/Xen/"
223 -
224 - use efi && einfo "The efi executable is installed in boot/efi/gentoo"
225 -
226 - elog "You can optionally block the installation of /boot/xen-syms by an entry"
227 - elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
228 - elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
229 -}
230
231 diff --git a/app-emulation/xen/xen-4.6.4-r4.ebuild b/app-emulation/xen/xen-4.6.4-r4.ebuild
232 deleted file mode 100644
233 index e91c520..00000000
234 --- a/app-emulation/xen/xen-4.6.4-r4.ebuild
235 +++ /dev/null
236 @@ -1,193 +0,0 @@
237 -# Copyright 1999-2016 Gentoo Foundation
238 -# Distributed under the terms of the GNU General Public License v2
239 -# $Id$
240 -
241 -EAPI=5
242 -
243 -PYTHON_COMPAT=( python2_7 )
244 -
245 -inherit eutils multilib mount-boot flag-o-matic python-any-r1 toolchain-funcs
246 -
247 -MY_PV=${PV/_/-}
248 -MY_P=${PN}-${PV/_/-}
249 -
250 -if [[ $PV == *9999 ]]; then
251 - inherit git-r3
252 - KEYWORDS=""
253 - EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
254 - SRC_URI=""
255 -else
256 - KEYWORDS="amd64 ~arm -x86"
257 - UPSTREAM_VER=0
258 - SECURITY_VER=20
259 - GENTOO_VER=
260 -
261 - [[ -n ${UPSTREAM_VER} ]] && \
262 - UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
263 - [[ -n ${SECURITY_VER} ]] && \
264 - SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
265 - [[ -n ${GENTOO_VER} ]] && \
266 - GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
267 - SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/${MY_P}.tar.gz
268 - ${UPSTREAM_PATCHSET_URI}
269 - ${SECURITY_PATCHSET_URI}
270 - ${GENTOO_PATCHSET_URI}"
271 -fi
272 -
273 -DESCRIPTION="The Xen virtual machine monitor"
274 -HOMEPAGE="http://xen.org/"
275 -LICENSE="GPL-2"
276 -SLOT="0"
277 -IUSE="custom-cflags debug efi flask"
278 -
279 -DEPEND="${PYTHON_DEPS}
280 - efi? ( >=sys-devel/binutils-2.22[multitarget] )
281 - !efi? ( >=sys-devel/binutils-2.22 )"
282 -RDEPEND=""
283 -PDEPEND="~app-emulation/xen-tools-${PV}"
284 -
285 -# no tests are available for the hypervisor
286 -# prevent the silliness of /usr/lib/debug/usr/lib/debug files
287 -# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
288 -RESTRICT="test splitdebug strip"
289 -
290 -# Approved by QA team in bug #144032
291 -QA_WX_LOAD="boot/xen-syms-${PV}"
292 -
293 -REQUIRED_USE="arm? ( debug )"
294 -
295 -S="${WORKDIR}/${MY_P}"
296 -
297 -pkg_setup() {
298 - python-any-r1_pkg_setup
299 - if [[ -z ${XEN_TARGET_ARCH} ]]; then
300 - if use amd64; then
301 - export XEN_TARGET_ARCH="x86_64"
302 - elif use arm; then
303 - export XEN_TARGET_ARCH="arm32"
304 - elif use arm64; then
305 - export XEN_TARGET_ARCH="arm64"
306 - else
307 - die "Unsupported architecture!"
308 - fi
309 - fi
310 -
311 - if use flask ; then
312 - export "XSM_ENABLE=y"
313 - export "FLASK_ENABLE=y"
314 - fi
315 -}
316 -
317 -src_prepare() {
318 - # Upstream's patchset
319 - if [[ -n ${UPSTREAM_VER} ]]; then
320 - EPATCH_SUFFIX="patch" \
321 - EPATCH_FORCE="yes" \
322 - EPATCH_OPTS="-p1" \
323 - epatch "${WORKDIR}"/patches-upstream
324 - fi
325 -
326 - # Security patchset
327 - if [[ -n ${SECURITY_VER} ]]; then
328 - einfo "Try to apply Xen Security patch set"
329 - # apply main xen patches
330 - # Two parallel systems, both work side by side
331 - # Over time they may concdense into one. This will suffice for now
332 - EPATCH_SUFFIX="patch"
333 - EPATCH_FORCE="yes"
334 -
335 - source "${WORKDIR}"/patches-security/${PV}.conf
336 -
337 - for i in ${XEN_SECURITY_MAIN}; do
338 - epatch "${WORKDIR}"/patches-security/xen/$i
339 - done
340 - fi
341 -
342 - # Gentoo's patchset
343 - if [[ -n ${GENTOO_VER} ]]; then
344 - EPATCH_SUFFIX="patch" \
345 - EPATCH_FORCE="yes" \
346 - epatch "${WORKDIR}"/patches-gentoo
347 - fi
348 -
349 - epatch "${FILESDIR}"/${PN}-4.6-efi.patch
350 -
351 - # Drop .config
352 - sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
353 -
354 - if use efi; then
355 - export EFI_VENDOR="gentoo"
356 - export EFI_MOUNTPOINT="boot"
357 - fi
358 -
359 - # if the user *really* wants to use their own custom-cflags, let them
360 - if use custom-cflags; then
361 - einfo "User wants their own CFLAGS - removing defaults"
362 - # try and remove all the default custom-cflags
363 - find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
364 - -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
365 - -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
366 - -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
367 - -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
368 - -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
369 - -i {} \; || die "failed to re-set custom-cflags"
370 - fi
371 -
372 - # remove -Werror for gcc-4.6's sake
373 - find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
374 - xargs sed -i 's/ *-Werror */ /'
375 - # not strictly necessary to fix this
376 - sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
377 -
378 - # Bug #575868 converted to a sed statement, typo of one char
379 - sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die
380 -
381 - epatch_user
382 -}
383 -
384 -src_configure() {
385 - use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
386 -
387 - use debug && myopt="${myopt} debug=y"
388 -
389 - if use custom-cflags; then
390 - filter-flags -fPIE -fstack-protector
391 - replace-flags -O3 -O2
392 - else
393 - unset CFLAGS
394 - unset LDFLAGS
395 - unset ASFLAGS
396 - fi
397 -}
398 -
399 -src_compile() {
400 - # Send raw LDFLAGS so that --as-needed works
401 - emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
402 -}
403 -
404 -src_install() {
405 - local myopt
406 - use debug && myopt="${myopt} debug=y"
407 -
408 - # The 'make install' doesn't 'mkdir -p' the subdirs
409 - if use efi; then
410 - mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
411 - fi
412 -
413 - emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
414 -
415 - # make install likes to throw in some extra EFI bits if it built
416 - use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
417 -}
418 -
419 -pkg_postinst() {
420 - elog "Official Xen Guide and the unoffical wiki page:"
421 - elog " https://wiki.gentoo.org/wiki/Xen"
422 - elog " http://en.gentoo-wiki.com/wiki/Xen/"
423 -
424 - use efi && einfo "The efi executable is installed in boot/efi/gentoo"
425 -
426 - elog "You can optionally block the installation of /boot/xen-syms by an entry"
427 - elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
428 - elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
429 -}
430
431 diff --git a/app-emulation/xen/xen-4.7.1-r3.ebuild b/app-emulation/xen/xen-4.7.1-r3.ebuild
432 deleted file mode 100644
433 index 785a285..00000000
434 --- a/app-emulation/xen/xen-4.7.1-r3.ebuild
435 +++ /dev/null
436 @@ -1,193 +0,0 @@
437 -# Copyright 1999-2016 Gentoo Foundation
438 -# Distributed under the terms of the GNU General Public License v2
439 -# $Id$
440 -
441 -EAPI=5
442 -
443 -PYTHON_COMPAT=( python2_7 )
444 -
445 -inherit eutils multilib mount-boot flag-o-matic python-any-r1 toolchain-funcs
446 -
447 -MY_PV=${PV/_/-}
448 -MY_P=${PN}-${PV/_/-}
449 -
450 -if [[ $PV == *9999 ]]; then
451 - inherit git-r3
452 - KEYWORDS=""
453 - EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
454 - SRC_URI=""
455 -else
456 - KEYWORDS="amd64 ~arm -x86"
457 - UPSTREAM_VER=0
458 - SECURITY_VER=19
459 - GENTOO_VER=
460 -
461 - [[ -n ${UPSTREAM_VER} ]] && \
462 - UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
463 - [[ -n ${SECURITY_VER} ]] && \
464 - SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
465 - [[ -n ${GENTOO_VER} ]] && \
466 - GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
467 - SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/${MY_P}.tar.gz
468 - ${UPSTREAM_PATCHSET_URI}
469 - ${SECURITY_PATCHSET_URI}
470 - ${GENTOO_PATCHSET_URI}"
471 -fi
472 -
473 -DESCRIPTION="The Xen virtual machine monitor"
474 -HOMEPAGE="http://xen.org/"
475 -LICENSE="GPL-2"
476 -SLOT="0"
477 -IUSE="custom-cflags debug efi flask"
478 -
479 -DEPEND="${PYTHON_DEPS}
480 - efi? ( >=sys-devel/binutils-2.22[multitarget] )
481 - !efi? ( >=sys-devel/binutils-2.22 )"
482 -RDEPEND=""
483 -PDEPEND="~app-emulation/xen-tools-${PV}"
484 -
485 -# no tests are available for the hypervisor
486 -# prevent the silliness of /usr/lib/debug/usr/lib/debug files
487 -# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
488 -RESTRICT="test splitdebug strip"
489 -
490 -# Approved by QA team in bug #144032
491 -QA_WX_LOAD="boot/xen-syms-${PV}"
492 -
493 -REQUIRED_USE="arm? ( debug )"
494 -
495 -S="${WORKDIR}/${MY_P}"
496 -
497 -pkg_setup() {
498 - python-any-r1_pkg_setup
499 - if [[ -z ${XEN_TARGET_ARCH} ]]; then
500 - if use amd64; then
501 - export XEN_TARGET_ARCH="x86_64"
502 - elif use arm; then
503 - export XEN_TARGET_ARCH="arm32"
504 - elif use arm64; then
505 - export XEN_TARGET_ARCH="arm64"
506 - else
507 - die "Unsupported architecture!"
508 - fi
509 - fi
510 -
511 - if use flask ; then
512 - export "XSM_ENABLE=y"
513 - export "FLASK_ENABLE=y"
514 - fi
515 -}
516 -
517 -src_prepare() {
518 - # Upstream's patchset
519 - if [[ -n ${UPSTREAM_VER} ]]; then
520 - EPATCH_SUFFIX="patch" \
521 - EPATCH_FORCE="yes" \
522 - EPATCH_OPTS="-p1" \
523 - epatch "${WORKDIR}"/patches-upstream
524 - fi
525 -
526 - # Security patchset
527 - if [[ -n ${SECURITY_VER} ]]; then
528 - einfo "Try to apply Xen Security patch set"
529 - # apply main xen patches
530 - # Two parallel systems, both work side by side
531 - # Over time they may concdense into one. This will suffice for now
532 - EPATCH_SUFFIX="patch"
533 - EPATCH_FORCE="yes"
534 -
535 - source "${WORKDIR}"/patches-security/${PV}.conf
536 -
537 - for i in ${XEN_SECURITY_MAIN}; do
538 - epatch "${WORKDIR}"/patches-security/xen/$i
539 - done
540 - fi
541 -
542 - # Gentoo's patchset
543 - if [[ -n ${GENTOO_VER} ]]; then
544 - EPATCH_SUFFIX="patch" \
545 - EPATCH_FORCE="yes" \
546 - epatch "${WORKDIR}"/patches-gentoo
547 - fi
548 -
549 - epatch "${FILESDIR}"/${PN}-4.6-efi.patch
550 -
551 - # Drop .config
552 - sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
553 -
554 - if use efi; then
555 - export EFI_VENDOR="gentoo"
556 - export EFI_MOUNTPOINT="boot"
557 - fi
558 -
559 - # if the user *really* wants to use their own custom-cflags, let them
560 - if use custom-cflags; then
561 - einfo "User wants their own CFLAGS - removing defaults"
562 - # try and remove all the default custom-cflags
563 - find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
564 - -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
565 - -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
566 - -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
567 - -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
568 - -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
569 - -i {} \; || die "failed to re-set custom-cflags"
570 - fi
571 -
572 - # remove -Werror for gcc-4.6's sake
573 - find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
574 - xargs sed -i 's/ *-Werror */ /'
575 - # not strictly necessary to fix this
576 - sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
577 -
578 - # Bug #575868 converted to a sed statement, typo of one char
579 - sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die
580 -
581 - epatch_user
582 -}
583 -
584 -src_configure() {
585 - use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
586 -
587 - use debug && myopt="${myopt} debug=y"
588 -
589 - if use custom-cflags; then
590 - filter-flags -fPIE -fstack-protector
591 - replace-flags -O3 -O2
592 - else
593 - unset CFLAGS
594 - unset LDFLAGS
595 - unset ASFLAGS
596 - fi
597 -}
598 -
599 -src_compile() {
600 - # Send raw LDFLAGS so that --as-needed works
601 - emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
602 -}
603 -
604 -src_install() {
605 - local myopt
606 - use debug && myopt="${myopt} debug=y"
607 -
608 - # The 'make install' doesn't 'mkdir -p' the subdirs
609 - if use efi; then
610 - mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
611 - fi
612 -
613 - emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
614 -
615 - # make install likes to throw in some extra EFI bits if it built
616 - use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
617 -}
618 -
619 -pkg_postinst() {
620 - elog "Official Xen Guide and the unoffical wiki page:"
621 - elog " https://wiki.gentoo.org/wiki/Xen"
622 - elog " http://en.gentoo-wiki.com/wiki/Xen/"
623 -
624 - use efi && einfo "The efi executable is installed in boot/efi/gentoo"
625 -
626 - elog "You can optionally block the installation of /boot/xen-syms by an entry"
627 - elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
628 - elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
629 -}