2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
let
|
|
|
|
# ounit is only available for OCaml >= 4.04
|
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.04";
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "ocamlmod";
|
|
|
|
version = "0.0.9";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/1702/ocamlmod-0.0.9.tar.gz";
|
|
|
|
sha256 = "0cgp9qqrq7ayyhddrmqmq1affvfqcn722qiakjq4dkywvp67h4aa";
|
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = !doCheck;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
configurePhase = "ocaml setup.ml -configure --prefix $out"
|
|
|
|
+ lib.optionalString doCheck " --enable-tests";
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPhase = "ocaml setup.ml -build";
|
|
|
|
installPhase = "ocaml setup.ml -install";
|
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
inherit doCheck;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ ounit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = "ocaml setup.ml -test";
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-11-30 08:33:03 +00:00
|
|
|
homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Generate OCaml modules from source files";
|
|
|
|
platforms = ocaml.meta.platforms or [];
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
2020-04-24 23:36:52 +00:00
|
|
|
maggesi
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|