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