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, 22 Nov 2017 01:45:40
Message-Id: 1511315116.24ae9bcf952a72add4a9297bbb51fe00994884ff.dlan@gentoo
1 commit: 24ae9bcf952a72add4a9297bbb51fe00994884ff
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Fri Nov 3 21:49:32 2017 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 22 01:45:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24ae9bcf
7
8 app-emulation/xen: bump to 4.9.0
9
10 Gentoo-Bug: 625406 634596
11 Closes: https://github.com/gentoo/gentoo/pull/6114
12
13 Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
14
15 app-emulation/xen/Manifest | 2 +
16 app-emulation/xen/xen-4.9.0.ebuild | 183 +++++++++++++++++++++++++++++++++++++
17 2 files changed, 185 insertions(+)
18
19 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
20 index 87f9e84c79f..6d8c7125bbe 100644
21 --- a/app-emulation/xen/Manifest
22 +++ b/app-emulation/xen/Manifest
23 @@ -1,2 +1,4 @@
24 DIST xen-4.8.2-upstream-patches-2.tar.xz 38852 SHA256 12c1f1fd2adba22b923d2ee944e6e66794701393966f9e9e2079961e202f6d64 SHA512 536823eabf03e92585a8c5cde90ce502672dd1ec080b28b39411d6a778b899436a57bfb633f11c94d48d2f963848b7771e469f5ea53e84b580976f631f69cc5d WHIRLPOOL 5baf92709da895eccbe8b154c1d1cdf4c2f0faf5166ef2e4bbf32ca6899d8b88aa67ccd765a15a2f9a6d5200d4a1eb832775891d41c00a950855e5d1d4358e35
25 DIST xen-4.8.2.tar.gz 22522336 SHA256 cb1cc2f0985e3d8651215e5d24c1fcc3036994fa7cc495a5091a2c85ece2aff9 SHA512 7805531f73d23ecfff3439770e62d387f4254a444875670d53a0a739323e5d4d8f8fcc478f8936ee1ae8aff3e0229549e47c01c606365a8ce060dd5c503e87da WHIRLPOOL 8e54e79219f89640162673da471a02ee8a39bb884e2376a79a09226462903185b49a771fef51ceca54c4dd42a110ee1214db6dbf94235a156a17d6c597634c3d
26 +DIST xen-4.9.0-upstream-patches-0.tar.xz 58780 SHA256 f3539c0f620d168e4dcfc4c11f895bd6850c1c566d53a9d3366907662c2960e3 SHA512 98c601d791661a306e3dce5befb37b80de8a71cdd1759f3da00b199d48e3b9468efd1332e26ae044ad616b41a02771ad07a1c96972103b7e0aa39b93fb556999 WHIRLPOOL 711d3a5bcc9bd9afded35252b2efc0d4ba39ab9edb595328e4ebd808513c863e447e3554600328982a440fe936b7f68baf0b925f9d8ef8d17965439eed35d98b
27 +DIST xen-4.9.0.tar.gz 23361741 SHA256 cade643fe3310d4d6f97d0c215c6fa323bc1130d7e64d7e2043ffaa73a96f33b SHA512 97f8075c49ef9ec0adbe95106c0cff4f9379578fd568777697565476c3fd948335d72ddcacf8be65fd9db219c0a35dcdc007f355f7e5874dd950fd4c0a0f966f WHIRLPOOL 354527ea01f69c6ab632cffe8f50ca93721d9a89cbc4d84886d24b53fabdb7f62132b80e36189c30c0c9fae66b367eec7e00bb4df5f7af054ec27cec912ecf47
28
29 diff --git a/app-emulation/xen/xen-4.9.0.ebuild b/app-emulation/xen/xen-4.9.0.ebuild
30 new file mode 100644
31 index 00000000000..b9ad6439bc4
32 --- /dev/null
33 +++ b/app-emulation/xen/xen-4.9.0.ebuild
34 @@ -0,0 +1,183 @@
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +PYTHON_COMPAT=( python2_7 )
41 +
42 +inherit eutils flag-o-matic mount-boot multilib python-any-r1 toolchain-funcs
43 +
44 +MY_PV=${PV/_/-}
45 +MY_P=${PN}-${MY_PV}
46 +
47 +if [[ $PV == *9999 ]]; then
48 + inherit git-r3
49 + KEYWORDS=""
50 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
51 + SRC_URI=""
52 +else
53 + KEYWORDS="~amd64 ~arm -x86"
54 + UPSTREAM_VER=0
55 + SECURITY_VER=
56 + GENTOO_VER=
57 +
58 + [[ -n ${UPSTREAM_VER} ]] && \
59 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
60 + [[ -n ${SECURITY_VER} ]] && \
61 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
62 + [[ -n ${GENTOO_VER} ]] && \
63 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
64 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/${MY_P}.tar.gz
65 + ${UPSTREAM_PATCHSET_URI}
66 + ${SECURITY_PATCHSET_URI}
67 + ${GENTOO_PATCHSET_URI}"
68 +fi
69 +
70 +DESCRIPTION="The Xen virtual machine monitor"
71 +HOMEPAGE="https://www.xenproject.org"
72 +LICENSE="GPL-2"
73 +SLOT="0"
74 +IUSE="custom-cflags debug efi flask"
75 +
76 +DEPEND="${PYTHON_DEPS}
77 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
78 + !efi? ( >=sys-devel/binutils-2.22 )"
79 +RDEPEND=""
80 +PDEPEND="~app-emulation/xen-tools-${PV}"
81 +
82 +# no tests are available for the hypervisor
83 +# prevent the silliness of /usr/lib/debug/usr/lib/debug files
84 +# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
85 +RESTRICT="test splitdebug strip"
86 +
87 +# Approved by QA team in bug #144032
88 +QA_WX_LOAD="boot/xen-syms-${PV}"
89 +
90 +REQUIRED_USE="arm? ( debug )"
91 +
92 +S="${WORKDIR}/${MY_P}"
93 +
94 +pkg_setup() {
95 + python-any-r1_pkg_setup
96 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
97 + if use amd64; then
98 + export XEN_TARGET_ARCH="x86_64"
99 + elif use arm; then
100 + export XEN_TARGET_ARCH="arm32"
101 + elif use arm64; then
102 + export XEN_TARGET_ARCH="arm64"
103 + else
104 + die "Unsupported architecture!"
105 + fi
106 + fi
107 +
108 + if use flask ; then
109 + export "XSM_ENABLE=y"
110 + export "FLASK_ENABLE=y"
111 + fi
112 +}
113 +
114 +src_prepare() {
115 + # Upstream's patchset
116 + if [[ -n ${UPSTREAM_VER} ]]; then
117 + EPATCH_SUFFIX="patch" \
118 + EPATCH_FORCE="yes" \
119 + EPATCH_OPTS="-p1" \
120 + epatch "${WORKDIR}"/patches-upstream
121 + fi
122 +
123 + # Security patchset
124 + if [[ -n ${SECURITY_VER} ]]; then
125 + einfo "Try to apply Xen Security patch set"
126 + # apply main xen patches
127 + # Two parallel systems, both work side by side
128 + # Over time they may concdense into one. This will suffice for now
129 + EPATCH_SUFFIX="patch"
130 + EPATCH_FORCE="yes"
131 +
132 + source "${WORKDIR}"/patches-security/${PV}.conf
133 +
134 + local i
135 + for i in ${XEN_SECURITY_MAIN}; do
136 + epatch "${WORKDIR}"/patches-security/xen/$i
137 + done
138 + fi
139 +
140 + # Gentoo's patchset
141 + if [[ -n ${GENTOO_VER} ]]; then
142 + EPATCH_SUFFIX="patch" \
143 + EPATCH_FORCE="yes" \
144 + epatch "${WORKDIR}"/patches-gentoo
145 + fi
146 +
147 + epatch "${FILESDIR}"/${PN}-4.6-efi.patch
148 +
149 + # Drop .config
150 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
151 +
152 + if use efi; then
153 + export EFI_VENDOR="gentoo"
154 + export EFI_MOUNTPOINT="boot"
155 + fi
156 +
157 + # if the user *really* wants to use their own custom-cflags, let them
158 + if use custom-cflags; then
159 + einfo "User wants their own CFLAGS - removing defaults"
160 + # try and remove all the default custom-cflags
161 + find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
162 + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
163 + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
164 + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
165 + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
166 + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
167 + -i {} \; || die "failed to re-set custom-cflags"
168 + fi
169 +
170 + default
171 +}
172 +
173 +src_configure() {
174 + use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
175 +
176 + use debug && myopt="${myopt} debug=y"
177 +
178 + if use custom-cflags; then
179 + filter-flags -fPIE -fstack-protector
180 + replace-flags -O3 -O2
181 + else
182 + unset CFLAGS
183 + unset LDFLAGS
184 + unset ASFLAGS
185 + fi
186 +}
187 +
188 +src_compile() {
189 + # Send raw LDFLAGS so that --as-needed works
190 + emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
191 +}
192 +
193 +src_install() {
194 + local myopt
195 + use debug && myopt="${myopt} debug=y"
196 +
197 + # The 'make install' doesn't 'mkdir -p' the subdirs
198 + if use efi; then
199 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
200 + fi
201 +
202 + emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
203 +
204 + # make install likes to throw in some extra EFI bits if it built
205 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
206 +}
207 +
208 +pkg_postinst() {
209 + elog "Official Xen Guide:"
210 + elog " https://wiki.gentoo.org/wiki/Xen"
211 +
212 + use efi && einfo "The efi executable is installed in boot/efi/gentoo"
213 +
214 + elog "You can optionally block the installation of /boot/xen-syms by an entry"
215 + elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
216 + elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
217 +}