diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index aca313264a28..9e401cc68aa2 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -105,7 +105,7 @@ let runHook postConfigure ''; - buildPhase = args.modBuildPhase or '' + buildPhase = args.modBuildPhase or ('' runHook preBuild '' + lib.optionalString (deleteVendor == true) '' if [ ! -d vendor ]; then @@ -133,7 +133,7 @@ let mkdir -p vendor runHook postBuild - ''; + ''); installPhase = args.modInstallPhase or '' runHook preInstall @@ -176,7 +176,7 @@ let GOFLAGS = lib.optionals (!proxyVendor) [ "-mod=vendor" ] ++ lib.optionals (!allowGoReference) [ "-trimpath" ]; inherit CGO_ENABLED; - configurePhase = args.configurePhase or '' + configurePhase = args.configurePhase or ('' runHook preConfigure export GOCACHE=$TMPDIR/go-cache @@ -200,9 +200,9 @@ let fi runHook postConfigure - ''; + ''); - buildPhase = args.buildPhase or '' + buildPhase = args.buildPhase or ('' runHook preBuild exclude='\(/_\|examples\|Godeps\|testdata' @@ -282,7 +282,7 @@ let ) '' + '' runHook postBuild - ''; + ''); doCheck = args.doCheck or true; checkPhase = args.checkPhase or '' diff --git a/pkgs/build-support/go/package.nix b/pkgs/build-support/go/package.nix index 9106bf9796eb..e627058604d9 100644 --- a/pkgs/build-support/go/package.nix +++ b/pkgs/build-support/go/package.nix @@ -99,7 +99,7 @@ let GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]); - configurePhase = args.configurePhase or '' + configurePhase = args.configurePhase or ('' runHook preConfigure # Extract the source @@ -141,7 +141,7 @@ let fi runHook postConfigure - ''; + ''); renameImports = args.renameImports or ( let @@ -151,7 +151,7 @@ let renames = p: lib.concatMapStringsSep "\n" (rename p.goPackagePath) p.goPackageAliases; in lib.concatMapStringsSep "\n" renames inputsWithAliases); - buildPhase = args.buildPhase or '' + buildPhase = args.buildPhase or ('' runHook preBuild runHook renameImports @@ -235,7 +235,7 @@ let ) '' + '' runHook postBuild - ''; + ''); doCheck = args.doCheck or false; checkPhase = args.checkPhase or ''