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:
parent
a2fed6db9e
commit
3b49f7a143
24 changed files with 21 additions and 106 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue