1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchFromGitLab,
6 yodl,
7 icmake,
8 flexcpp,
9 bobcat,
10}:
11stdenv.mkDerivation rec {
12 pname = "bisonc++";
13 version = "6.04.00";
14
15 src = fetchFromGitLab {
16 domain = "gitlab.com";
17 owner = "fbb-git";
18 repo = "bisoncpp";
19 rev = "6.04.00";
20 hash = "sha256:0aa9bij4g08ilsk6cgrbgi03vyhqr9fn6j2164sjin93m63212wl";
21 };
22
23 buildInputs = [ bobcat ];
24
25 nativeBuildInputs = [
26 yodl
27 icmake
28 flexcpp
29 ];
30
31 setSourceRoot = ''
32 sourceRoot="$(echo */bisonc++)"
33 '';
34
35 gpl = fetchurl {
36 url = "https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt";
37 sha256 = "sha256:0hq6i0dm4420825fdm0lnnppbil6z67ls67n5kgjcd912dszjxw1";
38 };
39
40 postPatch = ''
41 substituteInPlace INSTALL.im --replace /usr $out
42 patchShebangs .
43 for file in $(find documentation -type f); do
44 substituteInPlace "$file" --replace /usr/share/common-licenses/GPL ${gpl}
45 substituteInPlace "$file" --replace /usr $out
46 done
47 '';
48
49 buildPhase = ''
50 ./build program
51 ./build man
52 ./build manual
53 '';
54
55 installPhase = ''
56 ./build install x
57 '';
58
59 meta = with lib; {
60 description = "Parser generator like bison, but it generates C++ code";
61 mainProgram = "bisonc++";
62 license = licenses.gpl2Plus;
63 maintainers = with maintainers; [ raskin ];
64 platforms = platforms.linux;
65 homepage = "https://fbb-git.gitlab.io/bisoncpp/";
66 };
67}