at 22.05-pre 49 lines 1.4 kB view raw
1{ buildGoPackage, fetchFromGitHub, git, pandoc, lib }: 2 3buildGoPackage rec { 4 pname = "checkmake"; 5 version = "0.1.0-2020.11.30"; 6 7 goPackagePath = "github.com/mrtazz/checkmake"; 8 9 src = fetchFromGitHub { 10 owner = "mrtazz"; 11 repo = pname; 12 rev = "575315c9924da41534a9d0ce91c3f0d19bb53ffc"; 13 sha256 = "121rsl9mh3wwadgf8ggi2xnb050pak6ma68b2sw5j8clmxbrqli3"; 14 }; 15 16 nativeBuildInputs = [ pandoc ]; 17 18 preBuild = 19 let 20 buildVars = { 21 version = version; 22 buildTime = "N/A"; 23 builder = "nix"; 24 goversion = "$(go version | egrep -o 'go[0-9]+[.][^ ]*')"; 25 }; 26 buildVarsFlags = lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "-X main.${k}=${v}") buildVars); 27 in 28 '' 29 buildFlagsArray+=("-ldflags=${buildVarsFlags}") 30 ''; 31 32 postInstall = '' 33 pandoc -s -t man -o checkmake.1 go/src/${goPackagePath}/man/man1/checkmake.1.md 34 mkdir -p $out/share/man/man1 35 mv checkmake.1 $out/share/man/man1/checkmake.1 36 ''; 37 38 meta = with lib; { 39 description = "Experimental tool for linting and checking Makefiles"; 40 homepage = "https://github.com/mrtazz/checkmake"; 41 license = licenses.mit; 42 maintainers = with maintainers; [ vidbina ]; 43 platforms = platforms.linux; 44 longDescription = '' 45 checkmake is an experimental tool for linting and checking 46 Makefiles. It may not do what you want it to. 47 ''; 48 }; 49}