diff options
author | adisbladis <adisbladis@gmail.com> | 2021-02-24 23:21:05 +0100 |
---|---|---|
committer | adisbladis <adisbladis@gmail.com> | 2021-02-24 23:22:19 +0100 |
commit | 2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba (patch) | |
tree | 06d58f7e3946c5961e4ad7d0c17aac54eea8a0e9 | |
parent | 6faea4fa13be49f1f8c412a16269370fe8a62fa5 (diff) | |
download | nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.tar nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.tar.gz nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.tar.bz2 nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.tar.lz nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.tar.xz nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.tar.zst nixpkgs-2c593e8e760c8d210ae135a4a7ee4bf6d227f6ba.zip |
buildGoPackage: Respect passing CGO_ENABLED explicitly
This used to work but was broken by 6a27d63a882d1daecd1dce9e61135ccea3b0696e.
-rw-r--r-- | pkgs/development/go-packages/generic/default.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/development/go-packages/generic/default.nix b/pkgs/development/go-packages/generic/default.nix index 0a1b3a9a294..8a093a03d1c 100644 --- a/pkgs/development/go-packages/generic/default.nix +++ b/pkgs/development/go-packages/generic/default.nix @@ -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" ]; |