From ce1ba13c718372ba10ebd217f1b9c330ab00ce1a Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 25 Jan 2025 15:59:13 +0100 Subject: [PATCH] gui-for-singbox: fix basepath patching placeholder can't be used with replaceVars, because it results in the output of the **replaceVars** derivation, not the "calling" derivation. --- pkgs/by-name/gu/gui-for-singbox/package.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/gu/gui-for-singbox/package.nix b/pkgs/by-name/gu/gui-for-singbox/package.nix index 08620f978925..f69c6461165e 100644 --- a/pkgs/by-name/gu/gui-for-singbox/package.nix +++ b/pkgs/by-name/gu/gui-for-singbox/package.nix @@ -68,11 +68,13 @@ in buildGoModule { inherit pname version src; - patches = [ - (replaceVars ./bridge.patch { - basepath = placeholder "out"; - }) - ]; + patches = [ ./bridge.patch ]; + + postPatch = '' + # As we need the $out reference, we can't use `replaceVars` here. + substituteInPlace bridge/bridge.go \ + --replace-fail '@basepath@' "$out" + ''; vendorHash = "sha256-OrysyJF+lUMf+0vWmOZHjxUdE6fQCKArmpV4alXxtYs=";