cubeb: disable lazy loading

Lazy loading is primarily useful when distributing binaries to systems
that may not have the libraries installed. This is not the case for the
nixpkgs and its usage complicates dependent derivations.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
This commit is contained in:
Marcin Serwin 2025-05-24 17:47:11 +02:00
parent 05404c271c
commit 2fb8e7424a
No known key found for this signature in database
GPG key ID: DACFAC4EA0B194E0

View file

@ -10,7 +10,6 @@
libpulseaudio,
sndio,
speexdsp,
lazyLoad ? !stdenv.hostPlatform.isDarwin,
alsaSupport ? !stdenv.hostPlatform.isDarwin,
pulseSupport ? !stdenv.hostPlatform.isDarwin,
jackSupport ? !stdenv.hostPlatform.isDarwin,
@ -18,18 +17,6 @@
buildSharedLibs ? true,
}:
assert lib.assertMsg (
stdenv.hostPlatform.isDarwin -> !lazyLoad
) "cubeb: lazyLoad is inert on Darwin";
let
backendLibs =
lib.optional alsaSupport alsa-lib
++ lib.optional jackSupport jack2
++ lib.optional pulseSupport libpulseaudio
++ lib.optional sndioSupport sndio;
in
stdenv.mkDerivation {
pname = "cubeb";
version = "0-unstable-2025-04-02";
@ -52,7 +39,14 @@ stdenv.mkDerivation {
pkg-config
];
buildInputs = [ speexdsp ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) backendLibs;
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;
patches = [
# https://github.com/mozilla/cubeb/pull/813
@ -69,12 +63,12 @@ stdenv.mkDerivation {
(lib.cmakeBool "USE_SANITIZERS" false)
# Whether to lazily load libraries with dlopen()
(lib.cmakeBool "LAZY_LOAD_LIBS" lazyLoad)
(lib.cmakeBool "LAZY_LOAD_LIBS" false)
];
passthru = {
# For downstream users when lazyLoad is true
backendLibs = lib.optionals lazyLoad backendLibs;
backendLibs = [ ];
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
};