Unverified Commit 5a40e285 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

gopls: modernize derivation (#393974)

parents 9dcb9937 fe7b85f3
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -2,16 +2,18 @@
  lib,
  buildGoModule,
  fetchFromGitHub,
  nix-update-script,
  versionCheckHook,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "gopls";
  version = "0.18.1";

  src = fetchFromGitHub {
    owner = "golang";
    repo = "tools";
    rev = "gopls/v${version}";
    tag = "gopls/v${finalAttrs.version}";
    hash = "sha256-5w6R3kaYwrZyhIYjwLqfflboXT/z3HVpZiowxeUyaWg=";
  };

@@ -19,7 +21,7 @@ buildGoModule rec {
  vendorHash = "sha256-/tca93Df90/8K1dqhOfUsWSuFoNfg9wdWy3csOtFs6Y=";

  # https://github.com/golang/tools/blob/9ed98faa/gopls/main.go#L27-L30
  ldflags = [ "-X main.version=v${version}" ];
  ldflags = [ "-X main.version=v${finalAttrs.version}" ];

  doCheck = false;

@@ -30,12 +32,18 @@ buildGoModule rec {
    "internal/analysis/modernize/cmd/modernize"
  ];

  meta = with lib; {
  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = "version";

  passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=gopls/(.*)" ]; };

  meta = {
    changelog = "https://github.com/golang/tools/releases/tag/gopls/v${finalAttrs.version}";
    description = "Official language server for the Go language";
    homepage = "https://github.com/golang/tools/tree/master/gopls";
    changelog = "https://github.com/golang/tools/releases/tag/${src.rev}";
    license = licenses.bsd3;
    maintainers = with maintainers; [
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [
      mic92
      rski
      SuperSandro2000
@@ -43,4 +51,4 @@ buildGoModule rec {
    ];
    mainProgram = "gopls";
  };
}
})