lol
1{ lib, stdenv, fetchurl, ocaml, findlib, darwin, ocaml-lsp, dune-release }:
2
3if lib.versionOlder ocaml.version "4.08"
4then throw "dune 3 is not available for OCaml ${ocaml.version}"
5else
6
7stdenv.mkDerivation rec {
8 pname = "dune";
9 version = "3.15.2";
10
11 src = fetchurl {
12 url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz";
13 hash = "sha256-+VmYBULKhZCbPz+Om+ZcK4o3XzpOO9g8etegfy4HeTM=";
14 };
15
16 nativeBuildInputs = [ ocaml findlib ];
17
18 buildInputs = lib.optionals stdenv.isDarwin [
19 darwin.apple_sdk.frameworks.CoreServices
20 ];
21
22 strictDeps = true;
23
24 buildFlags = [ "release" ];
25
26 dontAddPrefix = true;
27 dontAddStaticConfigureFlags = true;
28 configurePlatforms = [];
29
30 installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
31
32 passthru.tests = {
33 inherit ocaml-lsp dune-release;
34 };
35
36 meta = {
37 homepage = "https://dune.build/";
38 description = "A composable build system";
39 mainProgram = "dune";
40 changelog = "https://github.com/ocaml/dune/raw/${version}/CHANGES.md";
41 maintainers = [ lib.maintainers.vbgl ];
42 license = lib.licenses.mit;
43 inherit (ocaml.meta) platforms;
44 };
45}