1 |
commit: 258698f21a037fbe3126aa663a54de2462bdadb7 |
2 |
Author: Yixun Lan <dlan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 27 07:30:50 2016 +0000 |
4 |
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 27 07:36:55 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=258698f2 |
7 |
|
8 |
app-emulation/xen-tools: version bump |
9 |
|
10 |
Package-Manager: portage-2.3.0_rc1 |
11 |
|
12 |
app-emulation/xen-tools/Manifest | 2 + |
13 |
app-emulation/xen-tools/files/gentoo-patches.conf | 39 +- |
14 |
app-emulation/xen-tools/xen-tools-4.6.3.ebuild | 458 ++++++++++++++++++++++ |
15 |
app-emulation/xen-tools/xen-tools-4.7.0.ebuild | 458 ++++++++++++++++++++++ |
16 |
4 files changed, 931 insertions(+), 26 deletions(-) |
17 |
|
18 |
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest |
19 |
index 28bb252..72bf5c1 100644 |
20 |
--- a/app-emulation/xen-tools/Manifest |
21 |
+++ b/app-emulation/xen-tools/Manifest |
22 |
@@ -5,6 +5,8 @@ DIST xen-4.6.0-upstream-patches-0.tar.xz 19280 SHA256 8ef2d139f86cb52d2208a17c97 |
23 |
DIST xen-4.6.0.tar.gz 19694350 SHA256 6fa1c2431df55aa5950d248e6093b8c8c0f11c357a0adbd348a2186478e80909 SHA512 b4b02f306ffea360f539dd8c231b2f58c00c3638fdb665cb659c7291b475b40f1075bc59d49a6144767729e57b8bc40a1cfd9030d61de2b8fa4ac97d43655c2b WHIRLPOOL d3f01183440ca1875b6e850bd116db0c382383433e50c0902d3268e9e36b39d184fc65e925bdb5363ef4ca7a232fee15b4749c89baf789137b8a8248565c75a8 |
24 |
DIST xen-4.6.1-upstream-patches-0.tar.xz 92472 SHA256 7b32cbd57571d838ec606c5bd2b98a51e14a6bcf44d2d61007c274fa3b6b5eb6 SHA512 2f8e9273601c70eac88fb9d94bcb607bc5ea76514f9cdee0e96309b9a9d78db881d94c57a518ad5cef398fa57274b9940ba1553d0984bb5504ca27b6b62a6003 WHIRLPOOL 9b2592f33587fc85b091fbfb357d4ab4914f39286f3207a0d8aebf26259f0ebd1eb7d6bede7da9a202427cf9c7d97c11c4c84c5f90584948b1f3c32fefac5164 |
25 |
DIST xen-4.6.1.tar.gz 19693042 SHA256 44cc2fccba1e147ef4c8da0584ce0f24189c8743de0e3e9a9226da88ddb5f589 SHA512 f01a0b7874abf8b3a81432428d7ba2d5aceb9d75ae20310f8ef49a3a0df927720a51d49090f74fda7f374c779e121ad26da6966a6f2623ed1a7743b4c080427c WHIRLPOOL b4eec12118d602d1b41edee32ed7c0c61646974060bc44e3eedaf78f7c3015c151998f72573fd2bab1992263dd98f09992772334bae7826048d187de7ed022e5 |
26 |
+DIST xen-4.6.3.tar.gz 19707041 SHA256 02badfce9a037bd1bd4a94210c1f6b85467746216c71795805102b514bcf1fc4 SHA512 187a860b40c05139f22b8498a5fae1db173c3110d957147af29a56cb83b7111c9dc4946d65f9dffc847001fc01c5e9bf51886eaa1194bb9cfd0b6dbcd43a2c5c WHIRLPOOL f80fa73727218567b8d6c8d6bab9dfd577c4bb84ac737b084e4396128e8c4aa79776a277f73c283d5b12f17764b183b67fbf8596e240042dd0709f28cbab777e |
27 |
+DIST xen-4.7.0.tar.gz 20702550 SHA256 be5876144d49729572ae06142e0bb93f1c1f2695578141eff2931995add24623 SHA512 2c52c8ef145dfab7d069e79318d5d631e1106a0ddc79d88b3bacf36c7f15cea67dccb704a245e785d2a1e42c6fb6c0ad74832f564aaeec025ad7b864031f0921 WHIRLPOOL 9725ac9fe94e78aab47b0534b5ee1a190106a773bf7d6204fed736abe7069b71937717b6680833736bd02a3a3a43f2eb2162fe7c0d992ddd47d12158b5d9835f |
28 |
DIST xen-gentoo-patches-4.tar.xz 23632 SHA256 5cdb0f93ee32d0a5fc4fc7282270ace73acfdc4df694f7b29c1135180d902049 SHA512 3006ce4cd67e80a9f79d9ba3814a64704b0d762159a439a140b1ec0a2699473cd5537950f0913b55f8f7e3d0fd2e9861f3199793120d8d2502aa3f8ef7816c8f WHIRLPOOL 4a921103df2825ccd8b0481708e7cd692fa45d5aadae286c1522c144a1576920e7d3567648565bb9af85bb6bb597ea9d0ec04ea6abd2115db4caf7e739717b1a |
29 |
DIST xen-gentoo-patches-6.tar.xz 23864 SHA256 96e774bd03c9df341fdb2f5d6cf231549c8d7a004c3c902c07b5cb690428d4c6 SHA512 7f4966bb7dad02b213a3cbefcc312573039feaec964a2deaa6aa7f8fa488b6e31176834a4e2cf6ac380548f1b8251c7700d16d1cbc7b88fcee440f6cccd7f177 WHIRLPOOL a41cae3441370e0e18fbf28ac7a780adfaa0d6af12dc62f1dfe90f52f01ebbd8055e3b5b399ae11602b29b8a206aafe2cbecb79948233bd072e73294468f3b08 |
30 |
DIST xen-ovmf-patches-1.tar.xz 4724 SHA256 d14e98e62c78c9f4b8a7e7b4a04de6dabf300f393eff44154d06f93aa43d7703 SHA512 a17467762f6d92018ff9bce783ce148039f23159405e801ec2aef4c3db72c3976c6f1e41d8c2a2cb704a9654556a2050302f284cfe8e32f28f393b8e2c6d2f1c WHIRLPOOL de53ad07f20aa14fe76d974db92d5b6808f0a2dd26a627b818914990add7adad8e6135d42641819dc22947031981c5815bae5aeeed0f28785c90beda0a6ff6c8 |
31 |
|
32 |
diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf |
33 |
index 44e5472..783c90a 100644 |
34 |
--- a/app-emulation/xen-tools/files/gentoo-patches.conf |
35 |
+++ b/app-emulation/xen-tools/files/gentoo-patches.conf |
36 |
@@ -82,43 +82,30 @@ _gx034=" xen-tools-4.5.0-gcc99.patch" |
37 |
_gx035=" xen-tools-4.2-pod-docs-r1.patch" |
38 |
# disable stackcheck for hardened system, bug 569810 |
39 |
_gx036=" xen-tools-4.6-no-stackcheck.patch" |
40 |
-# xen-tools-4.2.5 patches set |
41 |
-_gpv_xen_tools_425_0=" |
42 |
-${_gx001} ${_gx002} ${_gx003} ${_gx004} ${_gx005} |
43 |
-${_gx006} ${_gx007} ${_gx008} ${_gx009} ${_gx010} |
44 |
-${_gx011} ${_gx012} ${_gx013} ${_gx014} ${_gx015} |
45 |
-${_gx016} ${_gx017} ${_gx018} ${_gx019} |
46 |
-" |
47 |
-_gpv_xen_tools_425_1=" |
48 |
-${_gx001} ${_gx002} ${_gx003} ${_gx004} ${_gx035} |
49 |
-${_gx006} ${_gx007} ${_gx008} ${_gx009} ${_gx010} |
50 |
-${_gx011} ${_gx012} ${_gx013} ${_gx014} ${_gx015} |
51 |
-${_gx016} ${_gx017} ${_gx018} ${_gx019} |
52 |
-" |
53 |
|
54 |
-# xen-tools-4.5.1 patches set |
55 |
-_gpv_xen_tools_451_0=" |
56 |
-${_gx008} ${_gx024} ${_gx021} |
57 |
+# xen-tools-4.6.0 patches set |
58 |
+_gpv_xen_tools_460_0=" |
59 |
+${_gx008} ${_gx021} |
60 |
${_gx022} ${_gx017} ${_gx031} |
61 |
${_gx027} ${_gx032} |
62 |
-${_gx028} ${_gx029} ${_gx034} |
63 |
+${_gx028} ${_gx029} |
64 |
" |
65 |
-# xen-tools-4.5.2 patches set |
66 |
-_gpv_xen_tools_452_0=" |
67 |
-${_gx008} ${_gx024} ${_gx021} |
68 |
+# xen-tools-4.6.1 patches set |
69 |
+_gpv_xen_tools_461_0=" |
70 |
+${_gx008} ${_gx021} |
71 |
${_gx022} ${_gx017} ${_gx031} |
72 |
${_gx027} ${_gx032} |
73 |
-${_gx028} ${_gx029} ${_gx034} |
74 |
+${_gx028} ${_gx029} ${_gx036} |
75 |
" |
76 |
-# xen-tools-4.6.0 patches set |
77 |
-_gpv_xen_tools_460_0=" |
78 |
+# xen-tools-4.6.3 patches set |
79 |
+_gpv_xen_tools_463_0=" |
80 |
${_gx008} ${_gx021} |
81 |
${_gx022} ${_gx017} ${_gx031} |
82 |
${_gx027} ${_gx032} |
83 |
-${_gx028} ${_gx029} |
84 |
+${_gx028} ${_gx029} ${_gx036} |
85 |
" |
86 |
-# xen-tools-4.6.1 patches set |
87 |
-_gpv_xen_tools_461_0=" |
88 |
+# xen-tools-4.7.0 patches set |
89 |
+_gpv_xen_tools_470_0=" |
90 |
${_gx008} ${_gx021} |
91 |
${_gx022} ${_gx017} ${_gx031} |
92 |
${_gx027} ${_gx032} |
93 |
|
94 |
diff --git a/app-emulation/xen-tools/xen-tools-4.6.3.ebuild b/app-emulation/xen-tools/xen-tools-4.6.3.ebuild |
95 |
new file mode 100644 |
96 |
index 0000000..62d7661 |
97 |
--- /dev/null |
98 |
+++ b/app-emulation/xen-tools/xen-tools-4.6.3.ebuild |
99 |
@@ -0,0 +1,458 @@ |
100 |
+# Copyright 1999-2016 Gentoo Foundation |
101 |
+# Distributed under the terms of the GNU General Public License v2 |
102 |
+# $Id$ |
103 |
+ |
104 |
+EAPI=5 |
105 |
+ |
106 |
+PYTHON_COMPAT=( python2_7 ) |
107 |
+PYTHON_REQ_USE='ncurses,xml,threads' |
108 |
+ |
109 |
+inherit eutils bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs versionator |
110 |
+ |
111 |
+MY_PV=${PV/_/-} |
112 |
+MAJOR_V="$(get_version_component_range 1-2)" |
113 |
+ |
114 |
+if [[ $PV == *9999 ]]; then |
115 |
+ inherit git-r3 |
116 |
+ KEYWORDS="" |
117 |
+ REPO="xen.git" |
118 |
+ EGIT_REPO_URI="git://xenbits.xen.org/${REPO}" |
119 |
+ S="${WORKDIR}/${REPO}" |
120 |
+else |
121 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
122 |
+ UPSTREAM_VER= |
123 |
+ SECURITY_VER= |
124 |
+ # xen-tools's gentoo patches tarball |
125 |
+ GENTOO_VER=6 |
126 |
+ # xen-tools's gentoo patches version which apply to this specific ebuild |
127 |
+ GENTOO_GPV=0 |
128 |
+ # xen-tools ovmf's patches |
129 |
+ OVMF_VER=2 |
130 |
+ |
131 |
+ SEABIOS_VER=1.8.2 |
132 |
+ # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d |
133 |
+ OVMF_PV=20151110 |
134 |
+ |
135 |
+ [[ -n ${UPSTREAM_VER} ]] && \ |
136 |
+ UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz" |
137 |
+ [[ -n ${SECURITY_VER} ]] && \ |
138 |
+ SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz" |
139 |
+ [[ -n ${GENTOO_VER} ]] && \ |
140 |
+ GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz" |
141 |
+ [[ -n ${OVMF_VER} ]] && \ |
142 |
+ OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz" |
143 |
+ |
144 |
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz |
145 |
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz |
146 |
+ https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz |
147 |
+ ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2 |
148 |
+ ${OVMF_PATCHSET_URI} ) |
149 |
+ ${UPSTREAM_PATCHSET_URI} |
150 |
+ ${SECURITY_PATCHSET_URI} |
151 |
+ ${GENTOO_PATCHSET_URI}" |
152 |
+ |
153 |
+ S="${WORKDIR}/xen-${MY_PV}" |
154 |
+fi |
155 |
+ |
156 |
+DESCRIPTION="Xen tools including QEMU and xl" |
157 |
+HOMEPAGE="http://xen.org/" |
158 |
+DOCS=( README docs/README.xen-bugtool ) |
159 |
+ |
160 |
+LICENSE="GPL-2" |
161 |
+SLOT="0/${MAJOR_V}" |
162 |
+# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make |
163 |
+# >=dev-lang/ocaml-4 stable |
164 |
+# Masked in profiles/eapi-5-files instead |
165 |
+IUSE="api custom-cflags debug doc flask hvm qemu ocaml ovmf +qemu-traditional +pam python pygrub screen sdl static-libs system-qemu system-seabios" |
166 |
+ |
167 |
+REQUIRED_USE="hvm? ( || ( qemu system-qemu ) ) |
168 |
+ ${PYTHON_REQUIRED_USE} |
169 |
+ pygrub? ( python ) |
170 |
+ ovmf? ( hvm ) |
171 |
+ qemu? ( !system-qemu )" |
172 |
+ |
173 |
+COMMON_DEPEND=" |
174 |
+ dev-libs/lzo:2 |
175 |
+ dev-libs/glib:2 |
176 |
+ dev-libs/yajl |
177 |
+ dev-libs/libaio |
178 |
+ dev-libs/libgcrypt:0 |
179 |
+ sys-libs/zlib |
180 |
+" |
181 |
+ |
182 |
+DEPEND="${COMMON_DEPEND} |
183 |
+ dev-python/lxml[${PYTHON_USEDEP}] |
184 |
+ x86? ( sys-devel/dev86 |
185 |
+ sys-power/iasl ) |
186 |
+ pam? ( dev-python/pypam[${PYTHON_USEDEP}] ) |
187 |
+ ${PYTHON_DEPS} |
188 |
+ api? ( dev-libs/libxml2 |
189 |
+ net-misc/curl ) |
190 |
+ ovmf? ( $(python_gen_impl_dep sqlite) ) |
191 |
+ !amd64? ( >=sys-apps/dtc-1.4.0 ) |
192 |
+ amd64? ( sys-devel/bin86 |
193 |
+ system-seabios? ( sys-firmware/seabios ) |
194 |
+ sys-firmware/ipxe |
195 |
+ sys-devel/dev86 |
196 |
+ sys-power/iasl ) |
197 |
+ dev-lang/perl |
198 |
+ app-misc/pax-utils |
199 |
+ doc? ( |
200 |
+ app-doc/doxygen |
201 |
+ dev-python/markdown[${PYTHON_USEDEP}] |
202 |
+ dev-tex/latex2html[png,gif] |
203 |
+ media-gfx/graphviz |
204 |
+ dev-tex/xcolor |
205 |
+ media-gfx/transfig |
206 |
+ dev-texlive/texlive-latexextra |
207 |
+ virtual/latex-base |
208 |
+ dev-tex/latexmk |
209 |
+ dev-texlive/texlive-latex |
210 |
+ dev-texlive/texlive-pictures |
211 |
+ dev-texlive/texlive-latexrecommended |
212 |
+ ) |
213 |
+ hvm? ( x11-proto/xproto |
214 |
+ !net-libs/libiscsi ) |
215 |
+ qemu? ( |
216 |
+ x11-libs/pixman |
217 |
+ sdl? ( media-libs/libsdl[X] ) |
218 |
+ ) |
219 |
+ system-qemu? ( app-emulation/qemu[xen] ) |
220 |
+ ocaml? ( dev-ml/findlib |
221 |
+ >=dev-lang/ocaml-4 )" |
222 |
+ |
223 |
+RDEPEND="${COMMON_DEPEND} |
224 |
+ sys-apps/iproute2[-minimal] |
225 |
+ net-misc/bridge-utils |
226 |
+ screen? ( |
227 |
+ app-misc/screen |
228 |
+ app-admin/logrotate |
229 |
+ )" |
230 |
+ |
231 |
+# hvmloader is used to bootstrap a fully virtualized kernel |
232 |
+# Approved by QA team in bug #144032 |
233 |
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader |
234 |
+ usr/share/qemu-xen/qemu/s390-ccw.img" |
235 |
+ |
236 |
+RESTRICT="test" |
237 |
+ |
238 |
+pkg_setup() { |
239 |
+ python_setup |
240 |
+ export "CONFIG_LOMOUNT=y" |
241 |
+ |
242 |
+ #bug 522642, disable compile tools/tests |
243 |
+ export "CONFIG_TESTS=n" |
244 |
+ |
245 |
+ if has_version dev-libs/libgcrypt:0; then |
246 |
+ export "CONFIG_GCRYPT=y" |
247 |
+ fi |
248 |
+ |
249 |
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then |
250 |
+ if use x86 && use amd64; then |
251 |
+ die "Confusion! Both x86 and amd64 are set in your use flags!" |
252 |
+ elif use x86; then |
253 |
+ export XEN_TARGET_ARCH="x86_32" |
254 |
+ elif use amd64 ; then |
255 |
+ export XEN_TARGET_ARCH="x86_64" |
256 |
+ elif use arm; then |
257 |
+ export XEN_TARGET_ARCH="arm32" |
258 |
+ elif use arm64; then |
259 |
+ export XEN_TARGET_ARCH="arm64" |
260 |
+ else |
261 |
+ die "Unsupported architecture!" |
262 |
+ fi |
263 |
+ fi |
264 |
+} |
265 |
+ |
266 |
+src_prepare() { |
267 |
+ # Upstream's patchset |
268 |
+ if [[ -n ${UPSTREAM_VER} ]]; then |
269 |
+ einfo "Try to apply Xen Upstream patch set" |
270 |
+ EPATCH_SUFFIX="patch" \ |
271 |
+ EPATCH_FORCE="yes" \ |
272 |
+ EPATCH_OPTS="-p1" \ |
273 |
+ epatch "${WORKDIR}"/patches-upstream |
274 |
+ fi |
275 |
+ |
276 |
+ # Security patchset |
277 |
+ if [[ -n ${SECURITY_VER} ]]; then |
278 |
+ einfo "Try to apply Xen Security patch set" |
279 |
+ # apply main xen patches |
280 |
+ # Two parallel systems, both work side by side |
281 |
+ # Over time they may concdense into one. This will suffice for now |
282 |
+ EPATCH_SUFFIX="patch" |
283 |
+ EPATCH_FORCE="yes" |
284 |
+ |
285 |
+ source "${WORKDIR}"/patches-security/${PV}.conf |
286 |
+ |
287 |
+ for i in ${XEN_SECURITY_MAIN}; do |
288 |
+ epatch "${WORKDIR}"/patches-security/xen/$i |
289 |
+ done |
290 |
+ |
291 |
+ # apply qemu-xen/upstream patches |
292 |
+ pushd "${S}"/tools/qemu-xen/ > /dev/null |
293 |
+ for i in ${XEN_SECURITY_QEMUU}; do |
294 |
+ epatch "${WORKDIR}"/patches-security/qemuu/$i |
295 |
+ done |
296 |
+ popd > /dev/null |
297 |
+ |
298 |
+ # apply qemu-traditional patches |
299 |
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null |
300 |
+ for i in ${XEN_SECURITY_QEMUT}; do |
301 |
+ epatch "${WORKDIR}"/patches-security/qemut/$i |
302 |
+ done |
303 |
+ popd > /dev/null |
304 |
+ fi |
305 |
+ |
306 |
+ # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err |
307 |
+ mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die |
308 |
+ pushd tools/firmware/ > /dev/null |
309 |
+ ln -s seabios-dir-remote seabios-dir || die |
310 |
+ popd > /dev/null |
311 |
+ |
312 |
+ # Gentoo's patchset |
313 |
+ if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then |
314 |
+ einfo "Try to apply Gentoo specific patch set" |
315 |
+ source "${FILESDIR}"/gentoo-patches.conf |
316 |
+ _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV} |
317 |
+ for i in ${!_gpv}; do |
318 |
+ EPATCH_SUFFIX="patch" \ |
319 |
+ EPATCH_FORCE="yes" \ |
320 |
+ epatch "${WORKDIR}"/patches-gentoo/$i |
321 |
+ done |
322 |
+ fi |
323 |
+ |
324 |
+ # Ovmf's patchset |
325 |
+ if use ovmf; then |
326 |
+ if [[ -n ${OVMF_VER} ]];then |
327 |
+ einfo "Try to apply Ovmf patch set" |
328 |
+ pushd "${WORKDIR}"/ovmf-*/ > /dev/null |
329 |
+ EPATCH_SUFFIX="patch" \ |
330 |
+ EPATCH_FORCE="yes" \ |
331 |
+ EPATCH_OPTS="-p1" \ |
332 |
+ epatch "${WORKDIR}"/patches-ovmf |
333 |
+ popd > /dev/null |
334 |
+ fi |
335 |
+ mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die |
336 |
+ fi |
337 |
+ |
338 |
+ mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die |
339 |
+ |
340 |
+ # Fix texi2html build error with new texi2html, qemu.doc.html |
341 |
+ sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die |
342 |
+ |
343 |
+ use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die |
344 |
+ sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \ |
345 |
+ -i tools/firmware/Makefile || die |
346 |
+ |
347 |
+ # Drop .config, fixes to gcc-4.6 |
348 |
+ sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop" |
349 |
+ |
350 |
+ # if the user *really* wants to use their own custom-cflags, let them |
351 |
+ if use custom-cflags; then |
352 |
+ einfo "User wants their own CFLAGS - removing defaults" |
353 |
+ |
354 |
+ # try and remove all the default cflags |
355 |
+ find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \ |
356 |
+ -exec sed \ |
357 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \ |
358 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \ |
359 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \ |
360 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \ |
361 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ |
362 |
+ -i {} + || die "failed to re-set custom-cflags" |
363 |
+ else |
364 |
+ unset CFLAGS |
365 |
+ unset LDFLAGS |
366 |
+ unset ASFLAGS |
367 |
+ unset CPPFLAGS |
368 |
+ fi |
369 |
+ |
370 |
+ if ! use pygrub; then |
371 |
+ sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die |
372 |
+ fi |
373 |
+ |
374 |
+ if ! use python; then |
375 |
+ sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die |
376 |
+ fi |
377 |
+ |
378 |
+ if ! use hvm; then |
379 |
+ sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die |
380 |
+ # Bug 351648 |
381 |
+ elif ! use x86 && ! has x86 $(get_all_abis); then |
382 |
+ mkdir -p "${WORKDIR}"/extra-headers/gnu || die |
383 |
+ touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die |
384 |
+ export CPATH="${WORKDIR}"/extra-headers |
385 |
+ fi |
386 |
+ |
387 |
+ if use qemu; then |
388 |
+ if use sdl; then |
389 |
+ sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \ |
390 |
+ tools/Makefile || die |
391 |
+ else |
392 |
+ sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \ |
393 |
+ tools/qemu-xen-traditional/xen-setup || die |
394 |
+ sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \ |
395 |
+ tools/Makefile || die |
396 |
+ fi |
397 |
+ else |
398 |
+ # Don't bother with qemu, only needed for fully virtualised guests |
399 |
+ sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die |
400 |
+ fi |
401 |
+ |
402 |
+ # Reset bash completion dir; Bug 472438 |
403 |
+ sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \ |
404 |
+ -i Config.mk || die |
405 |
+ sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die |
406 |
+ |
407 |
+ # xencommons, Bug #492332, sed lighter weight than patching |
408 |
+ sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \ |
409 |
+ -i tools/hotplug/Linux/init.d/xencommons.in || die |
410 |
+ |
411 |
+ # respect multilib, usr/lib/libcacard.so.0.0.0 |
412 |
+ sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \ |
413 |
+ -i tools/qemu-xen/configure || die |
414 |
+ |
415 |
+ #bug 518136, don't build 32bit exactuable for nomultilib profile |
416 |
+ if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then |
417 |
+ sed -i -e "/x86_emulator/d" tools/tests/Makefile || die |
418 |
+ fi |
419 |
+ |
420 |
+ # use /var instead of /var/lib, consistat with previous ebuild |
421 |
+ sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \ |
422 |
+ m4/paths.m4 configure tools/configure || die |
423 |
+ # use /run instead of /var/run |
424 |
+ sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \ |
425 |
+ m4/paths.m4 configure tools/configure || die |
426 |
+ |
427 |
+ # uncomment lines in xl.conf |
428 |
+ sed -e 's:^#autoballoon=:autoballoon=:' \ |
429 |
+ -e 's:^#lockfile=:lockfile=:' \ |
430 |
+ -e 's:^#vif.default.script=:vif.default.script=:' \ |
431 |
+ -i tools/examples/xl.conf || die |
432 |
+ |
433 |
+ # Bug #575868 converted to a sed statement, typo of one char |
434 |
+ sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die |
435 |
+ |
436 |
+ epatch_user |
437 |
+} |
438 |
+ |
439 |
+src_configure() { |
440 |
+ local myconf="--prefix=${PREFIX}/usr \ |
441 |
+ --libdir=${PREFIX}/usr/$(get_libdir) \ |
442 |
+ --libexecdir=${PREFIX}/usr/libexec \ |
443 |
+ --disable-werror \ |
444 |
+ --disable-xen \ |
445 |
+ --enable-tools \ |
446 |
+ --enable-docs \ |
447 |
+ $(use_with system-qemu) \ |
448 |
+ $(use_enable pam) \ |
449 |
+ $(use_enable api xenapi) \ |
450 |
+ $(use_enable ovmf) \ |
451 |
+ $(use_enable ocaml ocamltools) \ |
452 |
+ --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \ |
453 |
+ " |
454 |
+ |
455 |
+ use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin" |
456 |
+ use qemu || myconf+=" --with-system-qemu" |
457 |
+ use amd64 && myconf+=" $(use_enable qemu-traditional)" |
458 |
+ econf ${myconf} |
459 |
+} |
460 |
+ |
461 |
+src_compile() { |
462 |
+ export VARTEXFONTS="${T}/fonts" |
463 |
+ local myopt |
464 |
+ use debug && myopt="${myopt} debug=y" |
465 |
+ |
466 |
+ if test-flag-CC -fno-strict-overflow; then |
467 |
+ append-flags -fno-strict-overflow |
468 |
+ fi |
469 |
+ |
470 |
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt} |
471 |
+ |
472 |
+ use doc && emake -C docs txt html |
473 |
+ emake -C docs man-pages |
474 |
+} |
475 |
+ |
476 |
+src_install() { |
477 |
+ # Override auto-detection in the build system, bug #382573 |
478 |
+ export INITD_DIR=/tmp/init.d |
479 |
+ export CONFIG_LEAF_DIR=../tmp/default |
480 |
+ |
481 |
+ # Let the build system compile installed Python modules. |
482 |
+ local PYTHONDONTWRITEBYTECODE |
483 |
+ export PYTHONDONTWRITEBYTECODE |
484 |
+ |
485 |
+ emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \ |
486 |
+ XEN_PYTHON_NATIVE_INSTALL=y install-tools |
487 |
+ |
488 |
+ # Fix the remaining Python shebangs. |
489 |
+ python_fix_shebang "${D}" |
490 |
+ |
491 |
+ # Remove RedHat-specific stuff |
492 |
+ rm -rf "${D}"tmp || die |
493 |
+ |
494 |
+ if use doc; then |
495 |
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs |
496 |
+ |
497 |
+ dohtml -r docs/ |
498 |
+ docinto pdf |
499 |
+ dodoc ${DOCS[@]} |
500 |
+ [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html |
501 |
+ fi |
502 |
+ |
503 |
+ rm -rf "${D}"/usr/share/doc/xen/ |
504 |
+ doman docs/man?/* |
505 |
+ |
506 |
+ newconfd "${FILESDIR}"/xendomains.confd xendomains |
507 |
+ newconfd "${FILESDIR}"/xenstored.confd xenstored |
508 |
+ newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled |
509 |
+ newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains |
510 |
+ newinitd "${FILESDIR}"/xenstored.initd xenstored |
511 |
+ newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled |
512 |
+ newinitd "${FILESDIR}"/xencommons.initd xencommons |
513 |
+ newconfd "${FILESDIR}"/xencommons.confd xencommons |
514 |
+ newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev |
515 |
+ newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev |
516 |
+ |
517 |
+ if use screen; then |
518 |
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die |
519 |
+ cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die |
520 |
+ keepdir /var/log/xen-consoles |
521 |
+ fi |
522 |
+ |
523 |
+ # For -static-libs wrt Bug 384355 |
524 |
+ if ! use static-libs; then |
525 |
+ rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a |
526 |
+ fi |
527 |
+ |
528 |
+ # for xendomains |
529 |
+ keepdir /etc/xen/auto |
530 |
+ |
531 |
+ # Remove files failing QA AFTER emake installs them, avoiding seeking absent files |
532 |
+ find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \ |
533 |
+ -o -name openbios-ppc -o -name palcode-clipper \) -delete || die |
534 |
+} |
535 |
+ |
536 |
+pkg_postinst() { |
537 |
+ elog "Official Xen Guide and the offical wiki page:" |
538 |
+ elog "https://wiki.gentoo.org/wiki/Xen" |
539 |
+ elog "http://wiki.xen.org/wiki/Main_Page" |
540 |
+ elog "" |
541 |
+ elog "Recommended to utilise the xencommons script to config sytem At boot" |
542 |
+ elog "Add by use of rc-update on completion of the install" |
543 |
+ |
544 |
+ if ! use hvm; then |
545 |
+ echo |
546 |
+ elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm" |
547 |
+ elog "support enable the hvm use flag." |
548 |
+ elog "An x86 or amd64 system is required to build HVM support." |
549 |
+ fi |
550 |
+ |
551 |
+ if use qemu; then |
552 |
+ elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source" |
553 |
+ elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently" |
554 |
+ elog "with the qemu capable xen. It is up to the user to distinguish between and utilise" |
555 |
+ elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise" |
556 |
+ fi |
557 |
+} |
558 |
|
559 |
diff --git a/app-emulation/xen-tools/xen-tools-4.7.0.ebuild b/app-emulation/xen-tools/xen-tools-4.7.0.ebuild |
560 |
new file mode 100644 |
561 |
index 0000000..62d7661 |
562 |
--- /dev/null |
563 |
+++ b/app-emulation/xen-tools/xen-tools-4.7.0.ebuild |
564 |
@@ -0,0 +1,458 @@ |
565 |
+# Copyright 1999-2016 Gentoo Foundation |
566 |
+# Distributed under the terms of the GNU General Public License v2 |
567 |
+# $Id$ |
568 |
+ |
569 |
+EAPI=5 |
570 |
+ |
571 |
+PYTHON_COMPAT=( python2_7 ) |
572 |
+PYTHON_REQ_USE='ncurses,xml,threads' |
573 |
+ |
574 |
+inherit eutils bash-completion-r1 flag-o-matic multilib python-single-r1 toolchain-funcs versionator |
575 |
+ |
576 |
+MY_PV=${PV/_/-} |
577 |
+MAJOR_V="$(get_version_component_range 1-2)" |
578 |
+ |
579 |
+if [[ $PV == *9999 ]]; then |
580 |
+ inherit git-r3 |
581 |
+ KEYWORDS="" |
582 |
+ REPO="xen.git" |
583 |
+ EGIT_REPO_URI="git://xenbits.xen.org/${REPO}" |
584 |
+ S="${WORKDIR}/${REPO}" |
585 |
+else |
586 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
587 |
+ UPSTREAM_VER= |
588 |
+ SECURITY_VER= |
589 |
+ # xen-tools's gentoo patches tarball |
590 |
+ GENTOO_VER=6 |
591 |
+ # xen-tools's gentoo patches version which apply to this specific ebuild |
592 |
+ GENTOO_GPV=0 |
593 |
+ # xen-tools ovmf's patches |
594 |
+ OVMF_VER=2 |
595 |
+ |
596 |
+ SEABIOS_VER=1.8.2 |
597 |
+ # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d |
598 |
+ OVMF_PV=20151110 |
599 |
+ |
600 |
+ [[ -n ${UPSTREAM_VER} ]] && \ |
601 |
+ UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz" |
602 |
+ [[ -n ${SECURITY_VER} ]] && \ |
603 |
+ SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz" |
604 |
+ [[ -n ${GENTOO_VER} ]] && \ |
605 |
+ GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz" |
606 |
+ [[ -n ${OVMF_VER} ]] && \ |
607 |
+ OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz" |
608 |
+ |
609 |
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz |
610 |
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz |
611 |
+ https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz |
612 |
+ ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2 |
613 |
+ ${OVMF_PATCHSET_URI} ) |
614 |
+ ${UPSTREAM_PATCHSET_URI} |
615 |
+ ${SECURITY_PATCHSET_URI} |
616 |
+ ${GENTOO_PATCHSET_URI}" |
617 |
+ |
618 |
+ S="${WORKDIR}/xen-${MY_PV}" |
619 |
+fi |
620 |
+ |
621 |
+DESCRIPTION="Xen tools including QEMU and xl" |
622 |
+HOMEPAGE="http://xen.org/" |
623 |
+DOCS=( README docs/README.xen-bugtool ) |
624 |
+ |
625 |
+LICENSE="GPL-2" |
626 |
+SLOT="0/${MAJOR_V}" |
627 |
+# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make |
628 |
+# >=dev-lang/ocaml-4 stable |
629 |
+# Masked in profiles/eapi-5-files instead |
630 |
+IUSE="api custom-cflags debug doc flask hvm qemu ocaml ovmf +qemu-traditional +pam python pygrub screen sdl static-libs system-qemu system-seabios" |
631 |
+ |
632 |
+REQUIRED_USE="hvm? ( || ( qemu system-qemu ) ) |
633 |
+ ${PYTHON_REQUIRED_USE} |
634 |
+ pygrub? ( python ) |
635 |
+ ovmf? ( hvm ) |
636 |
+ qemu? ( !system-qemu )" |
637 |
+ |
638 |
+COMMON_DEPEND=" |
639 |
+ dev-libs/lzo:2 |
640 |
+ dev-libs/glib:2 |
641 |
+ dev-libs/yajl |
642 |
+ dev-libs/libaio |
643 |
+ dev-libs/libgcrypt:0 |
644 |
+ sys-libs/zlib |
645 |
+" |
646 |
+ |
647 |
+DEPEND="${COMMON_DEPEND} |
648 |
+ dev-python/lxml[${PYTHON_USEDEP}] |
649 |
+ x86? ( sys-devel/dev86 |
650 |
+ sys-power/iasl ) |
651 |
+ pam? ( dev-python/pypam[${PYTHON_USEDEP}] ) |
652 |
+ ${PYTHON_DEPS} |
653 |
+ api? ( dev-libs/libxml2 |
654 |
+ net-misc/curl ) |
655 |
+ ovmf? ( $(python_gen_impl_dep sqlite) ) |
656 |
+ !amd64? ( >=sys-apps/dtc-1.4.0 ) |
657 |
+ amd64? ( sys-devel/bin86 |
658 |
+ system-seabios? ( sys-firmware/seabios ) |
659 |
+ sys-firmware/ipxe |
660 |
+ sys-devel/dev86 |
661 |
+ sys-power/iasl ) |
662 |
+ dev-lang/perl |
663 |
+ app-misc/pax-utils |
664 |
+ doc? ( |
665 |
+ app-doc/doxygen |
666 |
+ dev-python/markdown[${PYTHON_USEDEP}] |
667 |
+ dev-tex/latex2html[png,gif] |
668 |
+ media-gfx/graphviz |
669 |
+ dev-tex/xcolor |
670 |
+ media-gfx/transfig |
671 |
+ dev-texlive/texlive-latexextra |
672 |
+ virtual/latex-base |
673 |
+ dev-tex/latexmk |
674 |
+ dev-texlive/texlive-latex |
675 |
+ dev-texlive/texlive-pictures |
676 |
+ dev-texlive/texlive-latexrecommended |
677 |
+ ) |
678 |
+ hvm? ( x11-proto/xproto |
679 |
+ !net-libs/libiscsi ) |
680 |
+ qemu? ( |
681 |
+ x11-libs/pixman |
682 |
+ sdl? ( media-libs/libsdl[X] ) |
683 |
+ ) |
684 |
+ system-qemu? ( app-emulation/qemu[xen] ) |
685 |
+ ocaml? ( dev-ml/findlib |
686 |
+ >=dev-lang/ocaml-4 )" |
687 |
+ |
688 |
+RDEPEND="${COMMON_DEPEND} |
689 |
+ sys-apps/iproute2[-minimal] |
690 |
+ net-misc/bridge-utils |
691 |
+ screen? ( |
692 |
+ app-misc/screen |
693 |
+ app-admin/logrotate |
694 |
+ )" |
695 |
+ |
696 |
+# hvmloader is used to bootstrap a fully virtualized kernel |
697 |
+# Approved by QA team in bug #144032 |
698 |
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader |
699 |
+ usr/share/qemu-xen/qemu/s390-ccw.img" |
700 |
+ |
701 |
+RESTRICT="test" |
702 |
+ |
703 |
+pkg_setup() { |
704 |
+ python_setup |
705 |
+ export "CONFIG_LOMOUNT=y" |
706 |
+ |
707 |
+ #bug 522642, disable compile tools/tests |
708 |
+ export "CONFIG_TESTS=n" |
709 |
+ |
710 |
+ if has_version dev-libs/libgcrypt:0; then |
711 |
+ export "CONFIG_GCRYPT=y" |
712 |
+ fi |
713 |
+ |
714 |
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then |
715 |
+ if use x86 && use amd64; then |
716 |
+ die "Confusion! Both x86 and amd64 are set in your use flags!" |
717 |
+ elif use x86; then |
718 |
+ export XEN_TARGET_ARCH="x86_32" |
719 |
+ elif use amd64 ; then |
720 |
+ export XEN_TARGET_ARCH="x86_64" |
721 |
+ elif use arm; then |
722 |
+ export XEN_TARGET_ARCH="arm32" |
723 |
+ elif use arm64; then |
724 |
+ export XEN_TARGET_ARCH="arm64" |
725 |
+ else |
726 |
+ die "Unsupported architecture!" |
727 |
+ fi |
728 |
+ fi |
729 |
+} |
730 |
+ |
731 |
+src_prepare() { |
732 |
+ # Upstream's patchset |
733 |
+ if [[ -n ${UPSTREAM_VER} ]]; then |
734 |
+ einfo "Try to apply Xen Upstream patch set" |
735 |
+ EPATCH_SUFFIX="patch" \ |
736 |
+ EPATCH_FORCE="yes" \ |
737 |
+ EPATCH_OPTS="-p1" \ |
738 |
+ epatch "${WORKDIR}"/patches-upstream |
739 |
+ fi |
740 |
+ |
741 |
+ # Security patchset |
742 |
+ if [[ -n ${SECURITY_VER} ]]; then |
743 |
+ einfo "Try to apply Xen Security patch set" |
744 |
+ # apply main xen patches |
745 |
+ # Two parallel systems, both work side by side |
746 |
+ # Over time they may concdense into one. This will suffice for now |
747 |
+ EPATCH_SUFFIX="patch" |
748 |
+ EPATCH_FORCE="yes" |
749 |
+ |
750 |
+ source "${WORKDIR}"/patches-security/${PV}.conf |
751 |
+ |
752 |
+ for i in ${XEN_SECURITY_MAIN}; do |
753 |
+ epatch "${WORKDIR}"/patches-security/xen/$i |
754 |
+ done |
755 |
+ |
756 |
+ # apply qemu-xen/upstream patches |
757 |
+ pushd "${S}"/tools/qemu-xen/ > /dev/null |
758 |
+ for i in ${XEN_SECURITY_QEMUU}; do |
759 |
+ epatch "${WORKDIR}"/patches-security/qemuu/$i |
760 |
+ done |
761 |
+ popd > /dev/null |
762 |
+ |
763 |
+ # apply qemu-traditional patches |
764 |
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null |
765 |
+ for i in ${XEN_SECURITY_QEMUT}; do |
766 |
+ epatch "${WORKDIR}"/patches-security/qemut/$i |
767 |
+ done |
768 |
+ popd > /dev/null |
769 |
+ fi |
770 |
+ |
771 |
+ # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err |
772 |
+ mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die |
773 |
+ pushd tools/firmware/ > /dev/null |
774 |
+ ln -s seabios-dir-remote seabios-dir || die |
775 |
+ popd > /dev/null |
776 |
+ |
777 |
+ # Gentoo's patchset |
778 |
+ if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then |
779 |
+ einfo "Try to apply Gentoo specific patch set" |
780 |
+ source "${FILESDIR}"/gentoo-patches.conf |
781 |
+ _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV} |
782 |
+ for i in ${!_gpv}; do |
783 |
+ EPATCH_SUFFIX="patch" \ |
784 |
+ EPATCH_FORCE="yes" \ |
785 |
+ epatch "${WORKDIR}"/patches-gentoo/$i |
786 |
+ done |
787 |
+ fi |
788 |
+ |
789 |
+ # Ovmf's patchset |
790 |
+ if use ovmf; then |
791 |
+ if [[ -n ${OVMF_VER} ]];then |
792 |
+ einfo "Try to apply Ovmf patch set" |
793 |
+ pushd "${WORKDIR}"/ovmf-*/ > /dev/null |
794 |
+ EPATCH_SUFFIX="patch" \ |
795 |
+ EPATCH_FORCE="yes" \ |
796 |
+ EPATCH_OPTS="-p1" \ |
797 |
+ epatch "${WORKDIR}"/patches-ovmf |
798 |
+ popd > /dev/null |
799 |
+ fi |
800 |
+ mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die |
801 |
+ fi |
802 |
+ |
803 |
+ mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die |
804 |
+ |
805 |
+ # Fix texi2html build error with new texi2html, qemu.doc.html |
806 |
+ sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die |
807 |
+ |
808 |
+ use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die |
809 |
+ sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \ |
810 |
+ -i tools/firmware/Makefile || die |
811 |
+ |
812 |
+ # Drop .config, fixes to gcc-4.6 |
813 |
+ sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop" |
814 |
+ |
815 |
+ # if the user *really* wants to use their own custom-cflags, let them |
816 |
+ if use custom-cflags; then |
817 |
+ einfo "User wants their own CFLAGS - removing defaults" |
818 |
+ |
819 |
+ # try and remove all the default cflags |
820 |
+ find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \ |
821 |
+ -exec sed \ |
822 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \ |
823 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \ |
824 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \ |
825 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \ |
826 |
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ |
827 |
+ -i {} + || die "failed to re-set custom-cflags" |
828 |
+ else |
829 |
+ unset CFLAGS |
830 |
+ unset LDFLAGS |
831 |
+ unset ASFLAGS |
832 |
+ unset CPPFLAGS |
833 |
+ fi |
834 |
+ |
835 |
+ if ! use pygrub; then |
836 |
+ sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die |
837 |
+ fi |
838 |
+ |
839 |
+ if ! use python; then |
840 |
+ sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die |
841 |
+ fi |
842 |
+ |
843 |
+ if ! use hvm; then |
844 |
+ sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die |
845 |
+ # Bug 351648 |
846 |
+ elif ! use x86 && ! has x86 $(get_all_abis); then |
847 |
+ mkdir -p "${WORKDIR}"/extra-headers/gnu || die |
848 |
+ touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die |
849 |
+ export CPATH="${WORKDIR}"/extra-headers |
850 |
+ fi |
851 |
+ |
852 |
+ if use qemu; then |
853 |
+ if use sdl; then |
854 |
+ sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \ |
855 |
+ tools/Makefile || die |
856 |
+ else |
857 |
+ sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \ |
858 |
+ tools/qemu-xen-traditional/xen-setup || die |
859 |
+ sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \ |
860 |
+ tools/Makefile || die |
861 |
+ fi |
862 |
+ else |
863 |
+ # Don't bother with qemu, only needed for fully virtualised guests |
864 |
+ sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die |
865 |
+ fi |
866 |
+ |
867 |
+ # Reset bash completion dir; Bug 472438 |
868 |
+ sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \ |
869 |
+ -i Config.mk || die |
870 |
+ sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die |
871 |
+ |
872 |
+ # xencommons, Bug #492332, sed lighter weight than patching |
873 |
+ sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \ |
874 |
+ -i tools/hotplug/Linux/init.d/xencommons.in || die |
875 |
+ |
876 |
+ # respect multilib, usr/lib/libcacard.so.0.0.0 |
877 |
+ sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \ |
878 |
+ -i tools/qemu-xen/configure || die |
879 |
+ |
880 |
+ #bug 518136, don't build 32bit exactuable for nomultilib profile |
881 |
+ if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then |
882 |
+ sed -i -e "/x86_emulator/d" tools/tests/Makefile || die |
883 |
+ fi |
884 |
+ |
885 |
+ # use /var instead of /var/lib, consistat with previous ebuild |
886 |
+ sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \ |
887 |
+ m4/paths.m4 configure tools/configure || die |
888 |
+ # use /run instead of /var/run |
889 |
+ sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \ |
890 |
+ m4/paths.m4 configure tools/configure || die |
891 |
+ |
892 |
+ # uncomment lines in xl.conf |
893 |
+ sed -e 's:^#autoballoon=:autoballoon=:' \ |
894 |
+ -e 's:^#lockfile=:lockfile=:' \ |
895 |
+ -e 's:^#vif.default.script=:vif.default.script=:' \ |
896 |
+ -i tools/examples/xl.conf || die |
897 |
+ |
898 |
+ # Bug #575868 converted to a sed statement, typo of one char |
899 |
+ sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die |
900 |
+ |
901 |
+ epatch_user |
902 |
+} |
903 |
+ |
904 |
+src_configure() { |
905 |
+ local myconf="--prefix=${PREFIX}/usr \ |
906 |
+ --libdir=${PREFIX}/usr/$(get_libdir) \ |
907 |
+ --libexecdir=${PREFIX}/usr/libexec \ |
908 |
+ --disable-werror \ |
909 |
+ --disable-xen \ |
910 |
+ --enable-tools \ |
911 |
+ --enable-docs \ |
912 |
+ $(use_with system-qemu) \ |
913 |
+ $(use_enable pam) \ |
914 |
+ $(use_enable api xenapi) \ |
915 |
+ $(use_enable ovmf) \ |
916 |
+ $(use_enable ocaml ocamltools) \ |
917 |
+ --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \ |
918 |
+ " |
919 |
+ |
920 |
+ use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin" |
921 |
+ use qemu || myconf+=" --with-system-qemu" |
922 |
+ use amd64 && myconf+=" $(use_enable qemu-traditional)" |
923 |
+ econf ${myconf} |
924 |
+} |
925 |
+ |
926 |
+src_compile() { |
927 |
+ export VARTEXFONTS="${T}/fonts" |
928 |
+ local myopt |
929 |
+ use debug && myopt="${myopt} debug=y" |
930 |
+ |
931 |
+ if test-flag-CC -fno-strict-overflow; then |
932 |
+ append-flags -fno-strict-overflow |
933 |
+ fi |
934 |
+ |
935 |
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt} |
936 |
+ |
937 |
+ use doc && emake -C docs txt html |
938 |
+ emake -C docs man-pages |
939 |
+} |
940 |
+ |
941 |
+src_install() { |
942 |
+ # Override auto-detection in the build system, bug #382573 |
943 |
+ export INITD_DIR=/tmp/init.d |
944 |
+ export CONFIG_LEAF_DIR=../tmp/default |
945 |
+ |
946 |
+ # Let the build system compile installed Python modules. |
947 |
+ local PYTHONDONTWRITEBYTECODE |
948 |
+ export PYTHONDONTWRITEBYTECODE |
949 |
+ |
950 |
+ emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \ |
951 |
+ XEN_PYTHON_NATIVE_INSTALL=y install-tools |
952 |
+ |
953 |
+ # Fix the remaining Python shebangs. |
954 |
+ python_fix_shebang "${D}" |
955 |
+ |
956 |
+ # Remove RedHat-specific stuff |
957 |
+ rm -rf "${D}"tmp || die |
958 |
+ |
959 |
+ if use doc; then |
960 |
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs |
961 |
+ |
962 |
+ dohtml -r docs/ |
963 |
+ docinto pdf |
964 |
+ dodoc ${DOCS[@]} |
965 |
+ [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html |
966 |
+ fi |
967 |
+ |
968 |
+ rm -rf "${D}"/usr/share/doc/xen/ |
969 |
+ doman docs/man?/* |
970 |
+ |
971 |
+ newconfd "${FILESDIR}"/xendomains.confd xendomains |
972 |
+ newconfd "${FILESDIR}"/xenstored.confd xenstored |
973 |
+ newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled |
974 |
+ newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains |
975 |
+ newinitd "${FILESDIR}"/xenstored.initd xenstored |
976 |
+ newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled |
977 |
+ newinitd "${FILESDIR}"/xencommons.initd xencommons |
978 |
+ newconfd "${FILESDIR}"/xencommons.confd xencommons |
979 |
+ newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev |
980 |
+ newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev |
981 |
+ |
982 |
+ if use screen; then |
983 |
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die |
984 |
+ cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die |
985 |
+ keepdir /var/log/xen-consoles |
986 |
+ fi |
987 |
+ |
988 |
+ # For -static-libs wrt Bug 384355 |
989 |
+ if ! use static-libs; then |
990 |
+ rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a |
991 |
+ fi |
992 |
+ |
993 |
+ # for xendomains |
994 |
+ keepdir /etc/xen/auto |
995 |
+ |
996 |
+ # Remove files failing QA AFTER emake installs them, avoiding seeking absent files |
997 |
+ find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \ |
998 |
+ -o -name openbios-ppc -o -name palcode-clipper \) -delete || die |
999 |
+} |
1000 |
+ |
1001 |
+pkg_postinst() { |
1002 |
+ elog "Official Xen Guide and the offical wiki page:" |
1003 |
+ elog "https://wiki.gentoo.org/wiki/Xen" |
1004 |
+ elog "http://wiki.xen.org/wiki/Main_Page" |
1005 |
+ elog "" |
1006 |
+ elog "Recommended to utilise the xencommons script to config sytem At boot" |
1007 |
+ elog "Add by use of rc-update on completion of the install" |
1008 |
+ |
1009 |
+ if ! use hvm; then |
1010 |
+ echo |
1011 |
+ elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm" |
1012 |
+ elog "support enable the hvm use flag." |
1013 |
+ elog "An x86 or amd64 system is required to build HVM support." |
1014 |
+ fi |
1015 |
+ |
1016 |
+ if use qemu; then |
1017 |
+ elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source" |
1018 |
+ elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently" |
1019 |
+ elog "with the qemu capable xen. It is up to the user to distinguish between and utilise" |
1020 |
+ elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise" |
1021 |
+ fi |
1022 |
+} |