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-kvm: ChangeLog qemu-kvm-1.1.0.ebuild
Date: Tue, 03 Jul 2012 01:20:53
Message-Id: 20120703012036.0DD2D2004B@flycatcher.gentoo.org
1 cardoe 12/07/03 01:20:36
2
3 Modified: ChangeLog
4 Added: qemu-kvm-1.1.0.ebuild
5 Log:
6 Version bump for qemu-kvm 1.1.0. This is an initial testing version.
7
8 (Portage version: 2.1.11.4/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.122 app-emulation/qemu-kvm/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?rev=1.122&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?rev=1.122&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?r1=1.121&r2=1.122
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v
20 retrieving revision 1.121
21 retrieving revision 1.122
22 diff -u -r1.121 -r1.122
23 --- ChangeLog 31 May 2012 23:35:44 -0000 1.121
24 +++ ChangeLog 3 Jul 2012 01:20:35 -0000 1.122
25 @@ -1,6 +1,11 @@
26 # ChangeLog for app-emulation/qemu-kvm
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.121 2012/05/31 23:35:44 zmedico Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.122 2012/07/03 01:20:35 cardoe Exp $
30 +
31 +*qemu-kvm-1.1.0 (03 Jul 2012)
32 +
33 + 03 Jul 2012; Doug Goldstein <cardoe@g.o> +qemu-kvm-1.1.0.ebuild:
34 + Version bump for qemu-kvm 1.1.0. This is an initial testing version.
35
36 31 May 2012; Zac Medico <zmedico@g.o> qemu-kvm-0.15.1-r1.ebuild,
37 qemu-kvm-1.0-r3.ebuild, qemu-kvm-1.0.1-r1.ebuild, qemu-kvm-1.0.1.ebuild,
38
39
40
41 1.1 app-emulation/qemu-kvm/qemu-kvm-1.1.0.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-1.1.0.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-1.1.0.ebuild?rev=1.1&content-type=text/plain
45
46 Index: qemu-kvm-1.1.0.ebuild
47 ===================================================================
48 # Copyright 1999-2012 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-1.1.0.ebuild,v 1.1 2012/07/03 01:20:35 cardoe Exp $
51
52
53 EAPI="4"
54
55 inherit eutils flag-o-matic linux-info toolchain-funcs multilib python user
56
57 #BACKPORTS=1
58
59 if [[ ${PV} = *9999* ]]; then
60 EGIT_REPO_URI="git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git"
61
62 inherit git-2
63
64 SRC_URI=""
65 KEYWORDS=""
66 else
67 SRC_URI="mirror://sourceforge/kvm/${PN}/${P}.tar.gz
68 ${BACKPORTS:+
69 http://dev.gentoo.org/~flameeyes/${PN}/${P}-backports-${BACKPORTS}.tar.bz2
70 http://dev.gentoo.org/~cardoe/distfiles/${P}-backports-${BACKPORTS}.tar.bz2}"
71 KEYWORDS=""
72 fi
73
74 DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
75 HOMEPAGE="http://www.linux-kvm.org"
76
77 LICENSE="GPL-2"
78 SLOT="0"
79 # xen is disabled until the deps are fixed
80 IUSE="+aio alsa bluetooth brltty +curl debug fdt ncurses \
81 opengl pulseaudio qemu-ifup rbd sasl sdl smartcard spice static test
82 +threads tls usbredir vde +vhost-net xattr xen"
83
84 COMMON_TARGETS="i386 x86_64 arm cris m68k microblaze mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64"
85 IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} mips64 mips64el ppcemb"
86 IUSE_USER_TARGETS="${COMMON_TARGETS} alpha armeb ppc64abi32 sparc32plus"
87
88 # Setup the default SoftMMU targets, while using the loops
89 # below to setup the other targets. x86_64 should be the only
90 # defaults on for qemu-kvm
91 IUSE="${IUSE} +qemu_softmmu_targets_x86_64"
92
93 for target in ${IUSE_SOFTMMU_TARGETS}; do
94 if [ "x${target}" = "xx86_64" ]; then
95 continue
96 fi
97 IUSE="${IUSE} qemu_softmmu_targets_${target}"
98 done
99
100 for target in ${IUSE_USER_TARGETS}; do
101 IUSE="${IUSE} qemu_user_targets_${target}"
102 done
103
104 RDEPEND="
105 !app-emulation/kqemu
106 !app-emulation/qemu
107 !app-emulation/qemu-user
108 >=dev-libs/glib-2.0
109 media-libs/libpng
110 sys-apps/pciutils
111 >=sys-apps/util-linux-2.16.0
112 virtual/jpeg
113 amd64? ( sys-apps/seabios
114 sys-apps/vgabios )
115 x86? ( sys-apps/seabios
116 sys-apps/vgabios )
117 aio? ( dev-libs/libaio )
118 alsa? ( >=media-libs/alsa-lib-1.0.13 )
119 bluetooth? ( net-wireless/bluez )
120 brltty? ( app-accessibility/brltty )
121 curl? ( >=net-misc/curl-7.15.4 )
122 fdt? ( >=sys-apps/dtc-1.2.0 )
123 ncurses? ( sys-libs/ncurses )
124 opengl? ( virtual/opengl )
125 pulseaudio? ( media-sound/pulseaudio )
126 qemu-ifup? ( sys-apps/iproute2 net-misc/bridge-utils )
127 rbd? ( sys-cluster/ceph )
128 sasl? ( dev-libs/cyrus-sasl )
129 sdl? ( static? ( >=media-libs/libsdl-1.2.11[static-libs,X] )
130 !static? ( >=media-libs/libsdl-1.2.11[X] ) )
131 static? ( sys-libs/zlib[static-libs(+)] )
132 !static? ( sys-libs/zlib )
133 smartcard? ( dev-libs/nss )
134 spice? ( >=app-emulation/spice-0.9.0
135 >=app-emulation/spice-protocol-0.8.1 )
136 tls? ( net-libs/gnutls )
137 usbredir? ( sys-apps/usbredir )
138 vde? ( net-misc/vde )
139 xattr? ( sys-apps/attr )
140 xen? ( app-emulation/xen-tools )
141 "
142
143 DEPEND="${RDEPEND}
144 app-text/texi2html
145 virtual/pkgconfig
146 >=sys-kernel/linux-headers-2.6.35
147 test? ( dev-libs/check )"
148
149 STRIP_MASK="/usr/share/qemu/palcode-clipper"
150
151 QA_PRESTRIPPED="
152 usr/share/qemu/openbios-ppc
153 usr/share/qemu/openbios-sparc64
154 usr/share/qemu/openbios-sparc32
155 usr/share/qemu/palcode-clipper"
156
157 QA_WX_LOAD="${QA_PRESTRIPPED}
158 usr/bin/qemu-i386
159 usr/bin/qemu-x86_64
160 usr/bin/qemu-alpha
161 usr/bin/qemu-arm
162 usr/bin/qemu-cris
163 usr/bin/qemu-m68k
164 usr/bin/qemu-microblaze
165 usr/bin/qemu-mips
166 usr/bin/qemu-mipsel
167 usr/bin/qemu-ppc
168 usr/bin/qemu-ppc64
169 usr/bin/qemu-ppc64abi32
170 usr/bin/qemu-sh4
171 usr/bin/qemu-sh4eb
172 usr/bin/qemu-sparc
173 usr/bin/qemu-sparc64
174 usr/bin/qemu-armeb
175 usr/bin/qemu-sparc32plus"
176
177 pkg_pretend() {
178 if ! use qemu_softmmu_targets_x86_64 && use amd64 ; then
179 eerror "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64"
180 fi
181
182 if ! use qemu_softmmu_targets_x86_64 && use x86 ; then
183 eerror "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64"
184 fi
185
186 if kernel_is lt 2 6 25; then
187 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
188 eerror "Either upgrade your kernel"
189 else
190 if ! linux_config_exists; then
191 eerror "Unable to check your kernel for KVM support"
192 else
193 CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
194 ERROR_KVM="You must enable KVM in your kernel to continue"
195 ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
196 ERROR_KVM_AMD+=" your kernel configuration."
197 ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
198 ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
199 ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
200 ERROR_TUN+=" into your kernel or loaded as a module to use the"
201 ERROR_TUN+=" virtual network device if using -net tap."
202 ERROR_BRIDGE="You will also need support for 802.1d"
203 ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
204 use vhost-net && CHECK_CHECK+=" ~VHOST_NET"
205 ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
206 ERROR_VHOST_NET+=" support"
207
208 if use amd64 || use x86 || use amd64-linux || use x86-linux; then
209 CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
210 fi
211
212 # Now do the actual checks setup above
213 check_extra_config
214 fi
215 fi
216 }
217
218 pkg_setup() {
219 python_set_active_version 2
220
221 enewgroup kvm 78
222 }
223
224 src_prepare() {
225 # prevent docs to get automatically installed
226 sed -i '/$(DESTDIR)$(docdir)/d' Makefile || die
227 # Alter target makefiles to accept CFLAGS set via flag-o
228 sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
229 Makefile Makefile.target || die
230 # append CFLAGS while linking
231 sed -i 's/$(LDFLAGS)/$(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS)/' rules.mak || die
232
233 # remove part to make udev happy
234 sed -e 's~NAME="%k", ~~' -i kvm/scripts/65-kvm.rules || die
235
236 # ${PN}-guest-hang-on-usb-add.patch was sent by Timothy Jones
237 # to the qemu-devel ml - bug 337988
238 epatch "${FILESDIR}/qemu-0.11.0-mips64-user-fix.patch"
239
240 # Fix compilation of the qemu-system-ppc component
241 epatch "${FILESDIR}"/${PN}-1.0-fix-qemu-system-ppc.patch
242
243 # drop '-g' by default as it tends to eat
244 # A LOT (~2GB) of ram for each job #355861
245 sed -e 's/CFLAGS="-g $CFLAGS"/CFLAGS="$CFLAGS"/g' \
246 -i configure || die
247
248 # Quick fix for the bad version number
249 epatch "${FILESDIR}"/${P}-VERSION.patch
250
251 [[ -n ${BACKPORTS} ]] && \
252 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
253 epatch
254
255 epatch_user
256 }
257
258 src_configure() {
259 local conf_opts audio_opts user_targets
260
261 for target in ${IUSE_SOFTMMU_TARGETS} ; do
262 use "qemu_softmmu_targets_${target}" && \
263 softmmu_targets="${softmmu_targets} ${target}-softmmu"
264 done
265
266 for target in ${IUSE_USER_TARGETS} ; do
267 use "qemu_user_targets_${target}" && \
268 user_targets="${user_targets} ${target}-linux-user"
269 done
270
271 if [[ -z ${softmmu_targets} ]]; then
272 eerror "All SoftMMU targets are disabled. This is invalid for qemu-kvm"
273 die "At least 1 SoftMMU target must be enabled"
274 else
275 einfo "Building the following softmmu targets: ${softmmu_targets}"
276 fi
277
278 if [[ -n ${user_targets} ]]; then
279 einfo "Building the following user targets: ${user_targets}"
280 conf_opts="${conf_opts} --enable-linux-user"
281 else
282 conf_opts="${conf_opts} --disable-linux-user"
283 fi
284
285 # Fix QA issues. QEMU needs executable heaps and we need to mark it as such
286 conf_opts="${conf_opts} --extra-ldflags=-Wl,-z,execheap"
287
288 # Add support for static builds
289 use static && conf_opts="${conf_opts} --static"
290
291 # Support debug USE flag
292 use debug && conf_opts="${conf_opts} --enable-debug"
293
294 # audio options
295 audio_opts="oss"
296 use alsa && audio_opts="alsa ${audio_opts}"
297 use pulseaudio && audio_opts="pa ${audio_opts}"
298 use sdl && audio_opts="sdl ${audio_opts}"
299
300 ./configure --prefix=/usr \
301 --sysconfdir=/etc \
302 --disable-darwin-user \
303 --disable-bsd-user \
304 --disable-libiscsi \
305 --disable-strip \
306 --disable-werror \
307 --enable-kvm \
308 --enable-kvm-device-assignment \
309 --enable-kvm-pit \
310 --enable-pie \
311 --enable-nptl \
312 --enable-tcg-interpreter \
313 --enable-uuid \
314 --enable-vnc-jpeg \
315 --enable-vnc-png \
316 --python=python2 \
317 $(use_enable aio linux-aio) \
318 $(use_enable bluetooth bluez) \
319 $(use_enable brltty brlapi) \
320 $(use_enable curl) \
321 $(use_enable fdt) \
322 $(use_enable ncurses curses) \
323 $(use_enable opengl) \
324 $(use_enable rbd) \
325 $(use_enable sasl vnc-sasl) \
326 $(use_enable sdl) \
327 $(use_enable smartcard smartcard) \
328 $(use_enable smartcard smartcard-nss) \
329 $(use_enable spice) \
330 $(use_enable test check-utests) \
331 $(use_enable tls vnc-tls) \
332 $(use_enable threads vnc-thread) \
333 $(use_enable usbredir usb-redir) \
334 $(use_enable vde) \
335 $(use_enable vhost-net) \
336 $(use_enable xen) \
337 $(use_enable xattr attr) \
338 --audio-drv-list="${audio_opts}" \
339 --target-list="${softmmu_targets} ${user_targets}" \
340 --cc="$(tc-getCC)" \
341 --host-cc="$(tc-getBUILD_CC)" \
342 || die "configure failed"
343
344 # this is for qemu upstream's threaded support which is
345 # in development and broken
346 # the kvm project has its own support for threaded IO
347 # which is always on and works
348 # --enable-io-thread \
349 }
350
351 src_install() {
352 emake DESTDIR="${ED}" install || die "make install failed"
353
354 if [[ -n ${softmmu_targets} ]]; then
355 insinto /lib/udev/rules.d/
356 doins kvm/scripts/65-kvm.rules || die
357
358 if use qemu-ifup; then
359 insinto /etc/qemu/
360 insopts -m0755
361 doins kvm/scripts/qemu-ifup || die
362 fi
363
364 if use qemu_softmmu_targets_x86_64 ; then
365 dobin "${FILESDIR}"/qemu-kvm
366 ewarn "The depreciated '/usr/bin/kvm' symlink is no longer installed"
367 ewarn "You should use '/usr/bin/qemu-kvm', you may need to edit"
368 ewarn "your libvirt configs or other wrappers for ${PN}"
369 else
370 elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install"
371 elog "of /usr/bin/qemu-kvm and /usr/bin/kvm"
372 fi
373 fi
374
375 dodoc Changelog MAINTAINERS TODO pci-ids.txt || die
376 newdoc pc-bios/README README.pc-bios || die
377 dohtml qemu-doc.html qemu-tech.html || die
378
379 # FIXME: Need to come up with a solution for non-x86 based systems
380 if use x86 || use amd64; then
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 fi
397 }
398
399 pkg_postinst() {
400
401 if [[ -n ${softmmu_targets} ]]; then
402 elog "If you don't have kvm compiled into the kernel, make sure you have"
403 elog "the kernel module loaded before running kvm. The easiest way to"
404 elog "ensure that the kernel module is loaded is to load it on boot."
405 elog "For AMD CPUs the module is called 'kvm-amd'"
406 elog "For Intel CPUs the module is called 'kvm-intel'"
407 elog "Please review /etc/conf.d/modules for how to load these"
408 elog
409 elog "Make sure your user is in the 'kvm' group"
410 elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
411 elog
412 elog "The ssl USE flag was renamed to tls, so adjust your USE flags."
413 elog "The nss USE flag was renamed to smartcard, so adjust your USE flags."
414 fi
415
416 use qemu-ifup && \
417 ewarn "qemu-ifup is deprecated, be prepared for it to disappear next release"
418 }