@@ -0,0 +1,50 @@
1+{ stdenv
2+, lib
3+, fetchFromGitHub
4+, bison
5+, cmake
6+, flex
7+, perl
8+}:
9+
10+stdenv.mkDerivation rec {
11+ pname = "elkhound";
12+ version = "unstable-2020-04-13";
13+
14+ src = fetchFromGitHub {
15+ owner = "WeiDUorg";
16+ repo = pname;
17+ rev = "a7eb4bb2151c00cc080613a770d37560f62a285c";
18+ sha256 = "sha256-Y96OFpBNrD3vrKoEZ4KdJuI1Q4RmYANsu7H3ZzfaA6g=";
19+ };
20+
21+ postPatch = ''
22+ patchShebangs scripts
23+ '';
24+
25+ sourceRoot = "source/src";
26+
27+ nativeBuildInputs = [ bison cmake flex perl ];
28+
29+ installPhase = ''
30+ runHook preInstall
31+
32+ install -Dm555 -t $out/bin ast/astgen elkhound/elkhound
33+ for d in ast elkhound smbase; do
34+ install -Dm444 -t $out/lib $d/*.a
35+ install -Dm444 -t $out/include/$d $src/src/$d/*.h
36+ done
37+ install -Dm444 -t $out/share/doc/${pname} $src/src/elkhound/*.txt
38+
39+ runHook postInstall
40+ '';
41+
42+ meta = with lib; {
43+ description = "A parser generator which emits GLR parsers, either in OCaml or C++";
44+ homepage = "https://scottmcpeak.com/elkhound/";
45+ license = licenses.bsd3;
46+ maintainers = with maintainers; [ peterhoeg ];
47+ # possibly works on Darwin
48+ platforms = platforms.linux;
49+ };
50+}