nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 ocaml,
7 findlib,
8 ncurses,
9 cmdliner_1_0,
10 re,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "ocaml${ocaml.version}-ocp-build";
15 version = "1.99.21";
16
17 src = fetchFromGitHub {
18 owner = "OCamlPro";
19 repo = "ocp-build";
20 rev = "v${version}";
21 sha256 = "1641xzik98c7xnjwxpacijd6d9jzx340fmdn6i372z8h554jjlg9";
22 };
23
24 patches = [
25 # Fix compilation with OCaml 4.12
26 (fetchpatch {
27 url = "https://github.com/OCamlPro/ocp-build/commit/104e4656ca6dba9edb03b62539c9f1e10abcaae8.patch";
28 sha256 = "0sbyi4acig9q8x1ky4hckfg5pm2nad6zasi51ravaf1spgl148c2";
29 })
30 ];
31
32 strictDeps = true;
33
34 nativeBuildInputs = [
35 ocaml
36 findlib
37 ];
38 buildInputs = [
39 cmdliner_1_0
40 re
41 ];
42 propagatedBuildInputs = [ ncurses ];
43 preInstall = "mkdir -p $out/bin";
44
45 meta = {
46 description = "Build tool for OCaml";
47 longDescription = ''
48 ocp-build is a build system for OCaml application, based on simple
49 descriptions of packages. ocp-build combines the descriptions of
50 packages, and optimize the parallel compilation of files depending on
51 the number of cores and the automatically-inferred dependencies
52 between source files.
53 '';
54 homepage = "https://www.typerex.org/ocp-build.html";
55 license = lib.licenses.gpl3;
56 maintainers = [ lib.maintainers.jirkamarsik ];
57 mainProgram = "ocp-build";
58 broken = lib.versionAtLeast ocaml.version "5.0";
59 inherit (ocaml.meta) platforms;
60 };
61}