Commit 6138dca0 authored by jaredmontoya's avatar jaredmontoya
Browse files

gotools: goimports depends on go in some cases

parent d6f569ef
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
  lib,
  buildGoModule,
  fetchFromGitHub,
  makeWrapper,
  go,
}:

buildGoModule rec {
@@ -16,16 +18,19 @@ buildGoModule rec {
    hash = "sha256-yUkdZSe/GV0w1qK8aQjcFE4tNKYC8f4JeFgPiv8GlQc=";
  };

  allowGoReference = true;
  doCheck = false;

  vendorHash = "sha256-+jhCNi7bGkRdI1Ywfe3q4i+zcm3UJ0kbQalsDD3WkS4=";

  nativeBuildInputs = [ makeWrapper ];

  postPatch = ''
    # The gopls folder contains a Go submodule which causes a build failure
    # and lives in its own package named gopls.
    rm -r gopls
  '';

  vendorHash = "sha256-+jhCNi7bGkRdI1Ywfe3q4i+zcm3UJ0kbQalsDD3WkS4=";

  doCheck = false;

  # Set GOTOOLDIR for derivations adding this to buildInputs
  postInstall = ''
    mkdir -p $out/nix-support
@@ -33,6 +38,11 @@ buildGoModule rec {
      --subst-var-by bin $out
  '';

  postFixup = ''
    wrapProgram $out/bin/goimports \
      --suffix PATH : ${lib.makeBinPath [ go ]}
  '';

  meta = with lib; {
    description = "Additional tools for Go development";
    longDescription = ''