biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / kgt / default.nix
blobe0ef6bd6d15d56ce7356c0b3b72ccac083ad93d8
1 { lib, stdenv, fetchFromGitHub, bmake, cleanPackaging }:
3 stdenv.mkDerivation {
4   pname = "kgt";
5   version = "2023-06-03";
7   src = fetchFromGitHub {
8     owner = "katef";
9     repo = "kgt";
10     # 2023-06-03, no version tags (yet)
11     rev = "dc881796aa691f1fddb1d01ec77216b34fe8134d";
12     hash = "sha256-Az5995/eGUHFL1C1WAdgh1td3goHUYgzWFeVFz2zb8g=";
13     fetchSubmodules = true;
14   };
16   outputs = [ "bin" "doc" "out" ];
18   nativeBuildInputs = [ bmake ];
19   enableParallelBuilding = true;
21   makeFlags = [ "-r" "PREFIX=$(bin)" ];
23   installPhase = ''
24     runHook preInstall
26     ${cleanPackaging.commonFileActions {
27         docFiles = [
28           "README.md"
29           "LICENCE"
30           "examples"
31           # TODO: this is just a docbook file, not a mangpage yet
32           # https://github.com/katef/kgt/issues/50
33           "man"
34           "examples"
35           "doc"
36         ];
37         noiseFiles = [
38           "build/src"
39           "build/lib"
40           "Makefile"
41           "src/**/*.c"
42           "src/**/*.h"
43           "src/**/Makefile"
44           "src/**/lexer.lx"
45           "src/**/parser.sid"
46           "src/**/parser.act"
47           "share/git"
48           "share/css"
49           "share/xsl"
50           ".gitignore"
51           ".gitmodules"
52           ".gitattributes"
53           ".github"
54         ];
55       }} $doc/share/doc/kgt
57     install -Dm755 build/bin/kgt $bin/bin/kgt
58     rm build/bin/kgt
60     runHook postInstall
61   '';
63   postFixup = ''
64     ${cleanPackaging.checkForRemainingFiles}
65   '';
67   meta = with lib; {
68     description = "BNF wrangling and railroad diagrams";
69     mainProgram = "kgt";
70     longDescription = ''
71       KGT: Kate's Grammar Tool
73       Input: Various BNF-like syntaxes
74       Output: Various BNF-like syntaxes, AST dumps, and Railroad Syntax Diagrams
75     '';
76     homepage    = "https://github.com/katef/kgt";
77     license     = licenses.bsd2;
78     platforms   = platforms.unix;
79     maintainers = with maintainers; [ Profpatsch ];
80   };