about summary refs log tree commit diff
path: root/pkgs/development/tools/ocaml/dune/1.nix
blob: d6d3863afab8fceb265e2bb2640b6130c4fd777c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, lib, fetchurl, ocaml, findlib, ncurses }:

if lib.versionOlder ocaml.version "4.02"
|| lib.versionAtLeast ocaml.version "4.12"
then throw "dune 1 is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation rec {
  pname = "dune";
  version = "1.11.4";
  src = fetchurl {
    url = "https://github.com/ocaml/dune/releases/download/${version}/dune-build-info-${version}.tbz";
    sha256 = "1rkc8lqw30ifjaz8d81la6i8j05ffd0whpxqsbg6dci16945zjvp";
  };

  nativeBuildInputs = [ ocaml findlib ];
  buildInputs = [ ncurses ];
  strictDeps = true;

  buildFlags = [ "release" ];
  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "LIBDIR=$(OCAMLFIND_DESTDIR)"
  ];

  dontAddPrefix = true;
  dontAddStaticConfigureFlags = true;
  configurePlatforms = [];

  meta = with lib; {
    homepage = "https://dune.build/";
    description = "A composable build system";
    maintainers = [ maintainers.vbgl maintainers.marsam ];
    license = licenses.mit;
    inherit (ocaml.meta) platforms;
  };
}