mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-09-17 09:29:21 +00:00
parent
a1ab7d6ed6
commit
b40e660f51
1 changed files with 5 additions and 9 deletions
|
@ -4,7 +4,6 @@
|
|||
, buildEnv
|
||||
, lib
|
||||
, fetchgit
|
||||
, removeReferencesTo
|
||||
, jq
|
||||
, cacert
|
||||
, pkgs
|
||||
|
@ -227,8 +226,6 @@ let
|
|||
|
||||
go = selectGo attrs goMod;
|
||||
|
||||
removeReferences = [ ] ++ optional (!allowGoReference) go;
|
||||
|
||||
defaultPackage = modulesStruct.goPackagePath or "";
|
||||
|
||||
vendorEnv = mkVendorEnv {
|
||||
|
@ -247,14 +244,14 @@ let
|
|||
} // optionalAttrs (hasAttr "subPackages" modulesStruct) {
|
||||
subPackages = modulesStruct.subPackages;
|
||||
} // attrs // {
|
||||
nativeBuildInputs = [ removeReferencesTo go ] ++ nativeBuildInputs;
|
||||
nativeBuildInputs = [ go ] ++ nativeBuildInputs;
|
||||
|
||||
inherit (go) GOOS GOARCH;
|
||||
|
||||
GO_NO_VENDOR_CHECKS = "1";
|
||||
|
||||
GO111MODULE = "on";
|
||||
GOFLAGS = "-mod=vendor";
|
||||
GOFLAGS = [ "-mod=vendor" ] ++ lib.optionals (!allowGoReference) [ "-trimpath" ];
|
||||
|
||||
configurePhase = attrs.configurePhase or ''
|
||||
runHook preConfigure
|
||||
|
@ -361,6 +358,9 @@ let
|
|||
checkPhase = attrs.checkPhase or ''
|
||||
runHook preCheck
|
||||
|
||||
# We do not set trimpath for tests, in case they reference test assets
|
||||
export GOFLAGS=''${GOFLAGS//-trimpath/}
|
||||
|
||||
for pkg in $(getGoDirs test); do
|
||||
buildGoDir test "$pkg"
|
||||
done
|
||||
|
@ -378,10 +378,6 @@ let
|
|||
runHook postInstall
|
||||
'';
|
||||
|
||||
preFixup = (attrs.preFixup or "") + ''
|
||||
find $out/{bin,libexec,lib} -type f 2>/dev/null | xargs -r ${removeExpr removeReferences} || true
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
disallowedReferences = optional (!allowGoReference) go;
|
||||
|
|
Loading…
Reference in a new issue