2021-01-23 04:26:19 -08:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
|
2014-01-30 21:44:42 -08:00
|
|
|
|
2021-02-20 04:09:34 -08:00
|
|
|
let
|
|
|
|
# ounit is only available for OCaml >= 4.04
|
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.04";
|
|
|
|
in
|
|
|
|
|
2019-08-13 14:52:01 -07:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "ocamlmod";
|
2017-10-13 13:10:51 -07:00
|
|
|
version = "0.0.9";
|
2014-01-30 21:44:42 -08:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-10-13 13:10:51 -07:00
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/1702/ocamlmod-0.0.9.tar.gz";
|
|
|
|
sha256 = "0cgp9qqrq7ayyhddrmqmq1affvfqcn722qiakjq4dkywvp67h4aa";
|
2014-01-30 21:44:42 -08:00
|
|
|
};
|
|
|
|
|
2021-02-20 04:09:34 -08:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
2014-01-30 21:44:42 -08:00
|
|
|
|
2021-02-20 04:09:34 -08:00
|
|
|
configurePhase = "ocaml setup.ml -configure --prefix $out"
|
|
|
|
+ lib.optionalString doCheck " --enable-tests";
|
2014-01-30 21:44:42 -08:00
|
|
|
buildPhase = "ocaml setup.ml -build";
|
|
|
|
installPhase = "ocaml setup.ml -install";
|
|
|
|
|
2021-02-20 04:09:34 -08:00
|
|
|
inherit doCheck;
|
|
|
|
checkInputs = [ ounit ];
|
2017-10-13 13:10:51 -07:00
|
|
|
|
|
|
|
checkPhase = "ocaml setup.ml -test";
|
|
|
|
|
2017-02-26 12:18:02 -08:00
|
|
|
dontStrip = true;
|
|
|
|
|
2014-01-30 21:44:42 -08:00
|
|
|
meta = {
|
2020-11-26 16:29:13 -08:00
|
|
|
homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
|
2014-01-30 21:44:42 -08:00
|
|
|
description = "Generate OCaml modules from source files";
|
2015-12-24 09:49:07 -08:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2021-01-23 04:26:19 -08:00
|
|
|
maintainers = with lib.maintainers; [
|
2019-10-07 07:44:58 -07:00
|
|
|
maggesi
|
2014-01-30 21:44:42 -08:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|