diff options
Diffstat (limited to 'pkgs/development/tools/ocaml/ocamlbuild/default.nix')
-rw-r--r-- | pkgs/development/tools/ocaml/ocamlbuild/default.nix | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/development/tools/ocaml/ocamlbuild/default.nix b/pkgs/development/tools/ocaml/ocamlbuild/default.nix index 98a48c27742ca..6696a99977a09 100644 --- a/pkgs/development/tools/ocaml/ocamlbuild/default.nix +++ b/pkgs/development/tools/ocaml/ocamlbuild/default.nix @@ -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.14.3"; + inherit version; src = fetchFromGitHub { owner = "ocaml"; repo = "ocamlbuild"; - rev = version; - sha256 = "sha256-dfcNu4ugOYu/M0rRQla7lXum/g1UzncdLGmpPYo0QUM="; + 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; }; -} +}) |