nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6 nix-update-script,
7 pandoc,
8 go,
9}:
10
11buildGoModule (finalAttrs: {
12 pname = "checkmake";
13 version = "0.3.2";
14
15 src = fetchFromGitHub {
16 owner = "checkmake";
17 repo = "checkmake";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-5GIqmcIj1jU4lOqrFxuI8lDNYYpsRnUSft6RYGRbiAE=";
20 };
21
22 vendorHash = "sha256-Iv3MFhHnwDLIuUH7G6NYyQUSAaivBYqYDWephHnBIho=";
23
24 nativeBuildInputs = [
25 installShellFiles
26 pandoc
27 ];
28
29 ldflags = [
30 "-s"
31 "-w"
32 "-X=main.version=${finalAttrs.version}"
33 "-X=main.buildTime=1970-01-01T00:00:00Z"
34 "-X=main.builder=nixpkgs"
35 "-X=main.goversion=go${go.version}"
36 ];
37
38 passthru.updateScript = nix-update-script { };
39
40 postPatch = ''
41 substituteInPlace man/man1/checkmake.1.md \
42 --replace REPLACE_DATE 1970-01-01T00:00:00Z
43 '';
44
45 postBuild = ''
46 pandoc man/man1/checkmake.1.md -st man -o man/man1/checkmake.1
47 '';
48
49 postInstall = ''
50 installManPage man/man1/checkmake.1
51 '';
52
53 meta = {
54 description = "Linter and analyzer for Makefiles";
55 mainProgram = "checkmake";
56 homepage = "https://github.com/checkmake/checkmake";
57 changelog = "https://github.com/checkmake/checkmake/releases/tag/v${finalAttrs.version}";
58 license = lib.licenses.mit;
59 longDescription = ''
60 checkmake is a linter for Makefiles. It scans Makefiles for potential issues based on configurable rules.
61 '';
62 maintainers = with lib.maintainers; [ lafrenierejm ];
63 };
64})