1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Deduplicate our many package.nix a bit (#11175)

- They should all be built in parallel

- They should all use strict deps by default
This commit is contained in:
John Ericson 2024-07-24 23:12:39 -04:00 committed by GitHub
parent a2fed6db9e
commit 3b49f7a143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 21 additions and 106 deletions

View file

@ -63,9 +63,16 @@ let
# Work around weird `--as-needed` linker behavior with BSD, see
# https://github.com/mesonbuild/meson/issues/3593
bsdNoLinkAsNeeded = finalAttrs: prevAttrs: lib.optionalAttrs stdenv.hostPlatform.isBSD {
mesonFlags = [ (lib.mesonBool "b_asneeded" false) ] ++ prevAttrs.mesonFlags or [];
};
bsdNoLinkAsNeeded = finalAttrs: prevAttrs:
lib.optionalAttrs stdenv.hostPlatform.isBSD {
mesonFlags = [ (lib.mesonBool "b_asneeded" false) ] ++ prevAttrs.mesonFlags or [];
};
miscGoodPractice = finalAttrs: prevAttrs:
{
strictDeps = prevAttrs.strictDeps or true;
enableParallelBuilding = true;
};
in
scope: {
@ -136,8 +143,14 @@ scope: {
inherit resolvePath filesetToSource;
mkMesonDerivation = f: stdenv.mkDerivation
(lib.extends
(lib.composeExtensions bsdNoLinkAsNeeded localSourceLayer)
f);
mkMesonDerivation = f: let
exts = [
miscGoodPractice
bsdNoLinkAsNeeded
localSourceLayer
];
in stdenv.mkDerivation
(lib.extends
(lib.foldr lib.composeExtensions (_: _: {}) exts)
f);
}