summary refs log tree commit diff
path: root/pkgs/development/tools/parsing/ragel/default.nix
blob: cd1cb0efd123ba1b72df738ac39f2ab4f794719f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ stdenv, fetchurl, transfig, tex, ghostscript, colm
, build-manual ? false
}:

let
  generic = { version, sha256, license }:
    stdenv.mkDerivation rec {
      name = "ragel-${version}";

      src = fetchurl {
        url = "http://www.colm.net/files/ragel/${name}.tar.gz";
        inherit sha256;
      };

      buildInputs = stdenv.lib.optional build-manual [ transfig ghostscript tex ];

      preConfigure = stdenv.lib.optional build-manual ''
        sed -i "s/build_manual=no/build_manual=yes/g" DIST
      '';

      configureFlags = [ "--with-colm=${colm}" ];

      NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isGNU "-std=gnu++98";

      doCheck = true;

      meta = with stdenv.lib; {
        homepage = https://www.colm.net/open-source/ragel/;
        description = "State machine compiler";
        inherit license;
        platforms = platforms.unix;
        maintainers = with maintainers; [ pSub ];
      };
    };

in

{
  ragelStable = generic {
    version = "6.10";
    sha256 = "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az";
    license = stdenv.lib.licenses.gpl2;
  };

  ragelDev = generic {
    version = "7.0.0.11";
    sha256 = "0h2k9bfz9i7x9mvr9rbsrzz8fk17756zwwrkf3fppvm9ivzwdfh8";
    license = stdenv.lib.licenses.mit;
  };
}