mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
lib.meta.availableOn: Return false if pkg parameter is null
To fix overriding packages that checks for platform compatibility, like pipewire. `pipewire` contains the following logic to enable support for ldac depending on library platform compatibility: ```nix ldacbtSupport = lib.meta.availableOn stdenv.hostPlatform ldacbt ``` Which is used later in the expression to create a Meson flag: ```nix (lib.mesonEnable "bluez5-codec-ldac" (bluezSupport && ldacbtSupport)) ``` This means that attempting to build `pipewire` without `ldacbt` like: ```nix pipewire.override { ldacbt = null; } ``` will fail because the the Meson flag indicates the feature should be enabled, but the library is passed to `buildInputs` as `null`.
This commit is contained in:
parent
4ad8dfd97d
commit
9338d924db
1 changed files with 2 additions and 1 deletions
|
@ -289,7 +289,8 @@ rec {
|
|||
*/
|
||||
availableOn =
|
||||
platform: pkg:
|
||||
((!pkg ? meta.platforms) || any (platformMatch platform) pkg.meta.platforms)
|
||||
pkg != null
|
||||
&& ((!pkg ? meta.platforms) || any (platformMatch platform) pkg.meta.platforms)
|
||||
&& all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or [ ]);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue