2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, gen, ppx_tools_versioned, ocaml-migrate-parsetree }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.02"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "sedlex is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "ocaml${ocaml.version}-sedlex";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "1.99.5";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml-community";
|
|
|
|
repo = "sedlex";
|
|
|
|
rev = "fb84e1766fc4b29e79ec40029ffee5cdb37b392f";
|
|
|
|
sha256 = "sha256-VhzlDTYBFXgKWT69PqZYLuHkiaDwzhmyX2XfaqzHFl4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ gen ocaml-migrate-parsetree ppx_tools_versioned ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildFlags = [ "all" "opt" ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/ocaml-community/sedlex";
|
|
|
|
description = "An OCaml lexer generator for Unicode";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|