Gentoo Archives: gentoo-commits

From: "Doug Goldstein (cardoe)" <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/qemu: ChangeLog qemu-1.2.1.ebuild
Date: Wed, 21 Nov 2012 20:27:01
Message-Id: 20121121202651.3EC4B20C65@flycatcher.gentoo.org
1 cardoe 12/11/21 20:26:51
2
3 Modified: ChangeLog
4 Added: qemu-1.2.1.ebuild
5 Log:
6 Version bump to qemu 1.2.1 + qemu-kvm 1.2.0 + extra upstream fixes. Should be Gentoo's first 1.2.x candidate.
7
8 (Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)
9
10 Revision Changes Path
11 1.145 app-emulation/qemu/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?rev=1.145&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?rev=1.145&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?r1=1.144&r2=1.145
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v
20 retrieving revision 1.144
21 retrieving revision 1.145
22 diff -u -r1.144 -r1.145
23 --- ChangeLog 21 Nov 2012 20:02:53 -0000 1.144
24 +++ ChangeLog 21 Nov 2012 20:26:51 -0000 1.145
25 @@ -1,6 +1,12 @@
26 # ChangeLog for app-emulation/qemu
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.144 2012/11/21 20:02:53 cardoe Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.145 2012/11/21 20:26:51 cardoe Exp $
30 +
31 +*qemu-1.2.1 (21 Nov 2012)
32 +
33 + 21 Nov 2012; Doug Goldstein <cardoe@g.o> +qemu-1.2.1.ebuild:
34 + Version bump to qemu 1.2.1 + qemu-kvm 1.2.0 + extra upstream fixes. Should be
35 + Gentoo's first 1.2.x candidate.
36
37 21 Nov 2012; Doug Goldstein <cardoe@g.o> qemu-9999.ebuild:
38 For 1.3 we're switching to qemu from qemu-kvm which is now merged fully into
39
40
41
42 1.1 app-emulation/qemu/qemu-1.2.1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-1.2.1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-1.2.1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: qemu-1.2.1.ebuild
48 ===================================================================
49 # Copyright 1999-2012 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-1.2.1.ebuild,v 1.1 2012/11/21 20:26:51 cardoe Exp $
52
53 EAPI="4"
54
55 MY_PN="qemu-kvm"
56 MY_P=${MY_PN}-1.2.0
57
58 PYTHON_DEPEND="2"
59 inherit eutils flag-o-matic linux-info toolchain-funcs multilib python user
60 BACKPORTS=3a5940fb
61
62 if [[ ${PV} = *9999* ]]; then
63 EGIT_REPO_URI="git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git"
64 inherit git-2
65 SRC_URI=""
66 KEYWORDS=""
67 else
68 SRC_URI="mirror://sourceforge/kvm/${MY_PN}/${MY_P}.tar.gz
69 ${BACKPORTS:+
70 http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
71 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
72 fi
73
74 DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
75 HOMEPAGE="http://www.linux-kvm.org"
76
77 LICENSE="GPL-2 LGPL-2 BSD-2"
78 SLOT="0"
79 IUSE="+aio alsa bluetooth brltty +caps +curl debug doc fdt +jpeg kernel_linux \
80 kernel_FreeBSD mixemu ncurses opengl +png pulseaudio python rbd sasl +seccomp \
81 sdl smartcard spice static systemtap tci +threads tls usbredir +uuid vde \
82 +vhost-net virtfs +vnc xattr xen xfs"
83
84 COMMON_TARGETS="i386 x86_64 alpha arm cris m68k microblaze microblazeel mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64 s390x"
85 IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 mips64 mips64el ppcemb xtensa xtensaeb"
86 IUSE_USER_TARGETS="${COMMON_TARGETS} armeb ppc64abi32 sparc32plus unicore32"
87
88 # Setup the default SoftMMU targets, while using the loops
89 # below to setup the other targets.
90 REQUIRED_USE="|| ("
91
92 for target in ${IUSE_SOFTMMU_TARGETS}; do
93 IUSE="${IUSE} qemu_softmmu_targets_${target}"
94 REQUIRED_USE="${REQUIRED_USE} qemu_softmmu_targets_${target}"
95 done
96 REQUIRED_USE="${REQUIRED_USE} )"
97
98 for target in ${IUSE_USER_TARGETS}; do
99 IUSE="${IUSE} qemu_user_targets_${target}"
100 done
101
102 # Block USE flag configurations known to not work
103 REQUIRED_USE="${REQUIRED_USE}
104 static? ( !alsa !pulseaudio !bluetooth )
105 virtfs? ( xattr )"
106
107 # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
108 LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
109 sys-apps/pciutils[static-libs(+)]
110 sys-libs/zlib[static-libs(+)]
111 aio? ( dev-libs/libaio[static-libs(+)] )
112 caps? ( sys-libs/libcap-ng[static-libs(+)] )
113 curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
114 fdt? ( >=sys-apps/dtc-1.2.0[static-libs(+)] )
115 jpeg? ( virtual/jpeg[static-libs(+)] )
116 ncurses? ( sys-libs/ncurses[static-libs(+)] )
117 png? ( media-libs/libpng[static-libs(+)] )
118 rbd? ( sys-cluster/ceph[static-libs(+)] )
119 sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
120 sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
121 seccomp? ( >=sys-libs/libseccomp-1.0.0[static-libs(+)] )
122 spice? ( >=app-emulation/spice-0.9.0[static-libs(+)] )
123 tls? ( net-libs/gnutls[static-libs(+)] )
124 uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
125 vde? ( net-misc/vde[static-libs(+)] )
126 xattr? ( sys-apps/attr[static-libs(+)] )
127 xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
128 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
129 !app-emulation/kqemu
130 sys-firmware/ipxe
131 >=sys-firmware/seabios-1.7.0
132 sys-firmware/sgabios
133 sys-firmware/vgabios
134 alsa? ( >=media-libs/alsa-lib-1.0.13 )
135 bluetooth? ( net-wireless/bluez )
136 brltty? ( app-accessibility/brltty )
137 opengl? ( virtual/opengl )
138 pulseaudio? ( media-sound/pulseaudio )
139 python? ( =dev-lang/python-2*[ncurses] )
140 sdl? ( media-libs/libsdl[X] )
141 smartcard? ( dev-libs/nss )
142 spice? ( >=app-emulation/spice-protocol-0.12.0 )
143 systemtap? ( dev-util/systemtap )
144 usbredir? ( sys-apps/usbredir )
145 virtfs? ( sys-libs/libcap )
146 xen? ( app-emulation/xen-tools )"
147
148 DEPEND="${RDEPEND}
149 virtual/pkgconfig
150 doc? ( app-text/texi2html )
151 kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
152 static? ( ${LIB_DEPEND} )"
153
154 S="${WORKDIR}/${MY_P}"
155
156 STRIP_MASK="/usr/share/qemu/palcode-clipper"
157
158 QA_PREBUILT="
159 usr/share/qemu/openbios-ppc
160 usr/share/qemu/openbios-sparc64
161 usr/share/qemu/openbios-sparc32
162 usr/share/qemu/palcode-clipper"
163
164 QA_WX_LOAD="${QA_PRESTRIPPED}
165 usr/bin/qemu-i386
166 usr/bin/qemu-x86_64
167 usr/bin/qemu-alpha
168 usr/bin/qemu-arm
169 usr/bin/qemu-cris
170 usr/bin/qemu-m68k
171 usr/bin/qemu-microblaze
172 usr/bin/qemu-mips
173 usr/bin/qemu-mipsel
174 usr/bin/qemu-ppc
175 usr/bin/qemu-ppc64
176 usr/bin/qemu-ppc64abi32
177 usr/bin/qemu-sh4
178 usr/bin/qemu-sh4eb
179 usr/bin/qemu-sparc
180 usr/bin/qemu-sparc64
181 usr/bin/qemu-armeb
182 usr/bin/qemu-sparc32plus"
183
184 pkg_pretend() {
185 if use kernel_linux && kernel_is lt 2 6 25; then
186 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
187 elif use kernel_linux; then
188 if ! linux_config_exists; then
189 eerror "Unable to check your kernel for KVM support"
190 else
191 CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
192 ERROR_KVM="You must enable KVM in your kernel to continue"
193 ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
194 ERROR_KVM_AMD+=" your kernel configuration."
195 ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
196 ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
197 ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
198 ERROR_TUN+=" into your kernel or loaded as a module to use the"
199 ERROR_TUN+=" virtual network device if using -net tap."
200 ERROR_BRIDGE="You will also need support for 802.1d"
201 ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
202 use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
203 ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
204 ERROR_VHOST_NET+=" support"
205
206 if use amd64 || use x86 || use amd64-linux || use x86-linux; then
207 CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
208 fi
209
210 use python && CONFIG_CHECK+=" ~DEBUG_FS"
211 ERROR_DEBUG_FS="debugFS support required for kvm_stat"
212
213 # Now do the actual checks setup above
214 check_extra_config
215 fi
216 fi
217
218 if use static; then
219 ewarn "USE=static is very much a moving target because of the packages"
220 ewarn "we depend on will have their static libs ripped out or wrapped"
221 ewarn "with USE=static-libs or USE=static due to continued dicsussion"
222 ewarn "on the mailing list about USE=static's place in Gentoo. As a"
223 ewarn "result what worked today may not work tomorrow."
224 fi
225 }
226
227 pkg_setup() {
228 python_set_active_version 2
229 python_pkg_setup
230
231 enewgroup kvm 78
232 }
233
234 src_prepare() {
235 # Alter target makefiles to accept CFLAGS set via flag-o
236 sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
237 Makefile Makefile.target || die
238
239 python_convert_shebangs -r 2 "${S}/scripts/kvm/kvm_stat"
240
241 epatch "${FILESDIR}"/qemu-1.2.0-cflags.patch
242 [[ -n ${BACKPORTS} ]] && \
243 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
244 epatch
245
246 epatch_user
247 }
248
249 src_configure() {
250 local conf_opts audio_opts user_targets
251
252 for target in ${IUSE_SOFTMMU_TARGETS} ; do
253 use "qemu_softmmu_targets_${target}" && \
254 softmmu_targets="${softmmu_targets} ${target}-softmmu"
255 done
256
257 for target in ${IUSE_USER_TARGETS} ; do
258 use "qemu_user_targets_${target}" && \
259 user_targets="${user_targets} ${target}-linux-user"
260 done
261
262 einfo "Building the following softmmu targets: ${softmmu_targets}"
263
264 if [[ -n ${user_targets} ]]; then
265 einfo "Building the following user targets: ${user_targets}"
266 conf_opts="${conf_opts} --enable-linux-user"
267 else
268 conf_opts="${conf_opts} --disable-linux-user"
269 fi
270
271 # Add support for SystemTAP
272 use systemtap && conf_opts="${conf_opts} --enable-trace-backend=dtrace"
273
274 # Fix QA issues. QEMU needs executable heaps and we need to mark it as such
275 #conf_opts="${conf_opts} --extra-ldflags=-Wl,-z,execheap"
276
277 # Add support for static builds
278 use static && conf_opts="${conf_opts} --static --disable-pie"
279
280 # We always want to attempt to build with PIE support as it results
281 # in a more secure binary. But it doesn't work with static or if
282 # the current GCC doesn't have PIE support.
283 if ! use static && gcc-specs-pie; then
284 conf_opts="${conf_opts} --enable-pie"
285 fi
286
287 # audio options
288 audio_opts="oss"
289 use alsa && audio_opts="alsa,${audio_opts}"
290 use sdl && audio_opts="sdl,${audio_opts}"
291 use pulseaudio && audio_opts="pa,${audio_opts}"
292 use mixemu && conf_opts="${conf_opts} --enable-mixemu"
293
294 ./configure --prefix=/usr \
295 --sysconfdir=/etc \
296 --disable-bsd-user \
297 --disable-guest-agent \
298 --disable-libiscsi \
299 --disable-strip \
300 --disable-werror \
301 --python=python2 \
302 $(use_enable aio linux-aio) \
303 $(use_enable bluetooth bluez) \
304 $(use_enable brltty brlapi) \
305 $(use_enable caps cap-ng) \
306 $(use_enable curl) \
307 $(use_enable debug debug-info) \
308 $(use_enable debug debug-tcg) \
309 $(use_enable doc docs) \
310 $(use_enable fdt) \
311 $(use_enable jpeg vnc-jpeg) \
312 $(use_enable kernel_linux kvm) \
313 $(use_enable kernel_linux nptl) \
314 $(use_enable ncurses curses) \
315 $(use_enable opengl) \
316 $(use_enable png vnc-png) \
317 $(use_enable rbd) \
318 $(use_enable sasl vnc-sasl) \
319 $(use_enable sdl) \
320 $(use_enable seccomp) \
321 $(use_enable smartcard smartcard) \
322 $(use_enable smartcard smartcard-nss) \
323 $(use_enable spice) \
324 $(use_enable tci tcg-interpreter) \
325 $(use_enable tls vnc-tls) \
326 $(use_enable usbredir usb-redir) \
327 $(use_enable uuid) \
328 $(use_enable vde) \
329 $(use_enable vhost-net) \
330 $(use_enable virtfs) \
331 $(use_enable vnc) \
332 $(use_enable xattr attr) \
333 $(use_enable xen) \
334 $(use_enable xen xen-pci-passthrough) \
335 $(use_enable xfs xfsctl) \
336 --audio-drv-list=${audio_opts} \
337 --target-list="${softmmu_targets} ${user_targets}" \
338 --cc="$(tc-getCC)" \
339 --host-cc="$(tc-getBUILD_CC)" \
340 ${conf_opts} \
341 || die "configure failed"
342
343 # FreeBSD's kernel does not support QEMU assigning/grabbing
344 # host USB devices yet
345 use kernel_FreeBSD && \
346 sed -E -e "s|^(HOST_USB=)bsd|\1stub|" -i "${S}"/config-host.mak
347 }
348
349 src_install() {
350 emake DESTDIR="${ED}" install
351
352 if [[ -n ${softmmu_targets} ]]; then
353 if use kernel_linux; then
354 insinto /lib/udev/rules.d/
355 doins "${FILESDIR}"/65-kvm.rules
356 fi
357
358 if use qemu_softmmu_targets_x86_64 ; then
359 dosym /usr/bin/qemu-system-x86_64 /usr/bin/qemu-kvm
360 ewarn "The depreciated '/usr/bin/kvm' symlink is no longer installed"
361 ewarn "You should use '/usr/bin/qemu-kvm', you may need to edit"
362 ewarn "your libvirt configs or other wrappers for ${PN}"
363 else
364 elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install"
365 elog "of the /usr/bin/qemu-kvm symlink."
366 fi
367 fi
368
369 dodoc Changelog MAINTAINERS TODO pci-ids.txt
370 newdoc pc-bios/README README.pc-bios
371
372 if use doc; then
373 dohtml qemu-doc.html qemu-tech.html || die
374 fi
375
376 use python & dobin scripts/kvm/kvm_stat
377
378 # Avoid collision with app-emulation/libcacard
379 use smartcard && mv "${ED}/usr/bin/vscclient" "${ED}/usr/bin/qemu-vscclient"
380
381 # Remove SeaBIOS since we're using the SeaBIOS packaged one
382 rm "${ED}/usr/share/qemu/bios.bin"
383 dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
384
385 # Remove vgabios since we're using the vgabios packaged one
386 rm "${ED}/usr/share/qemu/vgabios.bin"
387 rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
388 rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
389 rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
390 rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
391 dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
392 dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
393 dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
394 dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
395 dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
396
397 # Remove sgabios since we're using the sgabios packaged one
398 rm "${ED}/usr/share/qemu/sgabios.bin"
399 dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
400
401 # Remove iPXE since we're using the iPXE packaged one
402 rm "${ED}"/usr/share/qemu/pxe-*.rom
403 dosym ../ipxe/808610de.rom /usr/share/qemu/pxe-e1000.rom
404 dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
405 dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
406 dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
407 dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
408 dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
409 }
410
411 pkg_postinst() {
412 if [[ -n ${softmmu_targets} ]]; then
413 elog "If you don't have kvm compiled into the kernel, make sure you have"
414 elog "the kernel module loaded before running kvm. The easiest way to"
415 elog "ensure that the kernel module is loaded is to load it on boot."
416 elog "For AMD CPUs the module is called 'kvm-amd'"
417 elog "For Intel CPUs the module is called 'kvm-intel'"
418 elog "Please review /etc/conf.d/modules for how to load these"
419 elog
420 elog "Make sure your user is in the 'kvm' group"
421 elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
422 elog
423 elog "The ssl USE flag was renamed to tls, so adjust your USE flags."
424 elog "The nss USE flag was renamed to smartcard, so adjust your USE flags."
425 fi
426 }