2024-02-29 20:09:43 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, darwin, ocaml-lsp, dune-release }:
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
if lib.versionOlder ocaml.version "4.08"
|
|
|
|
then throw "dune 3 is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dune";
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "3.16.0";
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-06-26 10:26:21 +00:00
|
|
|
url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz";
|
2024-06-24 18:47:55 +00:00
|
|
|
hash = "sha256-VIHd55GMoxIeAsNNdDOfc0sy1Yg++4wbgFZHHnT5vaY=";
|
2022-02-20 05:27:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ ocaml findlib ];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2023-03-08 16:32:21 +00:00
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
buildFlags = [ "release" ];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
passthru.tests = {
|
2024-02-29 20:09:43 +00:00
|
|
|
inherit ocaml-lsp dune-release;
|
2023-03-08 16:32:21 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://dune.build/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Composable build system";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "dune";
|
2022-02-20 05:27:41 +00:00
|
|
|
changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2022-02-20 05:27:41 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|