buildGoPackage: Respect passing CGO_ENABLED explicitly

This used to work but was broken by 6a27d63a88.
This commit is contained in:
adisbladis 2021-02-24 23:21:05 +01:00
parent 6faea4fa13
commit 2c593e8e76
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -35,6 +35,8 @@
# IE: programs coupled with the compiler
, allowGoReference ? false
, CGO_ENABLED ? go.CGO_ENABLED
, meta ? {}, ... } @ args:
@ -75,11 +77,13 @@ let
++ (lib.optional (!dontRenameImports) govers) ++ nativeBuildInputs;
buildInputs = buildInputs;
inherit (go) GOOS GOARCH GO386 CGO_ENABLED;
inherit (go) GOOS GOARCH GO386;
GOHOSTARCH = go.GOHOSTARCH or null;
GOHOSTOS = go.GOHOSTOS or null;
inherit CGO_ENABLED;
GO111MODULE = "off";
GOFLAGS = lib.optionals (!allowGoReference) [ "-trimpath" ];