mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
gofumpt: use finalAttrs, versionCheckHook
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
This commit is contained in:
@@ -3,18 +3,17 @@
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
testers,
|
||||
gofumpt,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "gofumpt";
|
||||
version = "0.8.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mvdan";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
repo = "gofumpt";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-37wYYB0k8mhQq30y1oo77qW3bIqqN/K/NG1RgxK6dyI=";
|
||||
};
|
||||
|
||||
@@ -24,7 +23,7 @@ buildGoModule rec {
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-X main.version=v${version}"
|
||||
"-X main.version=v${finalAttrs.version}"
|
||||
];
|
||||
|
||||
checkFlags = [
|
||||
@@ -32,23 +31,20 @@ buildGoModule rec {
|
||||
"-skip=^TestScript/diagnose$"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
tests.version = testers.testVersion {
|
||||
package = gofumpt;
|
||||
version = "v${version}";
|
||||
};
|
||||
};
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
meta = with lib; {
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Stricter gofmt";
|
||||
homepage = "https://github.com/mvdan/gofumpt";
|
||||
changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${version}";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [
|
||||
changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [
|
||||
rvolosatovs
|
||||
katexochen
|
||||
];
|
||||
mainProgram = "gofumpt";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user