1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 bobcat,
6 icmake,
7 yodl,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "flexc++";
12 version = "2.05.00";
13
14 src = fetchFromGitHub {
15 sha256 = "0s25d9jsfsqvm34rwf48cxwz23aq1zja3cqlzfz3z33p29wwazwz";
16 rev = version;
17 repo = "flexcpp";
18 owner = "fbb-git";
19 };
20
21 setSourceRoot = ''
22 sourceRoot=$(echo */flexc++)
23 '';
24
25 buildInputs = [ bobcat ];
26 nativeBuildInputs = [
27 icmake
28 yodl
29 ];
30
31 postPatch = ''
32 substituteInPlace INSTALL.im --replace /usr $out
33 patchShebangs .
34 '';
35
36 buildPhase = ''
37 ./build man
38 ./build manual
39 ./build program
40 '';
41
42 installPhase = ''
43 ./build install x
44 '';
45
46 meta = with lib; {
47 description = "C++ tool for generating lexical scanners";
48 mainProgram = "flexc++";
49 longDescription = ''
50 Flexc++ was designed after `flex'. Flexc++ offers a cleaner class design
51 and requires simpler specification files than offered by flex's C++
52 option.
53 '';
54 homepage = "https://fbb-git.github.io/flexcpp/";
55 license = licenses.gpl3;
56 platforms = platforms.linux;
57 };
58}