ocamlPackages.ocamlbuild: 0.14.3 for OCaml < 4.07

This commit is contained in:
Vincent Laporte 2024-07-13 11:14:23 +02:00 committed by Vincent Laporte
parent 8560d44477
commit ac9ee278f5

View File

@ -1,13 +1,19 @@
{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
stdenv.mkDerivation rec {
{ lib, stdenv, fetchFromGitHub, ocaml, findlib
, version ? if lib.versionAtLeast ocaml.version "4.07" then "0.15.0" else "0.14.3"
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ocaml${ocaml.version}-ocamlbuild";
version = "0.15.0";
inherit version;
src = fetchFromGitHub {
owner = "ocaml";
repo = "ocamlbuild";
rev = version;
sha256 = "sha256-j4Nd5flyvshIo+XFtBS0fKqdd9YcxYsjE7ty6rZLDRc=";
rev = finalAttrs.version;
hash = {
"0.14.3" = "sha256-dfcNu4ugOYu/M0rRQla7lXum/g1UzncdLGmpPYo0QUM=";
"0.15.0" = "sha256-j4Nd5flyvshIo+XFtBS0fKqdd9YcxYsjE7ty6rZLDRc=";
}."${finalAttrs.version}";
};
createFindlibDestdir = true;
@ -38,4 +44,4 @@ stdenv.mkDerivation rec {
mainProgram = "ocamlbuild";
inherit (ocaml.meta) platforms;
};
}
})