1 |
commit: d91052023c3f298100aa0f17a1ea1615a0f239eb |
2 |
Author: Yixun Lan <dlan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 30 04:44:48 2017 +0000 |
4 |
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 30 05:34:25 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9105202 |
7 |
|
8 |
app-emulation/xen-tools: version bump, 4.8.2 |
9 |
|
10 |
this bump also fix security issue |
11 |
XSA-231,232,233,234 |
12 |
|
13 |
Package-Manager: Portage-2.3.10, Repoman-2.3.3 |
14 |
|
15 |
app-emulation/xen-tools/Manifest | 3 + |
16 |
app-emulation/xen-tools/files/gentoo-patches.conf | 12 + |
17 |
app-emulation/xen-tools/xen-tools-4.8.2.ebuild | 449 ++++++++++++++++++++++ |
18 |
3 files changed, 464 insertions(+) |
19 |
|
20 |
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest |
21 |
index 470e3e74c8b..c8593983685 100644 |
22 |
--- a/app-emulation/xen-tools/Manifest |
23 |
+++ b/app-emulation/xen-tools/Manifest |
24 |
@@ -6,6 +6,9 @@ DIST xen-4.7.2.tar.gz 20714281 SHA256 61494a56d9251e2108080f95b0dc8e3d175f1ba4da |
25 |
DIST xen-4.7.3.tar.gz 20722625 SHA256 5b5385b476e59e4cf31ecc6dd605df38814b83432b8e8d917f18c8edfdfb708f SHA512 df596bef7f0f0e7f35246fb025913721dae5aa91da27f1b47a49256e9faa8f7dcb80e8c4679345c19614093c02059b6ced54fc51e6900a372b0e76b4ad827126 WHIRLPOOL 9e88db149e216651711cd56830fba33d587de60d57d53fd3ab3db231319f74e4e88222bf1b2bb9b20fea68739bccd4b26304c73a0ae25aad6dbbac64681e3a62 |
26 |
DIST xen-4.8.1-upstream-patches-0.tar.xz 57132 SHA256 6a6d466e74b28e50cc8ffcf56f6e3853dff73a5d936374404a2aab9dadb54566 SHA512 bcf43f7f9c15016576f225146a34e26122a6e35d953ca8df05d6d3b6b2465bd8e237e824d3d84dfd892f440b40d6e6b3bb7c16c3c79b8e04534b2bed60877f53 WHIRLPOOL 4470d244bed58f9b71a031da19cfe38a79badf426300637211c3e8dfdab02f2b87ed21d9a5340af267685aafd627451f8750b85d9afc73ed2a550c52b43c31ab |
27 |
DIST xen-4.8.1.tar.gz 22516631 SHA256 1d69153b94561429293015f66463ee17c26404d1c014e646ecbcca6078581395 SHA512 9f535b4bb57d285dfb92c974d55513505cf485b2d7218fe8f6ed62768e2cee7f225b08adf6706590b2c0a04feca16e10915297c33b98e1b110f8ea7035f46c15 WHIRLPOOL ea367d4d08eaa464417f6c5e7143a52e085a8d0e515c99cbb49ac3ccd5c189aa79947d233754177698a076c28abf7a32c83ae29019ca70c6300839b09ca67bad |
28 |
+DIST xen-4.8.2-upstream-patches-0.tar.xz 7540 SHA256 d4bd4ce76097c49ebbad67a64814b9b41af0528b390ade15814cf0fb144e5e77 SHA512 34118ac114773cfc01a464de2a93b14905d3fb5edd62ae093f6cb40758f89c7fdc8449d0b7e9bfbaaee812b6f32b0c21860adeebb609376a22ce231e405b0837 WHIRLPOOL 0ff8c2fe3c349e6dc85e98644a813dd590c42bc78c6bbf98cdf77ed516e73fe5ca72a44935eae77f6ff9dcba8fef5d24c181d24b63b15bc470e7ed59098d5808 |
29 |
+DIST xen-4.8.2.tar.gz 22522336 SHA256 cb1cc2f0985e3d8651215e5d24c1fcc3036994fa7cc495a5091a2c85ece2aff9 SHA512 7805531f73d23ecfff3439770e62d387f4254a444875670d53a0a739323e5d4d8f8fcc478f8936ee1ae8aff3e0229549e47c01c606365a8ce060dd5c503e87da WHIRLPOOL 8e54e79219f89640162673da471a02ee8a39bb884e2376a79a09226462903185b49a771fef51ceca54c4dd42a110ee1214db6dbf94235a156a17d6c597634c3d |
30 |
+DIST xen-gentoo-patches-10.tar.xz 27876 SHA256 aa91759d25611afa2e851e190c8445b18e4262037fc06da886f2fa4a4c500b94 SHA512 2033f4cb671971c73841cfaa7eb46623c37778c5746b47302eee252c4af287ccbeb8d1884ffdf32cd97a38cd7785257d56f13ef20d4c03dc0fb1cb196dc04ece WHIRLPOOL e02cc3c6ffd701b2f04df111ab33b18f7fa09e292b94a34af4d806509a564b896a7b677ab64654523ee992f363d59bf6bd4c2cbeaea7330f368cf657bfa2d538 |
31 |
DIST xen-gentoo-patches-9.tar.xz 27456 SHA256 67c410d12ef4628a8c0a931e5868b425f2eb4b2f0e307304a75384cbe509734b SHA512 9a797be9dd2392c34b3f6561c2274e116b4f5b114f4520dbbd0b51818c774479ceabb45aa916f93c1a2bc49787f4ca6e6c83bc743baa6bdeef91d77276b20f36 WHIRLPOOL c41cde532726bb55acd05d558b35d575b229d2ee64eba7438f7b196df313f0e44154148c1e47bf6e8c810667b3b237bcfa410371b4bb6f097b981f6b2637ead3 |
32 |
DIST xen-ovmf-patches-2.tar.xz 4344 SHA256 495d61d718440057f8b0b54fb57061450dd764c6e87fe5f8bda1785bcddba770 SHA512 0bdc83029a01b613f5c1ca029bd45aebe211c332f09db91a0cc7d6b6f85a81dbbfdc20c62f0d20e973ee41b155a6551a4fad518cb792e1d508bf070e23d6a1d3 WHIRLPOOL 8346d68fa5d2a8e8a5c007b55e2b85cf48df045cc8c4818f09c756d28a52dd856671f37b4a53478e9b96ca9d2eca0c67fd15f009a94d1d2dfed8e83e596d9633 |
33 |
DIST xen-security-patches-25.tar.xz 9208 SHA256 ceaa520d4d98ab7b6ce5b58c380499372cb513dda0c8236106cdf878385d4458 SHA512 18539c1f42bc95a06f7b06855614fafb4ed7c07a145d9ab90e02954ba405d21fc4c379908e3233ddfb85ccaa04515b261ac4bbf3987ce00e4479158f03edd917 WHIRLPOOL 4cff34c29a5c38e6a5bd0d4f4fe89d8daf944740934b05cd61f4b8a345ddb4d8a8b2de6db27a723154169e3f28d5b34a43eddd08c909cfa3d6d5aee26fcae693 |
34 |
|
35 |
diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf |
36 |
index 6fe9bf07e8b..8936a3bbea0 100644 |
37 |
--- a/app-emulation/xen-tools/files/gentoo-patches.conf |
38 |
+++ b/app-emulation/xen-tools/files/gentoo-patches.conf |
39 |
@@ -98,6 +98,9 @@ _gx040=" 0001-docs-Clarify-the-expected-behaviour-of-zero-length-r.patch |
40 |
|
41 |
_gx041=" 0002-tools-libxc-Tolerate-zero-length-records-in-migratio.patch" |
42 |
|
43 |
+#Fix missing makedev(), major(), minor() |
44 |
+_gx042=" xen-tools-4.8.2-makedev.patch" |
45 |
+ |
46 |
# xen-tools-4.7.2 patches set |
47 |
_gpv_xen_tools_472_0=" |
48 |
${_gx008} ${_gx021} |
49 |
@@ -124,3 +127,12 @@ ${_gx027} ${_gx032} |
50 |
${_gx028} ${_gx029} |
51 |
${_gx037} ${_gx040} |
52 |
" |
53 |
+ |
54 |
+# xen-tools-4.8.2 patches set |
55 |
+_gpv_xen_tools_482_0=" |
56 |
+${_gx008} |
57 |
+${_gx038} ${_gx017} ${_gx039} |
58 |
+${_gx027} ${_gx032} |
59 |
+${_gx028} ${_gx029} |
60 |
+${_gx037} ${_gx040} ${_gx042} |
61 |
+" |
62 |
|
63 |
diff --git a/app-emulation/xen-tools/xen-tools-4.8.2.ebuild b/app-emulation/xen-tools/xen-tools-4.8.2.ebuild |
64 |
new file mode 100644 |
65 |
index 00000000000..828ed753d89 |
66 |
--- /dev/null |
67 |
+++ b/app-emulation/xen-tools/xen-tools-4.8.2.ebuild |
68 |
@@ -0,0 +1,449 @@ |
69 |
+# Copyright 1999-2017 Gentoo Foundation |
70 |
+# Distributed under the terms of the GNU General Public License v2 |
71 |
+ |
72 |
+EAPI=5 |
73 |
+ |
74 |
+PYTHON_COMPAT=( python2_7 ) |
75 |
+PYTHON_REQ_USE='ncurses,xml,threads' |
76 |
+ |
77 |
+inherit eutils bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs versionator |
78 |
+ |
79 |
+MY_PV=${PV/_/-} |
80 |
+MAJOR_V="$(get_version_component_range 1-2)" |
81 |
+ |
82 |
+if [[ $PV == *9999 ]]; then |
83 |
+ inherit git-r3 |
84 |
+ KEYWORDS="" |
85 |
+ REPO="xen.git" |
86 |
+ EGIT_REPO_URI="git://xenbits.xen.org/${REPO}" |
87 |
+ S="${WORKDIR}/${REPO}" |
88 |
+else |
89 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
90 |
+ UPSTREAM_VER=0 |
91 |
+ SECURITY_VER= |
92 |
+ # xen-tools's gentoo patches tarball |
93 |
+ GENTOO_VER=10 |
94 |
+ # xen-tools's gentoo patches version which apply to this specific ebuild |
95 |
+ GENTOO_GPV=0 |
96 |
+ # xen-tools ovmf's patches |
97 |
+ OVMF_VER=2 |
98 |
+ |
99 |
+ SEABIOS_VER=1.10.0 |
100 |
+ # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d |
101 |
+ OVMF_PV=20151110 |
102 |
+ |
103 |
+ [[ -n ${UPSTREAM_VER} ]] && \ |
104 |
+ UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz" |
105 |
+ [[ -n ${SECURITY_VER} ]] && \ |
106 |
+ SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz" |
107 |
+ [[ -n ${GENTOO_VER} ]] && \ |
108 |
+ GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz" |
109 |
+ [[ -n ${OVMF_VER} ]] && \ |
110 |
+ OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz" |
111 |
+ |
112 |
+ SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/xen-${MY_PV}.tar.gz |
113 |
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz |
114 |
+ https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz |
115 |
+ ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2 |
116 |
+ ${OVMF_PATCHSET_URI} ) |
117 |
+ ${UPSTREAM_PATCHSET_URI} |
118 |
+ ${SECURITY_PATCHSET_URI} |
119 |
+ ${GENTOO_PATCHSET_URI}" |
120 |
+ |
121 |
+ S="${WORKDIR}/xen-${MY_PV}" |
122 |
+fi |
123 |
+ |
124 |
+DESCRIPTION="Xen tools including QEMU and xl" |
125 |
+HOMEPAGE="http://xen.org/" |
126 |
+DOCS=( README docs/README.xen-bugtool ) |
127 |
+ |
128 |
+LICENSE="GPL-2" |
129 |
+SLOT="0/${MAJOR_V}" |
130 |
+# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make |
131 |
+# >=dev-lang/ocaml-4 stable |
132 |
+# Masked in profiles/eapi-5-files instead |
133 |
+IUSE="api custom-cflags debug doc flask hvm +qemu ocaml ovmf +qemu-traditional +pam python pygrub screen sdl static-libs system-qemu system-seabios" |
134 |
+ |
135 |
+REQUIRED_USE=" |
136 |
+ ${PYTHON_REQUIRED_USE} |
137 |
+ pygrub? ( python ) |
138 |
+ ovmf? ( hvm ) |
139 |
+ ^^ ( qemu system-qemu )" |
140 |
+ |
141 |
+COMMON_DEPEND=" |
142 |
+ dev-libs/lzo:2 |
143 |
+ dev-libs/glib:2 |
144 |
+ dev-libs/yajl |
145 |
+ dev-libs/libaio |
146 |
+ dev-libs/libgcrypt:0 |
147 |
+ sys-libs/zlib |
148 |
+ ${PYTHON_DEPS} |
149 |
+" |
150 |
+ |
151 |
+DEPEND="${COMMON_DEPEND} |
152 |
+ dev-python/lxml[${PYTHON_USEDEP}] |
153 |
+ x86? ( sys-devel/dev86 |
154 |
+ sys-power/iasl ) |
155 |
+ pam? ( dev-python/pypam[${PYTHON_USEDEP}] ) |
156 |
+ api? ( dev-libs/libxml2 |
157 |
+ net-misc/curl ) |
158 |
+ ovmf? ( |
159 |
+ !arm? ( !arm64? ( dev-lang/nasm ) ) |
160 |
+ $(python_gen_impl_dep sqlite) |
161 |
+ ) |
162 |
+ !amd64? ( >=sys-apps/dtc-1.4.0 ) |
163 |
+ amd64? ( sys-devel/bin86 |
164 |
+ system-seabios? ( sys-firmware/seabios ) |
165 |
+ sys-firmware/ipxe |
166 |
+ sys-devel/dev86 |
167 |
+ sys-power/iasl ) |
168 |
+ dev-lang/perl |
169 |
+ app-misc/pax-utils |
170 |
+ doc? ( |
171 |
+ app-doc/doxygen |
172 |
+ dev-python/markdown[${PYTHON_USEDEP}] |
173 |
+ dev-tex/latex2html[png,gif] |
174 |
+ media-gfx/graphviz |
175 |
+ dev-tex/xcolor |
176 |
+ media-gfx/transfig |
177 |
+ dev-texlive/texlive-latexextra |
178 |
+ virtual/latex-base |
179 |
+ dev-tex/latexmk |
180 |
+ dev-texlive/texlive-latex |
181 |
+ dev-texlive/texlive-pictures |
182 |
+ dev-texlive/texlive-latexrecommended |
183 |
+ ) |
184 |
+ hvm? ( x11-proto/xproto |
185 |
+ !net-libs/libiscsi ) |
186 |
+ qemu? ( |
187 |
+ x11-libs/pixman |
188 |
+ sdl? ( media-libs/libsdl[X] ) |
189 |
+ ) |
190 |
+ system-qemu? ( app-emulation/qemu[xen] ) |
191 |
+ ocaml? ( dev-ml/findlib |
192 |
+ >=dev-lang/ocaml-4 )" |
193 |
+ |
194 |
+RDEPEND="${COMMON_DEPEND} |
195 |
+ sys-apps/iproute2[-minimal] |
196 |
+ net-misc/bridge-utils |
197 |
+ screen? ( |
198 |
+ app-misc/screen |
199 |
+ app-admin/logrotate |
200 |
+ )" |
201 |
+ |
202 |
+# hvmloader is used to bootstrap a fully virtualized kernel |
203 |
+# Approved by QA team in bug #144032 |
204 |
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader |
205 |
+ usr/share/qemu-xen/qemu/s390-ccw.img" |
206 |
+ |
207 |
+RESTRICT="test" |
208 |
+ |
209 |
+pkg_setup() { |
210 |
+ python_setup |
211 |
+ export "CONFIG_LOMOUNT=y" |
212 |
+ |
213 |
+ #bug 522642, disable compile tools/tests |
214 |
+ export "CONFIG_TESTS=n" |
215 |
+ |
216 |
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then |
217 |
+ if use x86 && use amd64; then |
218 |
+ die "Confusion! Both x86 and amd64 are set in your use flags!" |
219 |
+ elif use x86; then |
220 |
+ export XEN_TARGET_ARCH="x86_32" |
221 |
+ elif use amd64 ; then |
222 |
+ export XEN_TARGET_ARCH="x86_64" |
223 |
+ elif use arm; then |
224 |
+ export XEN_TARGET_ARCH="arm32" |
225 |
+ elif use arm64; then |
226 |
+ export XEN_TARGET_ARCH="arm64" |
227 |
+ else |
228 |
+ die "Unsupported architecture!" |
229 |
+ fi |
230 |
+ fi |
231 |
+} |
232 |
+ |
233 |
+src_prepare() { |
234 |
+ # Upstream's patchset |
235 |
+ if [[ -n ${UPSTREAM_VER} ]]; then |
236 |
+ einfo "Try to apply Xen Upstream patch set" |
237 |
+ EPATCH_SUFFIX="patch" \ |
238 |
+ EPATCH_FORCE="yes" \ |
239 |
+ EPATCH_OPTS="-p1" \ |
240 |
+ epatch "${WORKDIR}"/patches-upstream |
241 |
+ fi |
242 |
+ |
243 |
+ # Security patchset |
244 |
+ if [[ -n ${SECURITY_VER} ]]; then |
245 |
+ einfo "Try to apply Xen Security patch set" |
246 |
+ # apply main xen patches |
247 |
+ # Two parallel systems, both work side by side |
248 |
+ # Over time they may concdense into one. This will suffice for now |
249 |
+ EPATCH_SUFFIX="patch" |
250 |
+ EPATCH_FORCE="yes" |
251 |
+ |
252 |
+ source "${WORKDIR}"/patches-security/${PV}.conf || die |
253 |
+ |
254 |
+ for i in ${XEN_SECURITY_MAIN}; do |
255 |
+ epatch "${WORKDIR}"/patches-security/xen/$i |
256 |
+ done |
257 |
+ |
258 |
+ # apply qemu-xen/upstream patches |
259 |
+ pushd "${S}"/tools/qemu-xen/ > /dev/null |
260 |
+ for i in ${XEN_SECURITY_QEMUU}; do |
261 |
+ epatch "${WORKDIR}"/patches-security/qemuu/$i |
262 |
+ done |
263 |
+ popd > /dev/null |
264 |
+ |
265 |
+ # apply qemu-traditional patches |
266 |
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null |
267 |
+ for i in ${XEN_SECURITY_QEMUT}; do |
268 |
+ epatch "${WORKDIR}"/patches-security/qemut/$i |
269 |
+ done |
270 |
+ popd > /dev/null |
271 |
+ fi |
272 |
+ |
273 |
+ # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err |
274 |
+ mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die |
275 |
+ pushd tools/firmware/ > /dev/null |
276 |
+ ln -s seabios-dir-remote seabios-dir || die |
277 |
+ popd > /dev/null |
278 |
+ |
279 |
+ # Gentoo's patchset |
280 |
+ if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then |
281 |
+ einfo "Try to apply Gentoo specific patch set" |
282 |
+ source "${FILESDIR}"/gentoo-patches.conf || die |
283 |
+ _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV} |
284 |
+ for i in ${!_gpv}; do |
285 |
+ EPATCH_SUFFIX="patch" \ |
286 |
+ EPATCH_FORCE="yes" \ |
287 |
+ epatch "${WORKDIR}"/patches-gentoo/$i |
288 |
+ done |
289 |
+ fi |
290 |
+ |
291 |
+ # Ovmf's patchset |
292 |
+ if use ovmf; then |
293 |
+ if [[ -n ${OVMF_VER} ]];then |
294 |
+ einfo "Try to apply Ovmf patch set" |
295 |
+ pushd "${WORKDIR}"/ovmf-*/ > /dev/null |
296 |
+ EPATCH_SUFFIX="patch" \ |
297 |
+ EPATCH_FORCE="yes" \ |
298 |
+ EPATCH_OPTS="-p1" \ |
299 |
+ epatch "${WORKDIR}"/patches-ovmf |
300 |
+ popd > /dev/null |
301 |
+ fi |
302 |
+ mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die |
303 |
+ fi |
304 |
+ |
305 |
+ mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die |
306 |
+ |
307 |
+ # Fix texi2html build error with new texi2html, qemu.doc.html |
308 |
+ sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die |
309 |
+ |
310 |
+ use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die |
311 |
+ sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \ |
312 |
+ -i tools/firmware/Makefile || die |
313 |
+ |
314 |
+ # Drop .config, fixes to gcc-4.6 |
315 |
+ sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop" |
316 |
+ |
317 |
+ # if the user *really* wants to use their own custom-cflags, let them |
318 |
+ if use custom-cflags; then |
319 |
+ einfo "User wants their own CFLAGS - removing defaults" |
320 |
+ |
321 |
+ # try and remove all the default cflags |
322 |
+ find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \ |
323 |
+ -exec sed \ |
324 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \ |
325 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \ |
326 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \ |
327 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \ |
328 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ |
329 |
+ -i {} + || die "failed to re-set custom-cflags" |
330 |
+ else |
331 |
+ unset CFLAGS |
332 |
+ unset LDFLAGS |
333 |
+ unset ASFLAGS |
334 |
+ unset CPPFLAGS |
335 |
+ fi |
336 |
+ |
337 |
+ if ! use pygrub; then |
338 |
+ sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die |
339 |
+ fi |
340 |
+ |
341 |
+ if ! use python; then |
342 |
+ sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die |
343 |
+ fi |
344 |
+ |
345 |
+ if ! use hvm; then |
346 |
+ sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die |
347 |
+ # Bug 351648 |
348 |
+ elif ! use x86 && ! has x86 $(get_all_abis); then |
349 |
+ mkdir -p "${WORKDIR}"/extra-headers/gnu || die |
350 |
+ touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die |
351 |
+ export CPATH="${WORKDIR}"/extra-headers |
352 |
+ fi |
353 |
+ |
354 |
+ if use qemu; then |
355 |
+ if use sdl; then |
356 |
+ sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \ |
357 |
+ tools/Makefile || die |
358 |
+ else |
359 |
+ sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \ |
360 |
+ tools/qemu-xen-traditional/xen-setup || die |
361 |
+ sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \ |
362 |
+ tools/Makefile || die |
363 |
+ fi |
364 |
+ else |
365 |
+ # Don't bother with qemu, only needed for fully virtualised guests |
366 |
+ sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die |
367 |
+ fi |
368 |
+ |
369 |
+ # Reset bash completion dir; Bug 472438 |
370 |
+ sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \ |
371 |
+ -i Config.mk || die |
372 |
+ sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die |
373 |
+ |
374 |
+ # xencommons, Bug #492332, sed lighter weight than patching |
375 |
+ sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \ |
376 |
+ -i tools/hotplug/Linux/init.d/xencommons.in || die |
377 |
+ |
378 |
+ # respect multilib, usr/lib/libcacard.so.0.0.0 |
379 |
+ sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \ |
380 |
+ -i tools/qemu-xen/configure || die |
381 |
+ |
382 |
+ #bug 518136, don't build 32bit exactuable for nomultilib profile |
383 |
+ if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then |
384 |
+ sed -i -e "/x86_emulator/d" tools/tests/Makefile || die |
385 |
+ fi |
386 |
+ |
387 |
+ # uncomment lines in xl.conf |
388 |
+ sed -e 's:^#autoballoon=:autoballoon=:' \ |
389 |
+ -e 's:^#lockfile=:lockfile=:' \ |
390 |
+ -e 's:^#vif.default.script=:vif.default.script=:' \ |
391 |
+ -i tools/examples/xl.conf || die |
392 |
+ |
393 |
+ # Bug #575868 converted to a sed statement, typo of one char |
394 |
+ sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die |
395 |
+ |
396 |
+ epatch_user |
397 |
+} |
398 |
+ |
399 |
+src_configure() { |
400 |
+ local myconf="--prefix=${PREFIX}/usr \ |
401 |
+ --libdir=${PREFIX}/usr/$(get_libdir) \ |
402 |
+ --libexecdir=${PREFIX}/usr/libexec \ |
403 |
+ --localstatedir=${EPREFIX}/var \ |
404 |
+ --disable-werror \ |
405 |
+ --disable-xen \ |
406 |
+ --enable-tools \ |
407 |
+ --enable-docs \ |
408 |
+ $(use_enable pam) \ |
409 |
+ $(use_enable api xenapi) \ |
410 |
+ $(use_enable ovmf) \ |
411 |
+ $(use_enable ocaml ocamltools) \ |
412 |
+ --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \ |
413 |
+ " |
414 |
+ |
415 |
+ use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin" |
416 |
+ use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64" |
417 |
+ use amd64 && myconf+=" $(use_enable qemu-traditional)" |
418 |
+ econf ${myconf} |
419 |
+} |
420 |
+ |
421 |
+src_compile() { |
422 |
+ export VARTEXFONTS="${T}/fonts" |
423 |
+ local myopt |
424 |
+ use debug && myopt="${myopt} debug=y" |
425 |
+ |
426 |
+ if test-flag-CC -fno-strict-overflow; then |
427 |
+ append-flags -fno-strict-overflow |
428 |
+ fi |
429 |
+ |
430 |
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt} |
431 |
+ |
432 |
+ use doc && emake -C docs txt html |
433 |
+ emake -C docs man-pages |
434 |
+} |
435 |
+ |
436 |
+src_install() { |
437 |
+ # Override auto-detection in the build system, bug #382573 |
438 |
+ export INITD_DIR=/tmp/init.d |
439 |
+ export CONFIG_LEAF_DIR=../tmp/default |
440 |
+ |
441 |
+ # Let the build system compile installed Python modules. |
442 |
+ local PYTHONDONTWRITEBYTECODE |
443 |
+ export PYTHONDONTWRITEBYTECODE |
444 |
+ |
445 |
+ emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \ |
446 |
+ XEN_PYTHON_NATIVE_INSTALL=y install-tools |
447 |
+ |
448 |
+ # Fix the remaining Python shebangs. |
449 |
+ python_fix_shebang "${D}" |
450 |
+ |
451 |
+ # Remove RedHat-specific stuff |
452 |
+ rm -rf "${D}"tmp || die |
453 |
+ |
454 |
+ if use doc; then |
455 |
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs |
456 |
+ |
457 |
+ dohtml -r docs/ |
458 |
+ docinto pdf |
459 |
+ dodoc ${DOCS[@]} |
460 |
+ [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html |
461 |
+ fi |
462 |
+ |
463 |
+ rm -rf "${D}"/usr/share/doc/xen/ |
464 |
+ doman docs/man?/* |
465 |
+ |
466 |
+ newconfd "${FILESDIR}"/xendomains.confd xendomains |
467 |
+ newconfd "${FILESDIR}"/xenstored.confd xenstored |
468 |
+ newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled |
469 |
+ newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains |
470 |
+ newinitd "${FILESDIR}"/xenstored.initd xenstored |
471 |
+ newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled |
472 |
+ newinitd "${FILESDIR}"/xencommons.initd xencommons |
473 |
+ newconfd "${FILESDIR}"/xencommons.confd xencommons |
474 |
+ newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev |
475 |
+ newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev |
476 |
+ |
477 |
+ if use screen; then |
478 |
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die |
479 |
+ cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die |
480 |
+ keepdir /var/log/xen-consoles |
481 |
+ fi |
482 |
+ |
483 |
+ # For -static-libs wrt Bug 384355 |
484 |
+ if ! use static-libs; then |
485 |
+ rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a |
486 |
+ fi |
487 |
+ |
488 |
+ # for xendomains |
489 |
+ keepdir /etc/xen/auto |
490 |
+ |
491 |
+ # Remove files failing QA AFTER emake installs them, avoiding seeking absent files |
492 |
+ find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \ |
493 |
+ -o -name openbios-ppc -o -name palcode-clipper \) -delete || die |
494 |
+} |
495 |
+ |
496 |
+pkg_postinst() { |
497 |
+ elog "Official Xen Guide and the offical wiki page:" |
498 |
+ elog "https://wiki.gentoo.org/wiki/Xen" |
499 |
+ elog "http://wiki.xen.org/wiki/Main_Page" |
500 |
+ elog "" |
501 |
+ elog "Recommended to utilise the xencommons script to config sytem At boot" |
502 |
+ elog "Add by use of rc-update on completion of the install" |
503 |
+ |
504 |
+ if ! use hvm; then |
505 |
+ echo |
506 |
+ elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm" |
507 |
+ elog "support enable the hvm use flag." |
508 |
+ elog "An x86 or amd64 system is required to build HVM support." |
509 |
+ fi |
510 |
+ |
511 |
+ if use qemu; then |
512 |
+ elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source" |
513 |
+ elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently" |
514 |
+ elog "with the qemu capable xen. It is up to the user to distinguish between and utilise" |
515 |
+ elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise" |
516 |
+ fi |
517 |
+} |