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: qemu-kvm-0.14.1-r1.ebuild ChangeLog qemu-kvm-0.14.1.ebuild
Date: Tue, 31 May 2011 15:53:56
Message-Id: 20110531155345.2584820054@flycatcher.gentoo.org
1 cardoe 11/05/31 15:53:45
2
3 Modified: ChangeLog
4 Added: qemu-kvm-0.14.1-r1.ebuild
5 Removed: qemu-kvm-0.14.1.ebuild
6 Log:
7 Fix not installing udev rules and qemu-kvm symlink. bug #369187 & bug #369427
8
9 (Portage version: 2.1.9.49/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.54 app-emulation/qemu-kvm/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?rev=1.54&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?rev=1.54&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?r1=1.53&r2=1.54
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v
21 retrieving revision 1.53
22 retrieving revision 1.54
23 diff -u -r1.53 -r1.54
24 --- ChangeLog 27 May 2011 23:33:27 -0000 1.53
25 +++ ChangeLog 31 May 2011 15:53:45 -0000 1.54
26 @@ -1,6 +1,12 @@
27 # ChangeLog for app-emulation/qemu-kvm
28 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.53 2011/05/27 23:33:27 cardoe Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.54 2011/05/31 15:53:45 cardoe Exp $
31 +
32 +*qemu-kvm-0.14.1-r1 (31 May 2011)
33 +
34 + 31 May 2011; Doug Goldstein <cardoe@g.o> -qemu-kvm-0.14.1.ebuild,
35 + +qemu-kvm-0.14.1-r1.ebuild:
36 + Fix not installing udev rules and qemu-kvm symlink. bug #369187 & bug #369427
37
38 27 May 2011; Doug Goldstein <cardoe@g.o> -qemu-kvm-0.12.5-r1.ebuild,
39 -qemu-kvm-0.13.0-r1.ebuild:
40
41
42
43 1.1 app-emulation/qemu-kvm/qemu-kvm-0.14.1-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.14.1-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.14.1-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: qemu-kvm-0.14.1-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2011 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-0.14.1-r1.ebuild,v 1.1 2011/05/31 15:53:45 cardoe Exp $
53
54 BACKPORTS=1
55
56 EAPI="2"
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"
61 fi
62
63 inherit eutils flag-o-matic ${GIT_ECLASS} linux-info toolchain-funcs multilib
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:+http://dev.gentoo.org/~cardoe/distfiles/${P}-backports-${BACKPORTS}.tar.bz2}"
71 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
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 esd fdt hardened jpeg ncurses \
81 png pulseaudio qemu-ifup rbd sasl sdl spice ssl static threads vde \
82 vhost-net 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 for target in ${IUSE_SOFTMMU_TARGETS}; do
89 IUSE="${IUSE} +qemu_softmmu_targets_${target}"
90 done
91
92 for target in ${IUSE_USER_TARGETS}; do
93 IUSE="${IUSE} +qemu_user_targets_${target}"
94 done
95
96 RESTRICT="test"
97
98 RDEPEND="
99 !app-emulation/kqemu
100 !app-emulation/qemu
101 !app-emulation/qemu-softmmu
102 !app-emulation/qemu-user
103 !app-emulation/qemu-kvm-spice
104 sys-apps/pciutils
105 >=sys-apps/util-linux-2.16.0
106 sys-libs/zlib
107 aio? ( dev-libs/libaio )
108 alsa? ( >=media-libs/alsa-lib-1.0.13 )
109 bluetooth? ( net-wireless/bluez )
110 brltty? ( app-accessibility/brltty )
111 curl? ( net-misc/curl )
112 esd? ( media-sound/esound )
113 fdt? ( >=sys-apps/dtc-1.2.0 )
114 jpeg? ( virtual/jpeg )
115 ncurses? ( sys-libs/ncurses )
116 png? ( media-libs/libpng )
117 pulseaudio? ( media-sound/pulseaudio )
118 qemu-ifup? ( sys-apps/iproute2 net-misc/bridge-utils )
119 rbd? ( sys-cluster/ceph )
120 sasl? ( dev-libs/cyrus-sasl )
121 sdl? ( >=media-libs/libsdl-1.2.11[X] )
122 spice? ( app-emulation/spice )
123 ssl? ( net-libs/gnutls )
124 vde? ( net-misc/vde )
125 xen? ( app-emulation/xen )
126 "
127
128 DEPEND="${RDEPEND}
129 app-text/texi2html
130 >=sys-kernel/linux-headers-2.6.35
131 ssl? ( dev-util/pkgconfig )
132 "
133
134 kvm_kern_warn() {
135 eerror "Please enable KVM support in your kernel, found at:"
136 eerror
137 eerror " Virtualization"
138 eerror " Kernel-based Virtual Machine (KVM) support"
139 eerror
140 }
141
142 pkg_setup() {
143 use qemu_softmmu_targets_x86_64 || ewarn "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64"
144
145 if kernel_is lt 2 6 25; then
146 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
147 eerror "Either upgrade your kernel"
148 else
149 if ! linux_config_exists; then
150 eerror "Unable to check your kernel for KVM support"
151 kvm_kern_warn
152 elif ! linux_chkconfig_present KVM; then
153 kvm_kern_warn
154 fi
155 if use vhost-net && ! linux_chkconfig_present VHOST_NET ; then
156 ewarn "You have to enable CONFIG_VHOST_NET in the kernel"
157 ewarn "to have vhost-net support."
158 fi
159 fi
160
161 enewgroup kvm
162 }
163
164 src_prepare() {
165 # prevent docs to get automatically installed
166 sed -i '/$(DESTDIR)$(docdir)/d' Makefile || die
167 # Alter target makefiles to accept CFLAGS set via flag-o
168 sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
169 Makefile Makefile.target || die
170 # append CFLAGS while linking
171 sed -i 's/$(LDFLAGS)/$(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS)/' rules.mak || die
172
173 # remove part to make udev happy
174 sed -e 's~NAME="%k", ~~' -i kvm/scripts/65-kvm.rules || die
175
176 # ${PN}-guest-hang-on-usb-add.patch was sent by Timothy Jones
177 # to the qemu-devel ml - bug 337988
178 epatch "${FILESDIR}/qemu-0.11.0-mips64-user-fix.patch"
179
180 [[ -n ${BACKPORTS} ]] && \
181 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
182 epatch
183 }
184
185 src_configure() {
186 local conf_opts audio_opts user_targets
187
188 for target in ${IUSE_SOFTMMU_TARGETS} ; do
189 use "qemu_softmmu_targets_${target}" && \
190 softmmu_targets="${softmmu_targets} ${target}-softmmu"
191 done
192
193 for target in ${IUSE_USER_TARGETS} ; do
194 use "qemu_user_targets_${target}" && \
195 user_targets="${user_targets} ${target}-linux-user"
196 done
197
198 if [ -z "${softmmu_targets}" ]; then
199 conf_opts="${conf_opts} --disable-system"
200 else
201 einfo "Building the following softmmu targets: ${softmmu_targets}"
202 fi
203
204 if [ ! -z "${user_targets}" ]; then
205 einfo "Building the following user targets: ${user_targets}"
206 conf_opts="${conf_opts} --enable-linux-user"
207 else
208 conf_opts="${conf_opts} --disable-linux-user"
209 fi
210
211 # Fix QA issues. QEMU needs executable heaps and we need to mark it as such
212 conf_opts="${conf_opts} --extra-ldflags=-Wl,-z,execheap"
213
214 # Add support for static builds
215 use static && conf_opts="${conf_opts} --static"
216
217 # Support debug USE flag
218 use debug && conf_opts="${conf_opts} --enable-debug"
219
220 # Fix the $(prefix)/etc issue
221 conf_opts="${conf_opts} --sysconfdir=/etc"
222
223 #config options
224 conf_opts="${conf_opts} $(use_enable aio linux-aio)"
225 conf_opts="${conf_opts} $(use_enable bluetooth bluez)"
226 conf_opts="${conf_opts} $(use_enable brltty brlapi)"
227 conf_opts="${conf_opts} $(use_enable curl)"
228 conf_opts="${conf_opts} $(use_enable debug strip)"
229 conf_opts="${conf_opts} $(use_enable debug debug-tcg)"
230 conf_opts="${conf_opts} $(use_enable fdt)"
231 conf_opts="${conf_opts} $(use_enable hardened user-pie)"
232 conf_opts="${conf_opts} $(use_enable jpeg vnc-jpeg)"
233 conf_opts="${conf_opts} $(use_enable ncurses curses)"
234 conf_opts="${conf_opts} $(use_enable png vnc-png)"
235 conf_opts="${conf_opts} $(use_enable rbd)"
236 conf_opts="${conf_opts} $(use_enable sasl vnc-sasl)"
237 conf_opts="${conf_opts} $(use_enable sdl)"
238 conf_opts="${conf_opts} $(use_enable spice)"
239 conf_opts="${conf_opts} $(use_enable ssl vnc-tls)"
240 conf_opts="${conf_opts} $(use_enable threads vnc-thread)"
241 conf_opts="${conf_opts} $(use_enable vde)"
242 conf_opts="${conf_opts} $(use_enable vhost-net)"
243 conf_opts="${conf_opts} $(use_enable xen)"
244 conf_opts="${conf_opts} --disable-darwin-user --disable-bsd-user"
245
246 # audio options
247 audio_opts="oss"
248 use alsa && audio_opts="alsa ${audio_opts}"
249 use esd && audio_opts="esd ${audio_opts}"
250 use pulseaudio && audio_opts="pa ${audio_opts}"
251 use sdl && audio_opts="sdl ${audio_opts}"
252 ./configure --prefix=/usr \
253 --disable-strip \
254 --disable-werror \
255 --enable-kvm \
256 --enable-nptl \
257 --enable-uuid \
258 ${conf_opts} \
259 --audio-drv-list="${audio_opts}" \
260 --target-list="${softmmu_targets} ${user_targets}" \
261 --cc="$(tc-getCC)" \
262 --host-cc="$(tc-getBUILD_CC)" \
263 || die "configure failed"
264
265 # this is for qemu upstream's threaded support which is
266 # in development and broken
267 # the kvm project has its own support for threaded IO
268 # which is always on and works
269 # --enable-io-thread \
270 }
271
272 src_install() {
273 emake DESTDIR="${D}" install || die "make install failed"
274
275 if [ ! -z "${softmmu_targets}" ]; then
276 insinto /$(get_libdir)/udev/rules.d/
277 doins kvm/scripts/65-kvm.rules || die
278
279 if use qemu-ifup; then
280 insinto /etc/qemu/
281 insopts -m0755
282 doins kvm/scripts/qemu-ifup || die
283 fi
284
285 if use qemu_softmmu_targets_x86_64 ; then
286 dobin "${FILESDIR}"/qemu-kvm
287 dosym /usr/bin/qemu-kvm /usr/bin/kvm
288 else
289 elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install"
290 elog "of /usr/bin/qemu-kvm and /usr/bin/kvm"
291 fi
292 fi
293
294 dodoc Changelog MAINTAINERS TODO pci-ids.txt || die
295 newdoc pc-bios/README README.pc-bios || die
296 dohtml qemu-doc.html qemu-tech.html || die
297 }
298
299 pkg_postinst() {
300
301 if [ ! -z "${softmmu_targets}" ]; then
302 elog "If you don't have kvm compiled into the kernel, make sure you have"
303 elog "the kernel module loaded before running kvm. The easiest way to"
304 elog "ensure that the kernel module is loaded is to load it on boot."
305 elog "For AMD CPUs the module is called 'kvm-amd'"
306 elog "For Intel CPUs the module is called 'kvm-intel'"
307 elog "Please review /etc/conf.d/modules for how to load these"
308 elog
309 elog "Make sure your user is in the 'kvm' group"
310 elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
311 elog
312 elog "You will need the Universal TUN/TAP driver compiled into your"
313 elog "kernel or loaded as a module to use the virtual network device"
314 elog "if using -net tap. You will also need support for 802.1d"
315 elog "Ethernet Bridging and a configured bridge if using the provided"
316 elog "kvm-ifup script from /etc/kvm."
317 elog
318 elog "The gnutls use flag was renamed to ssl, so adjust your use flags."
319 fi
320 }