mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
gopls: modernize derivation
This commit is contained in:
parent
6d554c08cd
commit
fe7b85f334
1 changed files with 16 additions and 8 deletions
|
@ -2,16 +2,18 @@
|
||||||
lib,
|
lib,
|
||||||
buildGoModule,
|
buildGoModule,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
|
nix-update-script,
|
||||||
|
versionCheckHook,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule (finalAttrs: {
|
||||||
pname = "gopls";
|
pname = "gopls";
|
||||||
version = "0.18.1";
|
version = "0.18.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "golang";
|
owner = "golang";
|
||||||
repo = "tools";
|
repo = "tools";
|
||||||
rev = "gopls/v${version}";
|
tag = "gopls/v${finalAttrs.version}";
|
||||||
hash = "sha256-5w6R3kaYwrZyhIYjwLqfflboXT/z3HVpZiowxeUyaWg=";
|
hash = "sha256-5w6R3kaYwrZyhIYjwLqfflboXT/z3HVpZiowxeUyaWg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +21,7 @@ buildGoModule rec {
|
||||||
vendorHash = "sha256-/tca93Df90/8K1dqhOfUsWSuFoNfg9wdWy3csOtFs6Y=";
|
vendorHash = "sha256-/tca93Df90/8K1dqhOfUsWSuFoNfg9wdWy3csOtFs6Y=";
|
||||||
|
|
||||||
# https://github.com/golang/tools/blob/9ed98faa/gopls/main.go#L27-L30
|
# 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;
|
doCheck = false;
|
||||||
|
|
||||||
|
@ -30,12 +32,18 @@ buildGoModule rec {
|
||||||
"internal/analysis/modernize/cmd/modernize"
|
"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";
|
description = "Official language server for the Go language";
|
||||||
homepage = "https://github.com/golang/tools/tree/master/gopls";
|
homepage = "https://github.com/golang/tools/tree/master/gopls";
|
||||||
changelog = "https://github.com/golang/tools/releases/tag/${src.rev}";
|
license = lib.licenses.bsd3;
|
||||||
license = licenses.bsd3;
|
maintainers = with lib.maintainers; [
|
||||||
maintainers = with maintainers; [
|
|
||||||
mic92
|
mic92
|
||||||
rski
|
rski
|
||||||
SuperSandro2000
|
SuperSandro2000
|
||||||
|
@ -43,4 +51,4 @@ buildGoModule rec {
|
||||||
];
|
];
|
||||||
mainProgram = "gopls";
|
mainProgram = "gopls";
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue