qemu: compile with cocoa for darwin support

This uses the --enable-cocoa flag in qemu to build in Darwin.
This commit is contained in:
Matthew Bauer 2016-02-28 18:22:06 -06:00
parent b0f70e2ebb
commit 864ec69c84
2 changed files with 26 additions and 15 deletions

View File

@ -1,11 +1,15 @@
{ stdenv, fetchurl, python, zlib, pkgconfig, glib, ncurses, perl, pixman { stdenv, fetchurl, python, zlib, pkgconfig, glib, ncurses, perl, pixman
, attr, libcap, vde2, alsaLib, texinfo, libuuid, flex, bison, lzo, snappy , vde2, alsaLib, texinfo, libuuid, flex, bison, lzo, snappy
, libseccomp, libaio, libcap_ng, gnutls, nettle, numactl , libaio, gnutls, nettle
, makeWrapper , makeWrapper
, pulseSupport ? true, libpulseaudio , attr, libcap, libcap_ng
, sdlSupport ? true, SDL , CoreServices, Cocoa, rez, setfile
, numaSupport ? stdenv.isLinux, numactl
, seccompSupport ? stdenv.isLinux, libseccomp
, pulseSupport ? !stdenv.isDarwin, libpulseaudio
, sdlSupport ? !stdenv.isDarwin, SDL
, vncSupport ? true, libjpeg, libpng , vncSupport ? true, libjpeg, libpng
, spiceSupport ? true, spice, spice_protocol, usbredir , spiceSupport ? !stdenv.isDarwin, spice, spice_protocol, usbredir
, x86Only ? false , x86Only ? false
}: }:
@ -26,31 +30,35 @@ stdenv.mkDerivation rec {
}; };
buildInputs = buildInputs =
[ python zlib pkgconfig glib ncurses perl pixman attr libcap [ python zlib pkgconfig glib ncurses perl pixman
vde2 texinfo libuuid flex bison makeWrapper lzo snappy libseccomp vde2 texinfo libuuid flex bison makeWrapper lzo snappy
libcap_ng gnutls nettle numactl gnutls nettle
] ]
++ optionals stdenv.isDarwin [ CoreServices Cocoa rez setfile ]
++ optionals seccompSupport [ libseccomp ]
++ optionals numaSupport [ numactl ]
++ optionals pulseSupport [ libpulseaudio ] ++ optionals pulseSupport [ libpulseaudio ]
++ optionals sdlSupport [ SDL ] ++ optionals sdlSupport [ SDL ]
++ optionals vncSupport [ libjpeg libpng ] ++ optionals vncSupport [ libjpeg libpng ]
++ optionals spiceSupport [ spice_protocol spice usbredir ] ++ optionals spiceSupport [ spice_protocol spice usbredir ]
++ optionals (hasSuffix "linux" stdenv.system) [ alsaLib libaio ]; ++ optionals stdenv.isLinux [ alsaLib libaio libcap_ng libcap attr ];
enableParallelBuilding = true; enableParallelBuilding = true;
patches = [ ./no-etc-install.patch ]; patches = [ ./no-etc-install.patch ];
configureFlags = configureFlags =
[ "--enable-seccomp" [ "--smbd=smbd" # use `smbd' from $PATH
"--enable-numa"
"--smbd=smbd" # use `smbd' from $PATH
"--audio-drv-list=${audio}" "--audio-drv-list=${audio}"
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--localstatedir=/var" "--localstatedir=/var"
] ]
++ optional numaSupport "--enable-numa"
++ optional seccompSupport "--enable-seccomp"
++ optional spiceSupport "--enable-spice" ++ optional spiceSupport "--enable-spice"
++ optional x86Only "--target-list=i386-softmmu,x86_64-softmmu" ++ 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 = postInstall =
'' ''
@ -66,6 +74,6 @@ stdenv.mkDerivation rec {
description = "A generic and open source machine emulator and virtualizer"; description = "A generic and open source machine emulator and virtualizer";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = with maintainers; [ viric eelco ]; maintainers = with maintainers; [ viric eelco ];
platforms = platforms.linux; platforms = platforms.linux ++ platforms.darwin;
}; };
} }

View File

@ -13329,7 +13329,10 @@ let
eiskaltdcpp = callPackage ../applications/networking/p2p/eiskaltdcpp { lua5 = lua5_1; }; 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 { }; qjackctl = callPackage ../applications/audio/qjackctl { };