Merge pull request #222758 from SuperSandro2000/gotools

gotools: 0.1.10 -> 0.7.0, adopt, cleanup

authored by Doron Behar and committed by GitHub 7f5aa264 391586fc

+18 -38
+18 -38
pkgs/development/tools/gotools/default.nix
··· 1 - { lib, buildGoModule, fetchgit }: 1 + { lib, buildGoModule, fetchFromGitHub }: 2 2 3 3 buildGoModule rec { 4 4 pname = "gotools"; 5 - version = "0.1.10"; 5 + version = "0.7.0"; 6 6 7 - src = fetchgit { 7 + # using GitHub instead of https://go.googlesource.com/tools because Gitiles UI is to basic to browse 8 + src = fetchFromGitHub { 9 + owner = "golang"; 10 + repo = "tools"; 8 11 rev = "v${version}"; 9 - url = "https://go.googlesource.com/tools"; 10 - sha256 = "sha256-r71+//VhayW18uvMl/ls/8KYNbZ7uDZw3SWoqPL3Xqk="; 12 + # The gopls folder contains a Go submodule which causes a build failure 13 + # and lives in its own package named gopls. 14 + postFetch = '' 15 + rm -r $out/gopls 16 + ''; 17 + sha256 = "sha256-6Sdo6oKJHYXWkvJmbte7Wc7tov5AHzn70Bi1QdQ5HR4="; 11 18 }; 12 19 13 - # The gopls folder contains a Go submodule which causes a build failure. 14 - # Given that, we can't have the gopls binary be part of the gotools 15 - # derivation. 16 - # 17 - # The attribute "gopls" provides the gopls binary. 18 - # 19 - # Related 20 - # 21 - # * https://github.com/NixOS/nixpkgs/pull/85868 22 - # * https://github.com/NixOS/nixpkgs/issues/88716 23 - postPatch = '' 24 - rm -rf gopls 25 - ''; 26 - 27 - vendorSha256 = "sha256-UJIXG8WKzazNTXoqEFlT/umC40F6z2Q5I8RfxnMbsPM="; 20 + vendorSha256 = "sha256-fp0pb3EcGRDWlSpgel4pYRdsPJGk8/d57EjWJ+fzq7g="; 28 21 29 22 doCheck = false; 30 23 31 - postConfigure = '' 32 - # Make the builtin tools available here 33 - mkdir -p $out/bin 34 - eval $(go env | grep GOTOOLDIR) 35 - find $GOTOOLDIR -type f | while read x; do 36 - ln -sv "$x" "$out/bin" 37 - done 38 - export GOTOOLDIR=$out/bin 39 - ''; 40 - 41 - excludedPackages = [ "vet" "cover" ]; 42 - 43 24 # Set GOTOOLDIR for derivations adding this to buildInputs 44 25 postInstall = '' 45 26 mkdir -p $out/nix-support 46 27 substitute ${./setup-hook.sh} $out/nix-support/setup-hook \ 47 28 --subst-var-by bin $out 48 29 ''; 49 - 50 - # Do not copy this without a good reason for enabling 51 - # In this case tools is heavily coupled with go itself and embeds paths. 52 - allowGoReference = true; 53 30 54 31 meta = with lib; { 55 32 description = "Additional tools for Go development"; 56 - homepage = "http://go.googlesource.com/tools"; 33 + longDescription = '' 34 + This package contains tools like: godoc, goimports, callgraph, digraph, stringer or toolstash. 35 + ''; 36 + homepage = "https://go.googlesource.com/tools"; 57 37 license = licenses.bsd3; 58 - maintainers = with maintainers; [ danderson ]; 38 + maintainers = with maintainers; [ danderson SuperSandro2000 ]; 59 39 }; 60 40 }