2022-02-20 05:27:41 +00:00
|
|
|
{ lib, stdenv, fetchurl, fig2dev, tex, ghostscript, colm
|
2020-04-24 23:36:52 +00:00
|
|
|
, build-manual ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
generic = { version, sha256, license }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ragel";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.colm.net/files/ragel/${pname}-${version}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
buildInputs = lib.optional build-manual [ fig2dev ghostscript tex ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
preConfigure = lib.optionalString build-manual ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i "s/build_manual=no/build_manual=yes/g" DIST
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [ "--with-colm=${colm}" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=gnu++98";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ragelDev = generic {
|
|
|
|
version = "7.0.0.12";
|
|
|
|
sha256 = "0x3si355lv6q051lgpg8bpclpiq5brpri5lv3p8kk2qhzfbyz69r";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|