From 864ec69c84f89b0f0e073a9a0fec218d521f5ce9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 28 Feb 2016 18:22:06 -0600 Subject: [PATCH] qemu: compile with cocoa for darwin support This uses the --enable-cocoa flag in qemu to build in Darwin. --- .../virtualization/qemu/default.nix | 36 +++++++++++-------- pkgs/top-level/all-packages.nix | 5 ++- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 9301f886472c..158231a6e646 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -1,11 +1,15 @@ { stdenv, fetchurl, python, zlib, pkgconfig, glib, ncurses, perl, pixman -, attr, libcap, vde2, alsaLib, texinfo, libuuid, flex, bison, lzo, snappy -, libseccomp, libaio, libcap_ng, gnutls, nettle, numactl +, vde2, alsaLib, texinfo, libuuid, flex, bison, lzo, snappy +, libaio, gnutls, nettle , makeWrapper -, pulseSupport ? true, libpulseaudio -, sdlSupport ? true, SDL +, attr, libcap, libcap_ng +, CoreServices, Cocoa, rez, setfile +, numaSupport ? stdenv.isLinux, numactl +, seccompSupport ? stdenv.isLinux, libseccomp +, pulseSupport ? !stdenv.isDarwin, libpulseaudio +, sdlSupport ? !stdenv.isDarwin, SDL , vncSupport ? true, libjpeg, libpng -, spiceSupport ? true, spice, spice_protocol, usbredir +, spiceSupport ? !stdenv.isDarwin, spice, spice_protocol, usbredir , x86Only ? false }: @@ -26,31 +30,35 @@ stdenv.mkDerivation rec { }; buildInputs = - [ python zlib pkgconfig glib ncurses perl pixman attr libcap - vde2 texinfo libuuid flex bison makeWrapper lzo snappy libseccomp - libcap_ng gnutls nettle numactl + [ python zlib pkgconfig glib ncurses perl pixman + vde2 texinfo libuuid flex bison makeWrapper lzo snappy + gnutls nettle ] + ++ optionals stdenv.isDarwin [ CoreServices Cocoa rez setfile ] + ++ optionals seccompSupport [ libseccomp ] + ++ optionals numaSupport [ numactl ] ++ optionals pulseSupport [ libpulseaudio ] ++ optionals sdlSupport [ SDL ] ++ optionals vncSupport [ libjpeg libpng ] ++ optionals spiceSupport [ spice_protocol spice usbredir ] - ++ optionals (hasSuffix "linux" stdenv.system) [ alsaLib libaio ]; + ++ optionals stdenv.isLinux [ alsaLib libaio libcap_ng libcap attr ]; enableParallelBuilding = true; patches = [ ./no-etc-install.patch ]; configureFlags = - [ "--enable-seccomp" - "--enable-numa" - "--smbd=smbd" # use `smbd' from $PATH + [ "--smbd=smbd" # use `smbd' from $PATH "--audio-drv-list=${audio}" "--sysconfdir=/etc" "--localstatedir=/var" ] + ++ optional numaSupport "--enable-numa" + ++ optional seccompSupport "--enable-seccomp" ++ optional spiceSupport "--enable-spice" ++ optional x86Only "--target-list=i386-softmmu,x86_64-softmmu" - ++ optional (hasSuffix "linux" stdenv.system) "--enable-linux-aio"; + ++ optional stdenv.isDarwin "--enable-cocoa" + ++ optional stdenv.isLinux "--enable-linux-aio"; postInstall = '' @@ -66,6 +74,6 @@ stdenv.mkDerivation rec { description = "A generic and open source machine emulator and virtualizer"; license = licenses.gpl2Plus; maintainers = with maintainers; [ viric eelco ]; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 831390ad774e..08f6feb811a6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13329,7 +13329,10 @@ let eiskaltdcpp = callPackage ../applications/networking/p2p/eiskaltdcpp { lua5 = lua5_1; }; - qemu = callPackage ../applications/virtualization/qemu { }; + qemu = callPackage ../applications/virtualization/qemu { + inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa; + inherit (darwin.stubs) rez setfile; + }; qjackctl = callPackage ../applications/audio/qjackctl { };