1 { lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, ncurses, cmdliner_1_0, re }:
3 lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
4 "ocp-build is not available for OCaml ${ocaml.version}"
6 stdenv.mkDerivation rec {
7 pname = "ocaml${ocaml.version}-ocp-build";
10 src = fetchFromGitHub {
14 sha256 = "1641xzik98c7xnjwxpacijd6d9jzx340fmdn6i372z8h554jjlg9";
18 # Fix compilation with OCaml 4.12
20 url = "https://github.com/OCamlPro/ocp-build/commit/104e4656ca6dba9edb03b62539c9f1e10abcaae8.patch";
21 sha256 = "0sbyi4acig9q8x1ky4hckfg5pm2nad6zasi51ravaf1spgl148c2";
27 nativeBuildInputs = [ ocaml findlib ];
28 buildInputs = [ cmdliner_1_0 re ];
29 propagatedBuildInputs = [ ncurses ];
30 preInstall = "mkdir -p $out/bin";
33 description = "A build tool for OCaml";
35 ocp-build is a build system for OCaml application, based on simple
36 descriptions of packages. ocp-build combines the descriptions of
37 packages, and optimize the parallel compilation of files depending on
38 the number of cores and the automatically-inferred dependencies
41 homepage = "https://www.typerex.org/ocp-build.html";
42 license = licenses.gpl3;
43 maintainers = [ maintainers.jirkamarsik ];
44 mainProgram = "ocp-build";
45 inherit (ocaml.meta) platforms;