2011-10-01 16:15:47 +02:00
|
|
|
{ stdenv, fetchurl, attr, zlib, SDL, alsaLib, pkgconfig, pciutils, libuuid, vde2
|
2011-08-29 15:39:25 +02:00
|
|
|
, libjpeg, libpng, ncurses, python, glib }:
|
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-04-22 18:30:27 +02:00
|
|
|
let version = "1.0.1"; in
|
|
|
|
|
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-04-22 18:30:27 +02:00
|
|
|
url = "mirror://sourceforge/kvm/qemu-kvm/${version}/${name}.tar.gz";
|
|
|
|
sha256 = "0kxzwaw8h71mqcm46angpyx8gd58ascrxnr861k068xg89ix5g2p";
|
2009-08-04 18:02:27 +02:00
|
|
|
};
|
|
|
|
|
2012-02-25 18:34:21 +01:00
|
|
|
patches = [ ./smb-tmpdir.patch ./qemu-img-fix-corrupt-vdi.patch ];
|
2009-08-05 19:26:39 +02:00
|
|
|
|
2012-04-22 18:30:27 +02:00
|
|
|
postPatch =
|
|
|
|
'' for i in $(find kvm -type f)
|
|
|
|
do
|
|
|
|
sed -i "$i" \
|
|
|
|
-e 's|/bin/bash|/bin/sh|g ;
|
|
|
|
s|/usr/bin/python|${python}/bin/python|g ;
|
|
|
|
s|/bin/rm|rm|g'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2012-02-27 22:54:33 +01:00
|
|
|
configureFlags =
|
|
|
|
[ "--audio-drv-list=alsa"
|
|
|
|
"--smbd=smbd" # use `smbd' from $PATH
|
|
|
|
];
|
2011-07-18 17:28:51 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-06-17 23:23:12 +02:00
|
|
|
buildInputs =
|
2011-10-01 16:15:47 +02:00
|
|
|
[ attr zlib SDL alsaLib pkgconfig pciutils libuuid vde2 libjpeg libpng
|
2011-08-29 15:39:25 +02:00
|
|
|
ncurses python glib
|
2011-06-17 23:23:12 +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
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|