about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorZhaofeng Li <hello@zhaofeng.li>2022-10-29 20:43:51 -0600
committerZhaofeng Li <hello@zhaofeng.li>2022-10-31 14:03:25 -0600
commit5fb8428618daa55b395b87aab90b36fe2981e0f4 (patch)
tree6b15403b186661c9a0d6d854da4ca6579191d103 /pkgs/development/libraries
parent9cfee5c3bd6c5a033719992c5f7bc719f44b4ee0 (diff)
cubeb: init at unstable-2022-10-18
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/audio/cubeb/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/libraries/audio/cubeb/default.nix b/pkgs/development/libraries/audio/cubeb/default.nix
new file mode 100644
index 0000000000000..7fc7f87a20ae9
--- /dev/null
+++ b/pkgs/development/libraries/audio/cubeb/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake
+, pkg-config
+, jack2
+, pulseaudio
+, sndio
+, speexdsp
+, lazyLoad ? true
+}:
+
+stdenv.mkDerivation {
+  pname = "cubeb";
+  version = "unstable-2022-10-18";
+
+  src = fetchFromGitHub {
+    owner = "mozilla";
+    repo = "cubeb";
+    rev = "27d2a102b0b75d9e49d43bc1ea516233fb87d778";
+    hash = "sha256-q+uz1dGU4LdlPogL1nwCR/KuOX4Oy3HhMdA6aJylBRk=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    jack2
+    pulseaudio
+    sndio
+    speexdsp
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_TESTS=OFF" # tests require an audio server
+    "-DBUNDLE_SPEEX=OFF"
+    "-DUSE_SANITIZERS=OFF"
+
+    # Whether to lazily load libraries with dlopen()
+    "-DLAZY_LOAD_LIBS=${if lazyLoad then "ON" else "OFF"}"
+  ];
+
+  passthru = {
+    # For downstream users when lazyLoad is true
+    backendLibs = [ jack2 pulseaudio sndio speexdsp ];
+  };
+
+  meta = with lib; {
+    description = "Cross platform audio library";
+    homepage = "https://github.com/mozilla/cubeb";
+    license = licenses.isc;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zhaofengli ];
+  };
+}