Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/
Date: Tue, 28 Feb 2017 05:14:37
Message-Id: 1488258362.e6788f4442a0daaf2a75cc6302e5f0ef104c3624.tamiko@gentoo
1 commit: e6788f4442a0daaf2a75cc6302e5f0ef104c3624
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 00:18:08 2017 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 05:06:02 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6788f44
7
8 app-emulation/qemu: ebuild maintenance (2.8.0-r5)
9
10 This commit addresses several bugs in the current dependency handling.
11
12 - Almost all dependencies that were exclusively listed in
13 SOFTMMU_LIBS_DEPEND are needed for qemu user targets as well. This is
14 evidenced by trying to compile qemu with
15 USE="* -static -static-softmmu -static-user"
16 QEMU_USER_TARGETS="*" QEMU_SOFTMMU_TARGETS=""
17 in a minimal stage-3 environment.
18
19 The only remaining dependencies (exclusive for softmmu system
20 targets) are
21
22 - always build qemu-tools
23
24 - restructure dependencies, bug #611084
25
26 Package-Manager: Portage-2.3.3, Repoman-2.3.1
27
28 .../{qemu-2.8.0-r4.ebuild => qemu-2.8.0-r5.ebuild} | 155 +++++++++++----------
29 1 file changed, 78 insertions(+), 77 deletions(-)
30
31 diff --git a/app-emulation/qemu/qemu-2.8.0-r4.ebuild b/app-emulation/qemu/qemu-2.8.0-r5.ebuild
32 similarity index 84%
33 rename from app-emulation/qemu/qemu-2.8.0-r4.ebuild
34 rename to app-emulation/qemu/qemu-2.8.0-r5.ebuild
35 index 530bcd9d71..d4a03a7f1c 100644
36 --- a/app-emulation/qemu/qemu-2.8.0-r4.ebuild
37 +++ b/app-emulation/qemu/qemu-2.8.0-r5.ebuild
38 @@ -1,7 +1,7 @@
39 # Copyright 1999-2017 Gentoo Foundation
40 # Distributed under the terms of the GNU General Public License v2
41
42 -EAPI="5"
43 +EAPI="6"
44
45 PYTHON_COMPAT=( python2_7 )
46 PYTHON_REQ_USE="ncurses,readline"
47 @@ -25,19 +25,20 @@ HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
48
49 LICENSE="GPL-2 LGPL-2 BSD-2"
50 SLOT="0"
51 -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt glusterfs \
52 -gnutls gtk gtk2 infiniband iscsi +jpeg \
53 -kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
54 -+png pulseaudio python \
55 -rbd sasl +seccomp sdl sdl2 selinux smartcard snappy spice ssh static static-softmmu
56 -static-user systemtap tci test +threads usb usbredir vde +vhost-net \
57 -virgl virtfs +vnc vte xattr xen xfs"
58 -
59 -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
60 -mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64
61 -x86_64"
62 -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb"
63 -IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx"
64 +IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt
65 + glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux
66 + kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png
67 + pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy
68 + spice ssh static systemtap tci test +threads usb usbredir vde
69 + +vhost-net virgl virtfs +vnc vte xattr xen xfs"
70 +
71 +COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel
72 + mips mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc
73 + sparc64 x86_64"
74 +IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS}
75 + lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb"
76 +IUSE_USER_TARGETS="${COMMON_TARGETS}
77 + armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx"
78
79 use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
80 use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
81 @@ -52,32 +53,35 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
82 qemu_softmmu_targets_ppc? ( fdt )
83 qemu_softmmu_targets_ppc64? ( fdt )
84 sdl2? ( sdl )
85 - static? ( static-softmmu static-user )
86 - static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
87 + static? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
88 virtfs? ( xattr )
89 vte? ( gtk )"
90
91 +# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
92 +# and user/softmmu targets (qemu-*, qemu-system-*).
93 +#
94 # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
95 #
96 # The attr lib isn't always linked in (although the USE flag is always
97 # respected). This is because qemu supports using the C library's API
98 # when available rather than always using the extranl library.
99 #
100 -# Older versions of gnutls are supported, but it's simpler to just require
101 -# the latest versions. This is also why we require nettle.
102 -#
103 -# TODO: Split out tools deps into another var. e.g. bzip2 is only used by
104 -# system binaries and tools, not user binaries.
105 -COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
106 - sys-libs/zlib[static-libs(+)]
107 - bzip2? ( app-arch/bzip2[static-libs(+)] )
108 - xattr? ( sys-apps/attr[static-libs(+)] )"
109 -SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
110 +# To configure and compile qemu user targets or tools alone the following
111 +# dependencies are not strictly necessary:
112 +# alsa? ( >=media-libs/alsa-lib-1.0.13 )
113 +# fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
114 +# pulseaudio? ( media-sound/pulseaudio )
115 +# seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
116 +# but these are so few it is not worth the effort to separate this list.
117 +TARGETS_DEPEND="
118 + >=dev-libs/glib-2.0[static-libs(+)]
119 >=x11-libs/pixman-0.28.0[static-libs(+)]
120 + sys-libs/zlib[static-libs(+)]
121 accessibility? ( app-accessibility/brltty[static-libs(+)] )
122 aio? ( dev-libs/libaio[static-libs(+)] )
123 alsa? ( >=media-libs/alsa-lib-1.0.13 )
124 bluetooth? ( net-wireless/bluez )
125 + bzip2? ( app-arch/bzip2[static-libs(+)] )
126 caps? ( sys-libs/libcap-ng[static-libs(+)] )
127 curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
128 fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
129 @@ -114,6 +118,7 @@ SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
130 )
131 png? ( media-libs/libpng:0=[static-libs(+)] )
132 pulseaudio? ( media-sound/pulseaudio )
133 + python? ( ${PYTHON_DEPS} )
134 rbd? ( sys-cluster/ceph[static-libs(+)] )
135 sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
136 sdl? (
137 @@ -134,13 +139,16 @@ SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
138 >=app-emulation/spice-0.12.0[static-libs(+)]
139 )
140 ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
141 - usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
142 + systemtap? ( dev-util/systemtap )
143 usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
144 + usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
145 vde? ( net-misc/vde[static-libs(+)] )
146 virgl? ( media-libs/virglrenderer[static-libs(+)] )
147 virtfs? ( sys-libs/libcap )
148 + xattr? ( sys-apps/attr[static-libs(+)] )
149 + xen? ( app-emulation/xen-tools:= )
150 xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
151 -USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
152 +
153 X86_FIRMWARE_DEPEND="
154 >=sys-firmware/ipxe-1.0.0_p20130624
155 pin-upstream-blobs? (
156 @@ -153,14 +161,11 @@ X86_FIRMWARE_DEPEND="
157 sys-firmware/sgabios
158 sys-firmware/vgabios
159 )"
160 +
161 CDEPEND="
162 - !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
163 - !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
164 + !static? ( ${TARGETS_DEPEND//\[static-libs(+)]} )
165 qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
166 - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
167 - python? ( ${PYTHON_DEPS} )
168 - systemtap? ( dev-util/systemtap )
169 - xen? ( app-emulation/xen-tools:= )"
170 + qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )"
171 DEPEND="${CDEPEND}
172 dev-lang/perl
173 =dev-lang/python-2*
174 @@ -168,15 +173,39 @@ DEPEND="${CDEPEND}
175 virtual/pkgconfig
176 kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
177 gtk? ( nls? ( sys-devel/gettext ) )
178 - static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
179 - static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
180 + static? ( ${TARGETS_DEPEND} )
181 test? (
182 dev-libs/glib[utils]
183 sys-devel/bc
184 )"
185 RDEPEND="${CDEPEND}
186 - selinux? ( sec-policy/selinux-qemu )
187 -"
188 + selinux? ( sec-policy/selinux-qemu )"
189 +
190 +PATCHES=(
191 + "${FILESDIR}"/${PN}-2.5.0-cflags.patch
192 + "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
193 + "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8669-1.patch #597108
194 + "${FILESDIR}"/${PN}-2.8.0-CVE-2016-9908.patch #601826
195 + "${FILESDIR}"/${PN}-2.8.0-CVE-2016-9912.patch #602630
196 + "${FILESDIR}"/${PN}-2.8.0-CVE-2016-10028.patch #603444
197 + "${FILESDIR}"/${PN}-2.8.0-CVE-2016-10155.patch #606720
198 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2615.patch #608034
199 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2630.patch #609396
200 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5525-1.patch #606264
201 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5525-2.patch
202 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5552.patch #606722
203 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5578.patch #607000
204 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5579.patch #607100
205 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5667.patch #607766
206 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5856.patch #608036
207 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5857.patch #608038
208 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5898.patch #608520
209 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5931.patch #608728
210 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5973.patch #609334
211 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5987.patch #609398
212 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-6058.patch #609638
213 + "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2620.patch #609206
214 +)
215
216 STRIP_MASK="/usr/share/qemu/palcode-clipper"
217
218 @@ -186,8 +215,7 @@ QA_PREBUILT="
219 usr/share/qemu/openbios-sparc32
220 usr/share/qemu/palcode-clipper
221 usr/share/qemu/s390-ccw.img
222 - usr/share/qemu/u-boot.e500
223 -"
224 + usr/share/qemu/u-boot.e500"
225
226 QA_WX_LOAD="usr/bin/qemu-i386
227 usr/bin/qemu-x86_64
228 @@ -332,29 +360,7 @@ src_prepare() {
229 -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
230 Makefile Makefile.target || die
231
232 - epatch "${FILESDIR}"/${PN}-2.5.0-cflags.patch
233 - epatch "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
234 - epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8669-1.patch #597108
235 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-9908.patch #601826
236 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-9912.patch #602630
237 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-10028.patch #603444
238 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-10155.patch #606720
239 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2615.patch #608034
240 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2630.patch #609396
241 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5525-1.patch #606264
242 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5525-2.patch
243 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5552.patch #606722
244 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5578.patch #607000
245 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5579.patch #607100
246 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5667.patch #607766
247 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5856.patch #608036
248 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5857.patch #608038
249 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5898.patch #608520
250 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5931.patch #608728
251 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5973.patch #609334
252 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5987.patch #609398
253 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-6058.patch #609638
254 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2620.patch #609206
255 + default
256
257 # Fix ld and objcopy being called directly
258 tc-export AR LD OBJCOPY
259 @@ -362,8 +368,6 @@ src_prepare() {
260 # Verbose builds
261 MAKEOPTS+=" V=1"
262
263 - epatch_user
264 -
265 # Run after we've applied all patches.
266 handle_locales
267 }
268 @@ -377,7 +381,6 @@ qemu_src_configure() {
269
270 local buildtype=$1
271 local builddir="${S}/${buildtype}-build"
272 - local static_flag="static-${buildtype}"
273
274 mkdir "${builddir}"
275
276 @@ -477,6 +480,7 @@ qemu_src_configure() {
277 conf_opts+=(
278 --disable-linux-user
279 --enable-system
280 + --disable-tools
281 --with-system-pixman
282 --audio-drv-list="${audio_opts}"
283 )
284 @@ -488,9 +492,9 @@ qemu_src_configure() {
285 --disable-linux-user
286 --disable-system
287 --disable-blobs
288 + --enable-tools
289 $(use_enable bzip2)
290 )
291 - static_flag="static"
292 ;;
293 esac
294
295 @@ -503,7 +507,7 @@ qemu_src_configure() {
296 # We always want to attempt to build with PIE support as it results
297 # in a more secure binary. But it doesn't work with static or if
298 # the current GCC doesn't have PIE support.
299 - if use ${static_flag}; then
300 + if use static; then
301 conf_opts+=( --static --disable-pie )
302 else
303 gcc-specs-pie && conf_opts+=( --enable-pie )
304 @@ -546,7 +550,7 @@ src_configure() {
305
306 [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
307 [[ -n ${user_targets} ]] && qemu_src_configure "user"
308 - [[ -z ${softmmu_targets}${user_targets} ]] && qemu_src_configure "tools"
309 + qemu_src_configure "tools"
310 }
311
312 src_compile() {
313 @@ -560,10 +564,8 @@ src_compile() {
314 default
315 fi
316
317 - if [[ -z ${softmmu_targets}${user_targets} ]]; then
318 - cd "${S}/tools-build"
319 - default
320 - fi
321 + cd "${S}/tools-build"
322 + default
323 }
324
325 src_test() {
326 @@ -633,6 +635,7 @@ EOF
327 done
328 cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
329 }
330 +
331 src_install() {
332 if [[ -n ${user_targets} ]]; then
333 cd "${S}/user-build"
334 @@ -663,10 +666,8 @@ src_install() {
335 fi
336 fi
337
338 - if [[ -z ${softmmu_targets}${user_targets} ]]; then
339 - cd "${S}/tools-build"
340 - emake DESTDIR="${ED}" install
341 - fi
342 + cd "${S}/tools-build"
343 + emake DESTDIR="${ED}" install
344
345 # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
346 pushd "${ED}"/usr/bin >/dev/null