diff --git a/pkgs/applications/virtualization/qemu/cve-2014-0150.patch b/pkgs/applications/virtualization/qemu/cve-2014-0150.patch deleted file mode 100644 index a086b3693215..000000000000 --- a/pkgs/applications/virtualization/qemu/cve-2014-0150.patch +++ /dev/null @@ -1,14 +0,0 @@ - -diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c -index 439477b..33bd233 100644 ---- a/hw/net/virtio-net.c -+++ b/hw/net/virtio-net.c - -677,7 +677,7 static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd, - goto error; - } - -- if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) { -+ if (mac_data.entries <= MAC_TABLE_ENTRIES - in_use) { - s = iov_to_buf(iov, iov_cnt, 0, &macs[in_use * ETH_ALEN], - mac_data.entries * ETH_ALEN); - if (s != mac_data.entries * ETH_ALEN) { diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 1d668c4a28cf..7b329750ea5e 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -1,40 +1,55 @@ { stdenv, fetchurl, python, zlib, pkgconfig, glib, ncurses, perl, pixman -, attr, libcap, vde2, alsaLib, texinfo, libuuid, flex, bison +, attr, libcap, vde2, alsaLib, texinfo, libuuid, flex, bison, lzo, snappy +, libseccomp, libaio, libcap_ng, gnutls , makeWrapper +, pulseSupport ? true, pulseaudio , sdlSupport ? true, SDL , vncSupport ? true, libjpeg, libpng , spiceSupport ? true, spice, spice_protocol, usbredir , x86Only ? false }: -let n = "qemu-2.0.0"; in +with stdenv.lib; +let + n = "qemu-2.2.0"; + audio = optionalString (hasSuffix "linux" stdenv.system) "alsa," + + optionalString pulseSupport "pa," + + optionalString sdlSupport "sdl,"; +in stdenv.mkDerivation rec { name = n + (if x86Only then "-x86-only" else ""); src = fetchurl { url = "http://wiki.qemu.org/download/${n}.tar.bz2"; - sha256 = "0frsahiw56jr4cqr9m6s383lyj4ar9hfs2wp3y4yr76krah1mk30"; + sha256 = "1703c3scl5n07gmpilg7g2xzyxnr7jczxgx6nn4m8kv9gin9p35n"; }; - patches = [ ./cve-2014-0150.patch ]; - buildInputs = [ python zlib pkgconfig glib ncurses perl pixman attr libcap - vde2 alsaLib texinfo libuuid flex bison makeWrapper + vde2 texinfo libuuid flex bison makeWrapper lzo snappy libseccomp + libcap_ng gnutls ] - ++ stdenv.lib.optionals sdlSupport [ SDL ] - ++ stdenv.lib.optionals vncSupport [ libjpeg libpng ] - ++ stdenv.lib.optionals spiceSupport [ spice_protocol spice usbredir ]; + ++ optionals pulseSupport [ pulseaudio ] + ++ optionals sdlSupport [ SDL ] + ++ optionals vncSupport [ libjpeg libpng ] + ++ optionals spiceSupport [ spice_protocol spice usbredir ] + ++ optionals (hasSuffix "linux" stdenv.system) [ alsaLib libaio ]; enableParallelBuilding = true; + patches = [ ./no-etc-install.patch ]; + configureFlags = - [ "--audio-drv-list=alsa" + [ "--enable-seccomp" "--smbd=smbd" # use `smbd' from $PATH + "--audio-drv-list=${audio}" + "--sysconfdir=/etc" + "--localstatedir=/var" ] - ++ stdenv.lib.optional spiceSupport "--enable-spice" - ++ stdenv.lib.optional x86Only "--target-list=i386-softmmu,x86_64-softmmu"; + ++ optional spiceSupport "--enable-spice" + ++ optional x86Only "--target-list=i386-softmmu,x86_64-softmmu" + ++ optional (hasSuffix "linux" stdenv.system) "--enable-linux-aio"; postInstall = '' diff --git a/pkgs/applications/virtualization/qemu/no-etc-install.patch b/pkgs/applications/virtualization/qemu/no-etc-install.patch new file mode 100644 index 000000000000..81d29feea3de --- /dev/null +++ b/pkgs/applications/virtualization/qemu/no-etc-install.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile b/Makefile +index d6b9dc1..ce7c493 100644 +--- a/Makefile ++++ b/Makefile +@@ -384,8 +384,7 @@ install-confdir: + install-sysconfig: install-datadir install-confdir + $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)" + +-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \ +-install-datadir install-localstatedir ++install: all $(if $(BUILD_DOCS),install-doc) install-datadir + ifneq ($(TOOLS),) + $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir)) + endif