Commit ac9ee278 authored by Vincent Laporte's avatar Vincent Laporte Committed by Vincent Laporte
Browse files

ocamlPackages.ocamlbuild: 0.14.3 for OCaml < 4.07

parent 8560d444
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
{ 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;
  };
}
})