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