Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.0 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
fetchFromGitHub,
unstableGitUpdater,
cmake,
pkg-config,
alsa-lib,
jack2,
libpulseaudio,
sndio,
speexdsp,
validatePkgConfig,
# passthru.tests
testers,
alsaSupport ? !stdenv.hostPlatform.isDarwin,
pulseSupport ? !stdenv.hostPlatform.isDarwin,
jackSupport ? !stdenv.hostPlatform.isDarwin,
sndioSupport ? !stdenv.hostPlatform.isDarwin,
enableShared ? !stdenv.hostPlatform.isStatic,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cubeb";
version = "0-unstable-2025-09-17";
src = fetchFromGitHub {
owner = "mozilla";
repo = "cubeb";
rev = "e495bee4cd630c9f99907a764e16edba37a4b564";
hash = "sha256-iBxYZppjJhFAwGi9v4/lTsyqC9Gy04Dc7bJNzgv18rE=";
};
outputs = [
"out"
"lib"
"dev"
];
nativeBuildInputs = [
cmake
pkg-config
validatePkgConfig
];
buildInputs = [
speexdsp
]
# In the default configuration these inputs are lazy-loaded. If your package builds a vendored cubeb please make
# sure to include these in the runtime LD path.
++ lib.optional alsaSupport alsa-lib
++ lib.optional jackSupport jack2
++ lib.optional pulseSupport libpulseaudio
++ lib.optional sndioSupport sndio;
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" enableShared)
(lib.cmakeBool "BUILD_TESTS" false) # tests require an audio server
(lib.cmakeBool "BUNDLE_SPEEX" false)
(lib.cmakeBool "USE_SANITIZERS" false)
# Whether to lazily load libraries with dlopen()
(lib.cmakeBool "LAZY_LOAD_LIBS" false)
];
passthru = {
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = {
description = "Cross platform audio library";
mainProgram = "cubeb-test";
homepage = "https://github.com/mozilla/cubeb";
license = lib.licenses.isc;
platforms = with lib.platforms; linux ++ darwin;
maintainers = with lib.maintainers; [
zhaofengli
marcin-serwin
];
pkgConfigModules = [ "libcubeb" ];
};
})