2017-11-29 19:58:56 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, camlp4 }:
|
2010-12-31 18:48:55 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "ulex";
|
2017-11-29 19:58:56 +01:00
|
|
|
param =
|
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
|
|
|
|
version = "1.2";
|
|
|
|
sha256 = "08yf2x9a52l2y4savjqfjd2xy4pjd1rpla2ylrr9qrz1drpfw4ic";
|
|
|
|
} else {
|
|
|
|
version = "1.1";
|
|
|
|
sha256 = "0cmscxcmcxhlshh4jd0lzw5ffzns12x3bj7h27smbc8waxkwffhl";
|
|
|
|
};
|
2010-12-31 18:48:55 +01:00
|
|
|
in
|
|
|
|
|
2016-10-05 09:32:30 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2017-11-29 19:58:56 +01:00
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
inherit (param) version;
|
2010-12-31 18:48:55 +01:00
|
|
|
|
2017-11-29 19:58:56 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "whitequark";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
inherit (param) sha256;
|
2010-12-31 18:48:55 +01:00
|
|
|
};
|
|
|
|
|
2011-11-28 00:58:46 +01:00
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2016-10-08 08:44:25 +02:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
2015-06-12 00:03:00 +02:00
|
|
|
propagatedBuildInputs = [ camlp4 ];
|
2010-12-31 18:48:55 +01:00
|
|
|
|
|
|
|
buildFlags = "all all.opt";
|
|
|
|
|
|
|
|
meta = {
|
2017-11-29 19:58:56 +01:00
|
|
|
inherit (src.meta) homepage;
|
2015-04-30 17:05:14 +02:00
|
|
|
description = "A lexer generator for Unicode and OCaml";
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2010-12-31 18:48:55 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.roconnor ];
|
|
|
|
};
|
|
|
|
}
|