3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/ocaml/ocamlmod/default.nix

40 lines
1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
let
# ounit is only available for OCaml >= 4.04
doCheck = lib.versionAtLeast ocaml.version "4.04";
in
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
pname = "ocamlmod";
2017-10-13 21:10:51 +01:00
version = "0.0.9";
src = fetchurl {
2017-10-13 21:10:51 +01:00
url = "https://forge.ocamlcore.org/frs/download.php/1702/ocamlmod-0.0.9.tar.gz";
sha256 = "0cgp9qqrq7ayyhddrmqmq1affvfqcn722qiakjq4dkywvp67h4aa";
};
buildInputs = [ ocaml findlib ocamlbuild ];
configurePhase = "ocaml setup.ml -configure --prefix $out"
+ lib.optionalString doCheck " --enable-tests";
buildPhase = "ocaml setup.ml -build";
installPhase = "ocaml setup.ml -install";
inherit doCheck;
checkInputs = [ ounit ];
2017-10-13 21:10:51 +01:00
checkPhase = "ocaml setup.ml -test";
dontStrip = true;
meta = {
homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
description = "Generate OCaml modules from source files";
platforms = ocaml.meta.platforms or [];
maintainers = with lib.maintainers; [
maggesi
];
};
}