From 18ba22baba75abd245a8e167213003f60824acf0 Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 3 Aug 2021 15:15:03 +0200 Subject: [PATCH] pulseaudio: Remove /usr/include impurity on Darwin --- pkgs/servers/pulseaudio/default.nix | 13 ++++--------- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index a2836be7ef8c..aecf46efe41d 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -26,7 +26,7 @@ , # Whether to build only the library. libOnly ? false -, CoreServices, AudioUnit, Cocoa +, AudioUnit, Cocoa, CoreServices, Libc, sdk }: stdenv.mkDerivation rec { @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { buildInputs = [ libtool libsndfile soxr speexdsp fftwFloat ] ++ lib.optionals stdenv.isLinux [ glib dbus ] - ++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit Cocoa ] + ++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreServices Libc ] ++ lib.optionals (!libOnly) ( [ libasyncns webrtc-audio-processing ] ++ lib.optional jackaudioSupport libjack2 @@ -94,7 +94,7 @@ stdenv.mkDerivation rec { ] ++ lib.optional (jackaudioSupport && !libOnly) "--enable-jack" ++ lib.optionals stdenv.isDarwin [ - "--with-mac-sysroot=/" + "--with-mac-sysroot=${sdk}" "--disable-neon-opt" ] ++ lib.optional (stdenv.isLinux && useSystemd) "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" @@ -102,12 +102,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - # not sure what the best practices are here -- can't seem to find a way - # for the compiler to bring in stdlib and stdio (etc.) properly - # the alternative is to copy the files from /usr/include to src, but there are - # probably a large number of files that would need to be copied (I stopped - # after the seventh) - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${Libc}"; installFlags = [ "sysconfdir=${placeholder "out"}/etc" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 64376cc3a901..a73b09a018bf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21121,6 +21121,8 @@ with pkgs; }; pulseaudio = callPackage ../servers/pulseaudio ({ + inherit (darwin) Libc; + inherit (darwin.apple_sdk) sdk; inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; } // lib.optionalAttrs stdenv.isDarwin { # Default autoreconfHook (2.70) fails on darwin,