[Lib/Optimizations]: merge attributes with priority handling

This commit is contained in:
Antoine Viallon 2024-09-18 20:50:06 +02:00
parent d7d489674f
commit 1c7ee1e60a
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -210,7 +210,7 @@ rec {
}; };
addAttrs = pkg: attrs: pkg.overrideAttrs (old: addAttrs = pkg: attrs: pkg.overrideAttrs (old:
(myLib.attrsets.mergeAttrsRecursive old attrs) // { (myLib.attrsets.mergeAttrsRecursiveWithPriority old attrs) // {
passthru = (pkg.passthru or {}) // (attrs.passtru or {}); passthru = (pkg.passthru or {}) // (attrs.passtru or {});
} }
); );
@ -362,7 +362,7 @@ rec {
if (! isNull cpuTune) then cpuTune if (! isNull cpuTune) then cpuTune
else if (! isNull cpuArch) then cpuArch else if (! isNull cpuArch) then cpuArch
else "generic"; else "generic";
in myLib.debug.traceValWithPrefix "optimizations" (foldl' myLib.attrsets.mergeAttrsRecursive {} [ in myLib.debug.traceValWithPrefix "optimizations" (foldl' myLib.attrsets.mergeAttrsRecursiveWithPriority {} [
(rec { (rec {
CFLAGS = unique CFLAGS = unique
([ ] ([ ]