2022-06-16 17:23:12 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, pandoc, lib }:
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildGoModule rec {
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "checkmake";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.2.1";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mrtazz";
|
|
|
|
repo = pname;
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-Zkrr1BrP8ktRGf6EYhDpz3oTnX6msrSpfFqkqi9pmlc=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
vendorSha256 = null;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ pandoc ];
|
|
|
|
|
|
|
|
preBuild =
|
|
|
|
let
|
|
|
|
buildVars = {
|
|
|
|
version = version;
|
|
|
|
buildTime = "N/A";
|
|
|
|
builder = "nix";
|
|
|
|
goversion = "$(go version | egrep -o 'go[0-9]+[.][^ ]*')";
|
|
|
|
};
|
|
|
|
buildVarsFlags = lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "-X main.${k}=${v}") buildVars);
|
|
|
|
in
|
|
|
|
''
|
|
|
|
buildFlagsArray+=("-ldflags=${buildVarsFlags}")
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/man/man1
|
2022-06-16 17:23:12 +00:00
|
|
|
pandoc -s -t man -o $out/share/man/man1/checkmake.1 man/man1/checkmake.1.md
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Experimental tool for linting and checking Makefiles";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/mrtazz/checkmake";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ vidbina ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
longDescription = ''
|
|
|
|
checkmake is an experimental tool for linting and checking
|
|
|
|
Makefiles. It may not do what you want it to.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|