1 { lib, stdenv, fetchFromGitHub
12 , lazyLoad ? !stdenv.hostPlatform.isDarwin
15 assert lib.assertMsg (stdenv.hostPlatform.isDarwin -> !lazyLoad) "cubeb: lazyLoad is inert on Darwin";
25 in stdenv.mkDerivation {
27 version = "unstable-2022-10-18";
29 src = fetchFromGitHub {
32 rev = "27d2a102b0b75d9e49d43bc1ea516233fb87d778";
33 hash = "sha256-q+uz1dGU4LdlPogL1nwCR/KuOX4Oy3HhMdA6aJylBRk=";
41 buildInputs = [ speexdsp ] ++ (
42 if stdenv.hostPlatform.isDarwin then [ AudioUnit CoreAudio CoreServices ]
47 "-DBUILD_SHARED_LIBS=ON"
48 "-DBUILD_TESTS=OFF" # tests require an audio server
50 "-DUSE_SANITIZERS=OFF"
52 # Whether to lazily load libraries with dlopen()
53 "-DLAZY_LOAD_LIBS=${if lazyLoad then "ON" else "OFF"}"
57 # For downstream users when lazyLoad is true
58 backendLibs = lib.optionals lazyLoad backendLibs;
62 description = "Cross platform audio library";
63 mainProgram = "cubeb-test";
64 homepage = "https://github.com/mozilla/cubeb";
65 license = licenses.isc;
66 platforms = platforms.linux ++ platforms.darwin;
67 maintainers = with maintainers; [ zhaofengli ];