2020-09-25 04:45:31 +00:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, fetchpatch }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
if stdenv.lib.versionOlder ocaml.version "4.08"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "dune is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dune";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "2.7.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz";
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "0pcjf209gynjwipnpplaqyvyivnawqiwhvqnivhkybisicpqyln3";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ];
|
|
|
|
|
|
|
|
buildFlags = "release";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
patches = [
|
|
|
|
# Fix setup.ml configure path. Remove with the next release.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/ocaml/dune/commit/8a3d7f2f2015b71384caa07226d1a89dba9d6c25.patch";
|
|
|
|
sha256 = "0dw4q10030h9xcdlxw2vp7qm0hd2qpkb98rir5d55m9vn65w8j28";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://dune.build/";
|
|
|
|
description = "A composable build system";
|
|
|
|
changelog = "https://github.com/ocaml/dune/releases/tag/${version}";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.vbgl stdenv.lib.maintainers.marsam ];
|
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|