From 644a404688f3dd4b25c9ab3d1a88313501089940 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 20 Dec 2017 23:56:50 -0500 Subject: [PATCH] libsoundio: Fix build on darwin --- pkgs/development/libraries/libsoundio/default.nix | 10 ++++++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libsoundio/default.nix b/pkgs/development/libraries/libsoundio/default.nix index 18d18941b887..7803b2a5ff11 100644 --- a/pkgs/development/libraries/libsoundio/default.nix +++ b/pkgs/development/libraries/libsoundio/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake, alsaLib, libjack2, libpulseaudio }: +{ stdenv, fetchFromGitHub, cmake, alsaLib, libjack2, libpulseaudio, AudioUnit }: stdenv.mkDerivation rec { version = "1.1.0"; @@ -11,7 +11,13 @@ stdenv.mkDerivation rec { sha256 = "0mw197l4bci1cjc2z877gxwsvk8r43dr7qiwci2hwl2cjlcnqr2p"; }; - buildInputs = [ cmake alsaLib libjack2 libpulseaudio ]; + nativeBuildInputs = [ cmake ]; + + buildInputs = [ libjack2 libpulseaudio ] + ++ stdenv.lib.optional stdenv.isLinux alsaLib + ++ stdenv.lib.optional stdenv.isDarwin AudioUnit; + + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes"; meta = with stdenv.lib; { description = "Cross platform audio input and output"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a21822eb688b..230ee580522e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9287,7 +9287,9 @@ with pkgs; libserialport = callPackage ../development/libraries/libserialport { }; - libsoundio = callPackage ../development/libraries/libsoundio { }; + libsoundio = callPackage ../development/libraries/libsoundio { + inherit (darwin.apple_sdk.frameworks) AudioUnit; + }; libgtop = callPackage ../development/libraries/libgtop {};