From 3e2365433ee72bad73717d164b7fd7749082bce3 Mon Sep 17 00:00:00 2001 From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> Date: Mon, 9 Feb 2026 16:09:53 -0500 Subject: [PATCH] applyPatches: ensure overrides are carried down --- .../trivial-builders/default.nix | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 0a1af075bc5d..3c21375225f7 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1037,24 +1037,24 @@ rec { let keepAttrs = names: lib.filterAttrs (name: val: lib.elem name names); # enables tools like nix-update to determine what src attributes to replace - extraPassthru = lib.optionalAttrs (lib.isAttrs src) ( + extraPassthru = lib.optionalAttrs (lib.isAttrs finalAttrs.src) ( keepAttrs [ "rev" "tag" "url" "outputHash" "outputHashAlgo" - ] src + ] finalAttrs.src ); in { name = args.name or ( - if builtins.isPath src then - baseNameOf src + "-patched" - else if builtins.isAttrs src && (src ? name) then + if builtins.isPath finalAttrs.src then + baseNameOf finalAttrs.src + "-patched" + else if builtins.isAttrs finalAttrs.src && (finalAttrs.src ? name) then let - srcName = builtins.parseDrvName src; + srcName = builtins.parseDrvName finalAttrs.src.name; in "${srcName.name}-patched${lib.optionalString (srcName.version != "") "-${srcName.version}"}" else @@ -1069,19 +1069,20 @@ rec { allowSubstitutes = false; # unconditionally disable phases that are we don't want - dontConfigure = true; - dontBuild = true; - doCheck = false; - doInstallCheck = false; - dontFixup = true; - doDist = false; + phases = [ + "unpackPhase" + "patchPhase" + "installPhase" + ]; installPhase = "cp -R ./ $out"; - passthru = extraPassthru // src.passthru or { }; + # passthru the git and hash info for nix-update, as well + # as all the src's passthru attrs. + passthru = extraPassthru // finalAttrs.src.passthru or { }; # Carry (and merge) information from the underlying `src` if present. - meta = lib.optionalAttrs (src ? meta) (removeAttrs src.meta) [ "position" ]; + meta = lib.optionalAttrs (src ? meta) (removeAttrs finalAttrs.src.meta) [ "position" ]; }; };