Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fig2dev,
6 texliveSmall,
7 ghostscript,
8 colm,
9 build-manual ? false,
10}:
11
12let
13 generic =
14 {
15 version,
16 sha256,
17 broken ? false,
18 license,
19 }:
20 stdenv.mkDerivation rec {
21 pname = "ragel";
22 inherit version;
23
24 src = fetchurl {
25 url = "https://www.colm.net/files/ragel/${pname}-${version}.tar.gz";
26 inherit sha256;
27 };
28
29 buildInputs = lib.optionals build-manual [
30 fig2dev
31 ghostscript
32 texliveSmall
33 ];
34
35 preConfigure = lib.optionalString build-manual ''
36 sed -i "s/build_manual=no/build_manual=yes/g" DIST
37 '';
38
39 configureFlags = [ "--with-colm=${colm}" ];
40
41 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=gnu++98";
42
43 doCheck = true;
44
45 enableParallelBuilding = true;
46
47 meta = with lib; {
48 homepage = "https://www.colm.net/open-source/ragel/";
49 description = "State machine compiler";
50 mainProgram = "ragel";
51 inherit broken license;
52 platforms = platforms.unix;
53 maintainers = with maintainers; [ pSub ];
54 };
55 };
56
57in
58
59{
60 ragelStable = generic {
61 version = "6.10";
62 sha256 = "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az";
63 license = lib.licenses.gpl2;
64 };
65
66 ragelDev = generic {
67 version = "7.0.0.12";
68 sha256 = "0x3si355lv6q051lgpg8bpclpiq5brpri5lv3p8kk2qhzfbyz69r";
69 license = lib.licenses.mit;
70 broken = stdenv.hostPlatform.isDarwin;
71 };
72}