File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
pkgs/build-support/trivial-builders Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1028,6 +1028,16 @@ rec {
10281028 if patches == [ ] && prePatch == "" && postPatch == "" then
10291029 src # nothing to do, so use original src to avoid additional drv
10301030 else
1031+ let
1032+ keepAttrs = names : lib . filterAttrs ( name : val : lib . elem name names ) ;
1033+ # enables tools like nix-update to determine what src attributes to replace
1034+ extraPassthru = keepAttrs [
1035+ "rev"
1036+ "tag"
1037+ "url"
1038+ "outputHash"
1039+ ] src ;
1040+ in
10311041 stdenvNoCC . mkDerivation (
10321042 {
10331043 inherit
@@ -1042,11 +1052,19 @@ rec {
10421052 phases = "unpackPhase patchPhase installPhase" ;
10431053 installPhase = "cp -R ./ $out" ;
10441054 }
1045- # Carry `meta` information from the underlying `src` if present.
1046- // ( optionalAttrs ( src ? meta ) { inherit ( src ) meta ; } )
1055+ # Carry and merge information from the underlying `src` if present.
1056+ // ( optionalAttrs ( src ? meta || args ? meta ) {
1057+ meta = src . meta or { } // args . meta or { } ;
1058+ } )
1059+ // ( optionalAttrs ( extraPassthru != { } || src ? passthru || args ? passthru ) {
1060+ passthru = extraPassthru // src . passthru or { } // args . passthru or { } ;
1061+ } )
1062+ # Forward any additional arguments to the derviation
10471063 // ( removeAttrs args [
10481064 "src"
10491065 "name"
1066+ "meta"
1067+ "passthru"
10501068 "patches"
10511069 "prePatch"
10521070 "postPatch"
You can’t perform that action at this time.
0 commit comments