From 2fb8e7424aecda596e2298c25cd2361df938bcdb Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 24 May 2025 17:47:11 +0200 Subject: [PATCH] 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 --- pkgs/by-name/cu/cubeb/package.nix | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/cu/cubeb/package.nix b/pkgs/by-name/cu/cubeb/package.nix index 1abb55a381d0..88bc7eadd748 100644 --- a/pkgs/by-name/cu/cubeb/package.nix +++ b/pkgs/by-name/cu/cubeb/package.nix @@ -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; }; };