Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

gofumpt: use finalAttrs, versionCheckHook (#397908)

authored by

Paul Meyer and committed by
GitHub
f7beabd9 6a6acafe

+14 -18
+14 -18
pkgs/by-name/go/gofumpt/package.nix
··· 3 3 buildGoModule, 4 4 fetchFromGitHub, 5 5 nix-update-script, 6 - testers, 7 - gofumpt, 6 + versionCheckHook, 8 7 }: 9 8 10 - buildGoModule rec { 9 + buildGoModule (finalAttrs: { 11 10 pname = "gofumpt"; 12 11 version = "0.8.0"; 13 12 14 13 src = fetchFromGitHub { 15 14 owner = "mvdan"; 16 - repo = pname; 17 - rev = "v${version}"; 15 + repo = "gofumpt"; 16 + rev = "v${finalAttrs.version}"; 18 17 hash = "sha256-37wYYB0k8mhQq30y1oo77qW3bIqqN/K/NG1RgxK6dyI="; 19 18 }; 20 19 ··· 24 23 25 24 ldflags = [ 26 25 "-s" 27 - "-X main.version=v${version}" 26 + "-X main.version=v${finalAttrs.version}" 28 27 ]; 29 28 30 29 checkFlags = [ ··· 32 31 "-skip=^TestScript/diagnose$" 33 32 ]; 34 33 35 - passthru = { 36 - updateScript = nix-update-script { }; 37 - tests.version = testers.testVersion { 38 - package = gofumpt; 39 - version = "v${version}"; 40 - }; 41 - }; 34 + doInstallCheck = true; 35 + nativeInstallCheckInputs = [ versionCheckHook ]; 42 36 43 - meta = with lib; { 37 + passthru.updateScript = nix-update-script { }; 38 + 39 + meta = { 44 40 description = "Stricter gofmt"; 45 41 homepage = "https://github.com/mvdan/gofumpt"; 46 - changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${version}"; 47 - license = licenses.bsd3; 48 - maintainers = with maintainers; [ 42 + changelog = "https://github.com/mvdan/gofumpt/releases/tag/v${finalAttrs.version}"; 43 + license = lib.licenses.bsd3; 44 + maintainers = with lib.maintainers; [ 49 45 rvolosatovs 50 46 katexochen 51 47 ]; 52 48 mainProgram = "gofumpt"; 53 49 }; 54 - } 50 + })