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