nixpkgs/pkgs/development/tools/checkmake/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.3 KiB
Nix
Raw Normal View History

2022-05-27 02:17:03 +00:00
{ buildGoModule, fetchFromGitHub, pandoc, lib }:
2021-01-19 11:32:25 +00:00
2022-05-27 02:17:03 +00:00
buildGoModule rec {
2021-01-19 11:32:25 +00:00
pname = "checkmake";
2022-05-27 02:17:03 +00:00
version = "0.2.1";
2021-01-19 11:32:25 +00:00
src = fetchFromGitHub {
owner = "mrtazz";
repo = pname;
2022-05-27 02:17:03 +00:00
rev = version;
sha256 = "sha256-Zkrr1BrP8ktRGf6EYhDpz3oTnX6msrSpfFqkqi9pmlc=";
2021-01-19 11:32:25 +00:00
};
2022-05-27 02:17:03 +00:00
vendorSha256 = null;
2021-01-19 11:32:25 +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-05-27 02:17:03 +00:00
ldflags = [ "-s" "-w" ];
2021-01-19 11:32:25 +00:00
postInstall = ''
mkdir -p $out/share/man/man1
2022-05-27 02:17:03 +00:00
pandoc -s -t man -o $out/share/man/man1/checkmake.1 man/man1/checkmake.1.md
2021-01-19 11:32:25 +00:00
'';
meta = with lib; {
description = "Experimental tool for linting and checking Makefiles";
homepage = "https://github.com/mrtazz/checkmake";
2021-01-19 11:32:25 +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.
'';
};
}