From b080efe4dcafee3ecbe5975e59b5a74c575def5f Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Wed, 28 Oct 2015 11:00:54 +0100 Subject: [PATCH] goPackages.tools: add setup-hook for setting GOTOOLDIR --- pkgs/development/go-modules/tools/setup-hook.sh | 1 + pkgs/top-level/go-packages.nix | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 pkgs/development/go-modules/tools/setup-hook.sh diff --git a/pkgs/development/go-modules/tools/setup-hook.sh b/pkgs/development/go-modules/tools/setup-hook.sh new file mode 100644 index 000000000000..e354e50c35aa --- /dev/null +++ b/pkgs/development/go-modules/tools/setup-hook.sh @@ -0,0 +1 @@ +export GOTOOLDIR=@bin@/bin diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index f344de0f6892..55c8baac353d 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -133,6 +133,14 @@ let # Do not copy this without a good reason for enabling # In this case tools is heavily coupled with go itself and embeds paths. allowGoReference = true; + + # Set GOTOOLDIR for derivations adding this to buildInputs + postInstall = '' + mkdir -p $bin/nix-support + substituteAll ${../development/go-modules/tools/setup-hook.sh} $bin/nix-support/setup-hook.tmp + cat $bin/nix-support/setup-hook.tmp >> $bin/nix-support/setup-hook + rm $bin/nix-support/setup-hook.tmp + ''; };