nixpkgs/pkgs/development/tools/gotools/default.nix

42 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, go, buildGoModule, fetchgit }:
2016-06-06 02:28:52 +02:00
buildGoModule rec {
2018-07-21 12:30:02 +02:00
name = "gotools-unstable-${version}";
2019-03-09 00:05:27 +01:00
version = "2019-03-05";
rev = "00c44ba9c14f88ffdd4fb5bfae57fe8dd6d6afb1";
2016-06-06 02:28:52 +02:00
src = fetchgit {
inherit rev;
url = "https://go.googlesource.com/tools";
2019-03-09 00:05:27 +01:00
sha256 = "04rpdi52j26szx5kiyfmwad1sg7lfplxrkbwkr3b1kfafh1whgw5";
2016-06-06 02:28:52 +02:00
};
modSha256 = "12klgqm2px878lzh05yzj6lr83v7vg0vv2k69pmg6nv1wlsxdlzf";
2016-06-06 02:28:52 +02:00
preConfigure = ''
# Make the builtin tools available here
mkdir -p $out/bin
2016-06-06 02:28:52 +02:00
eval $(go env | grep GOTOOLDIR)
find $GOTOOLDIR -type f | while read x; do
ln -sv "$x" "$out/bin"
2016-06-06 02:28:52 +02:00
done
export GOTOOLDIR=$out/bin
2016-06-06 02:28:52 +02: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 = ''
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 02:28:52 +02: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 02:28:52 +02:00
}