mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
applyPatches: simplify src attribute inheritance (#409614)
This commit is contained in:
commit
a16efe5d2f
1 changed files with 11 additions and 7 deletions
|
@ -1022,6 +1022,12 @@ rec {
|
||||||
postPatch ? "",
|
postPatch ? "",
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
|
assert lib.assertMsg (
|
||||||
|
!args ? meta
|
||||||
|
) "applyPatches will not merge 'meta', change it in 'src' instead";
|
||||||
|
assert lib.assertMsg (
|
||||||
|
!args ? passthru
|
||||||
|
) "applyPatches will not merge 'passthru', change it in 'src' instead";
|
||||||
if patches == [ ] && prePatch == "" && postPatch == "" then
|
if patches == [ ] && prePatch == "" && postPatch == "" then
|
||||||
src # nothing to do, so use original src to avoid additional drv
|
src # nothing to do, so use original src to avoid additional drv
|
||||||
else
|
else
|
||||||
|
@ -1051,19 +1057,17 @@ rec {
|
||||||
phases = "unpackPhase patchPhase installPhase";
|
phases = "unpackPhase patchPhase installPhase";
|
||||||
installPhase = "cp -R ./ $out";
|
installPhase = "cp -R ./ $out";
|
||||||
}
|
}
|
||||||
# Carry and merge information from the underlying `src` if present.
|
# Carry (and merge) information from the underlying `src` if present.
|
||||||
// (optionalAttrs (src ? meta || args ? meta) {
|
// (optionalAttrs (src ? meta) {
|
||||||
meta = src.meta or { } // args.meta or { };
|
inherit (src) meta;
|
||||||
})
|
})
|
||||||
// (optionalAttrs (extraPassthru != { } || src ? passthru || args ? passthru) {
|
// (optionalAttrs (extraPassthru != { } || src ? passthru) {
|
||||||
passthru = extraPassthru // src.passthru or { } // args.passthru or { };
|
passthru = extraPassthru // src.passthru or { };
|
||||||
})
|
})
|
||||||
# Forward any additional arguments to the derviation
|
# Forward any additional arguments to the derviation
|
||||||
// (removeAttrs args [
|
// (removeAttrs args [
|
||||||
"src"
|
"src"
|
||||||
"name"
|
"name"
|
||||||
"meta"
|
|
||||||
"passthru"
|
|
||||||
"patches"
|
"patches"
|
||||||
"prePatch"
|
"prePatch"
|
||||||
"postPatch"
|
"postPatch"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue