cubeb: Add Darwin support

+24 -12
+21 -11
pkgs/development/libraries/audio/cubeb/default.nix
··· 6 , libpulseaudio 7 , sndio 8 , speexdsp 9 - , lazyLoad ? true 10 }: 11 12 - stdenv.mkDerivation { 13 pname = "cubeb"; 14 version = "unstable-2022-10-18"; 15 ··· 25 pkg-config 26 ]; 27 28 - buildInputs = [ 29 - alsa-lib 30 - jack2 31 - libpulseaudio 32 - sndio 33 - speexdsp 34 - ]; 35 36 cmakeFlags = [ 37 "-DBUILD_SHARED_LIBS=ON" ··· 45 46 passthru = { 47 # For downstream users when lazyLoad is true 48 - backendLibs = [ alsa-lib jack2 libpulseaudio sndio ]; 49 }; 50 51 meta = with lib; { 52 description = "Cross platform audio library"; 53 homepage = "https://github.com/mozilla/cubeb"; 54 license = licenses.isc; 55 - platforms = platforms.linux; 56 maintainers = with maintainers; [ zhaofengli ]; 57 }; 58 }
··· 6 , libpulseaudio 7 , sndio 8 , speexdsp 9 + , AudioUnit 10 + , CoreAudio 11 + , CoreServices 12 + , lazyLoad ? !stdenv.isDarwin 13 }: 14 15 + assert lib.assertMsg (stdenv.isDarwin -> !lazyLoad) "cubeb: lazyLoad is inert on Darwin"; 16 + 17 + let 18 + backendLibs = [ 19 + alsa-lib 20 + jack2 21 + libpulseaudio 22 + sndio 23 + ]; 24 + 25 + in stdenv.mkDerivation { 26 pname = "cubeb"; 27 version = "unstable-2022-10-18"; 28 ··· 38 pkg-config 39 ]; 40 41 + buildInputs = [ speexdsp ] ++ ( 42 + if stdenv.isDarwin then [ AudioUnit CoreAudio CoreServices ] 43 + else backendLibs 44 + ); 45 46 cmakeFlags = [ 47 "-DBUILD_SHARED_LIBS=ON" ··· 55 56 passthru = { 57 # For downstream users when lazyLoad is true 58 + backendLibs = lib.optionals lazyLoad backendLibs; 59 }; 60 61 meta = with lib; { 62 description = "Cross platform audio library"; 63 homepage = "https://github.com/mozilla/cubeb"; 64 license = licenses.isc; 65 + platforms = platforms.linux ++ platforms.darwin; 66 maintainers = with maintainers; [ zhaofengli ]; 67 }; 68 }
+3 -1
pkgs/top-level/all-packages.nix
··· 18309 # justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990 18310 cachix = haskell.lib.compose.justStaticExecutables haskellPackages.cachix; 18311 18312 - cubeb = callPackage ../development/libraries/audio/cubeb { }; 18313 18314 hercules-ci-agent = callPackage ../development/tools/continuous-integration/hercules-ci-agent { }; 18315
··· 18309 # justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990 18310 cachix = haskell.lib.compose.justStaticExecutables haskellPackages.cachix; 18311 18312 + cubeb = callPackage ../development/libraries/audio/cubeb { 18313 + inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreServices; 18314 + }; 18315 18316 hercules-ci-agent = callPackage ../development/tools/continuous-integration/hercules-ci-agent { }; 18317