mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
gotools: use buildGoModule instead of buildGoPackage
This commit is contained in:
parent
1a4cccd561
commit
6ee0d3604e
@ -1,44 +1,41 @@
|
||||
{ stdenv, go, buildGoPackage, fetchgit }:
|
||||
{ stdenv, go, buildGoModule, fetchgit }:
|
||||
|
||||
buildGoPackage rec {
|
||||
buildGoModule rec {
|
||||
name = "gotools-unstable-${version}";
|
||||
version = "2019-03-05";
|
||||
rev = "00c44ba9c14f88ffdd4fb5bfae57fe8dd6d6afb1";
|
||||
|
||||
goPackagePath = "golang.org/x/tools";
|
||||
goPackageAliases = [ "code.google.com/p/go.tools" ];
|
||||
|
||||
src = fetchgit {
|
||||
inherit rev;
|
||||
url = "https://go.googlesource.com/tools";
|
||||
sha256 = "04rpdi52j26szx5kiyfmwad1sg7lfplxrkbwkr3b1kfafh1whgw5";
|
||||
};
|
||||
|
||||
goDeps = ./deps.nix;
|
||||
modSha256 = "12klgqm2px878lzh05yzj6lr83v7vg0vv2k69pmg6nv1wlsxdlzf";
|
||||
|
||||
preConfigure = ''
|
||||
# Make the builtin tools available here
|
||||
mkdir -p $bin/bin
|
||||
mkdir -p $out/bin
|
||||
eval $(go env | grep GOTOOLDIR)
|
||||
find $GOTOOLDIR -type f | while read x; do
|
||||
ln -sv "$x" "$bin/bin"
|
||||
ln -sv "$x" "$out/bin"
|
||||
done
|
||||
export GOTOOLDIR=$bin/bin
|
||||
export GOTOOLDIR=$out/bin
|
||||
'';
|
||||
|
||||
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
|
||||
'';
|
||||
|
||||
# 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 ${../../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
|
||||
'';
|
||||
}
|
||||
|
11
pkgs/development/tools/gotools/deps.nix
generated
11
pkgs/development/tools/gotools/deps.nix
generated
@ -1,11 +0,0 @@
|
||||
[
|
||||
{
|
||||
goPackagePath = "golang.org/x/net";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://go.googlesource.com/net";
|
||||
rev = "65e2d4e15006aab9813ff8769e768bbf4bb667a0";
|
||||
sha256 = "0aqcmh0sp723d6hwgrv7pnrs4crns2ngr4x43jd4v985cbn455x7";
|
||||
};
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user