2011-10-01 16:15:47 +02:00
|
|
|
{ stdenv, fetchurl, attr, zlib, SDL, alsaLib, pkgconfig, pciutils, libuuid, vde2
|
2013-02-27 14:25:20 +01:00
|
|
|
, libjpeg, libpng, ncurses, python, glib, libaio, mesa, perl, texinfo
|
2012-09-13 16:13:16 +02:00
|
|
|
, spice, spice_protocol, spiceSupport ? false }:
|
2011-06-17 23:23:12 +02:00
|
|
|
|
2009-08-04 18:02:27 +02:00
|
|
|
assert stdenv.isLinux;
|
2011-06-17 23:23:12 +02:00
|
|
|
|
2012-09-25 23:30:43 +02:00
|
|
|
let version = "1.2.0"; in
|
2012-04-22 18:30:27 +02:00
|
|
|
|
2009-08-04 18:02:27 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2012-04-22 18:30:27 +02:00
|
|
|
name = "qemu-kvm-${version}";
|
2011-05-13 14:10:33 +02:00
|
|
|
|
2009-08-04 18:02:27 +02:00
|
|
|
src = fetchurl {
|
2012-08-23 00:07:20 +02:00
|
|
|
url = "mirror://sourceforge/kvm/qemu-kvm/${version}/${name}.tar.gz";
|
2012-09-25 23:30:43 +02:00
|
|
|
sha256 = "018vb5nmk2fsm143bs2bl2wirhasd4b10d7jchl32zik4inbk2p9";
|
2009-08-04 18:02:27 +02:00
|
|
|
};
|
|
|
|
|
2013-02-27 14:25:20 +01:00
|
|
|
buildInputs =
|
|
|
|
[ attr zlib SDL alsaLib pkgconfig pciutils libuuid vde2 libjpeg libpng
|
|
|
|
ncurses python glib libaio mesa texinfo perl
|
|
|
|
] ++ stdenv.lib.optionals spiceSupport [ spice_protocol spice ];
|
2013-02-15 17:07:27 +01:00
|
|
|
|
2013-04-05 10:42:51 +02:00
|
|
|
patches = [ ./fix-librt-check.patch ./fix-usb-passthrough.patch ];
|
2013-03-07 19:33:52 +01:00
|
|
|
|
|
|
|
postPatch = "patchShebangs .;"
|
|
|
|
+ stdenv.lib.optionalString spiceSupport ''
|
2013-02-27 14:34:13 +01:00
|
|
|
for i in configure spice-qemu-char.c ui/spice-input.c ui/spice-core.c ui/qemu-spice.h; do
|
2012-08-28 00:55:43 +02:00
|
|
|
substituteInPlace $i --replace '#include <spice.h>' '#include <spice/spice.h>'
|
|
|
|
done
|
2012-04-22 18:30:27 +02:00
|
|
|
'';
|
|
|
|
|
2012-02-27 22:54:33 +01:00
|
|
|
configureFlags =
|
|
|
|
[ "--audio-drv-list=alsa"
|
|
|
|
"--smbd=smbd" # use `smbd' from $PATH
|
2013-02-27 14:25:20 +01:00
|
|
|
"--enable-docs"
|
2013-02-27 14:34:32 +01:00
|
|
|
"--python=${python}/bin/python"
|
2012-08-28 00:55:43 +02:00
|
|
|
] ++ stdenv.lib.optional spiceSupport "--enable-spice";
|
2011-07-18 17:28:51 +02:00
|
|
|
|
2009-08-04 18:02:27 +02:00
|
|
|
postInstall =
|
|
|
|
''
|
2011-03-31 13:57:02 +02:00
|
|
|
# Libvirt expects us to be called `qemu-kvm'. Otherwise it will
|
|
|
|
# set the domain type to "qemu" rather than "kvm", which can
|
|
|
|
# cause architecture selection to misbehave.
|
2012-04-22 18:30:27 +02:00
|
|
|
ln -sv $(cd $out/bin && echo qemu-system-*) $out/bin/qemu-kvm
|
2009-08-04 18:02:27 +02:00
|
|
|
'';
|
|
|
|
|
2013-02-27 14:34:42 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2013-02-27 14:25:20 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-08-04 18:02:27 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.linux-kvm.org/;
|
|
|
|
description = "A full virtualization solution for Linux on x86 hardware containing virtualization extensions";
|
2011-06-17 23:23:12 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-08-04 18:02:27 +02:00
|
|
|
};
|
|
|
|
}
|