nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

cubeb: Add Darwin support

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