2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, camlp4 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "ulex";
|
|
|
|
param =
|
2021-01-15 22:18:51 +00:00
|
|
|
if lib.versionAtLeast ocaml.version "4.02" then {
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "1.2";
|
|
|
|
sha256 = "08yf2x9a52l2y4savjqfjd2xy4pjd1rpla2ylrr9qrz1drpfw4ic";
|
|
|
|
} else {
|
|
|
|
version = "1.1";
|
|
|
|
sha256 = "0cmscxcmcxhlshh4jd0lzw5ffzns12x3bj7h27smbc8waxkwffhl";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
inherit (param) version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "whitequark";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
inherit (param) sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ];
|
2022-03-30 09:31:56 +00:00
|
|
|
propagatedBuildInputs = [ camlp4 ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildFlags = [ "all" "all.opt" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "A lexer generator for Unicode and OCaml";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.roconnor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|