2019-03-08 23:14:33 +00:00
|
|
|
{ stdenv, go, buildGoModule, fetchgit }:
|
2016-06-06 01:28:52 +01:00
|
|
|
|
2019-03-08 23:14:33 +00:00
|
|
|
buildGoModule rec {
|
2018-07-21 11:30:02 +01:00
|
|
|
name = "gotools-unstable-${version}";
|
2019-06-05 19:59:35 +01:00
|
|
|
version = "2019-06-03";
|
|
|
|
rev = "8aaa1484dc108aa23dcf2d4a09371c0c9e280f6b";
|
2016-06-06 01:28:52 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
inherit rev;
|
|
|
|
url = "https://go.googlesource.com/tools";
|
2019-06-05 19:59:35 +01:00
|
|
|
sha256 = "0sa41fi38b6pvz7jjr6vqrd152qjvmbcagm1qdxw41vqcdw3ljx3";
|
2016-06-06 01:28:52 +01:00
|
|
|
};
|
|
|
|
|
2019-05-25 01:42:36 +01:00
|
|
|
modSha256 = "0cm7fwb1k5hvbhh86kagzsw5vwgkr6dr7glhbjxg5xaahlhx2w5w";
|
2016-06-06 01:28:52 +01:00
|
|
|
|
2019-03-22 03:40:07 +00:00
|
|
|
postConfigure = ''
|
2016-06-06 01:28:52 +01:00
|
|
|
# Make the builtin tools available here
|
2019-03-08 23:14:33 +00:00
|
|
|
mkdir -p $out/bin
|
2016-06-06 01:28:52 +01:00
|
|
|
eval $(go env | grep GOTOOLDIR)
|
|
|
|
find $GOTOOLDIR -type f | while read x; do
|
2019-03-08 23:14:33 +00:00
|
|
|
ln -sv "$x" "$out/bin"
|
2016-06-06 01:28:52 +01:00
|
|
|
done
|
2019-03-08 23:14:33 +00:00
|
|
|
export GOTOOLDIR=$out/bin
|
2016-06-06 01:28:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
excludedPackages = "\\("
|
|
|
|
+ stdenv.lib.concatStringsSep "\\|" ([ "testdata" ] ++ stdenv.lib.optionals (stdenv.lib.versionAtLeast go.meta.branch "1.5") [ "vet" "cover" ])
|
|
|
|
+ "\\)";
|
|
|
|
|
|
|
|
# Set GOTOOLDIR for derivations adding this to buildInputs
|
|
|
|
postInstall = ''
|
2019-03-08 23:14:33 +00:00
|
|
|
mkdir -p $out/nix-support
|
|
|
|
substituteAll ${../../go-modules/tools/setup-hook.sh} $out/nix-support/setup-hook.tmp
|
|
|
|
cat $out/nix-support/setup-hook.tmp >> $out/nix-support/setup-hook
|
|
|
|
rm $out/nix-support/setup-hook.tmp
|
2016-06-06 01:28:52 +01:00
|
|
|
'';
|
2019-03-08 23:14:33 +00:00
|
|
|
|
|
|
|
# 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;
|
2016-06-06 01:28:52 +01:00
|
|
|
}
|