diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix index adde3094e27f..3e571dd791ad 100644 --- a/pkgs/development/ocaml-modules/cohttp/default.nix +++ b/pkgs/development/ocaml-modules/cohttp/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchFromGitHub, ocaml, findlib, jbuilder -, ppx_fields_conv, ppx_sexp_conv +, ppx_fields_conv, ppx_sexp_conv, ppx_deriving , base64, fieldslib, jsonm, logs, re, stringext, uri }: @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ ocaml findlib jbuilder jsonm ppx_fields_conv ppx_sexp_conv ]; - propagatedBuildInputs = [ base64 fieldslib re stringext uri ]; + propagatedBuildInputs = [ ppx_deriving base64 fieldslib re stringext uri ]; buildPhase = "jbuilder build -p cohttp"; diff --git a/pkgs/development/ocaml-modules/ppx_deriving/default.nix b/pkgs/development/ocaml-modules/ppx_deriving/default.nix index 57a423a80373..1b209e523699 100644 --- a/pkgs/development/ocaml-modules/ppx_deriving/default.nix +++ b/pkgs/development/ocaml-modules/ppx_deriving/default.nix @@ -1,22 +1,34 @@ { stdenv, buildOcaml, ocaml, fetchzip -, cppo, ppx_tools, result, ounit +, cppo, ppx_tools, ppx_derivers, result, ounit, ocaml-migrate-parsetree }: +let param = + if ocaml.version == "4.03.0" + then { + version = "4.1"; + sha256 = "0cy9p8d8cbcxvqyyv8fz2z9ypi121zrgaamdlp4ld9f3jnwz7my9"; + extraPropagatedBuildInputs = []; + } else { + version = "4.2"; + sha256 = "0scsg45wp6xdqj648fz155r4yngyl2xcd3hdszfzqwdpbax33914"; + extraPropagatedBuildInputs = [ ocaml-migrate-parsetree ppx_derivers ]; +}; in + buildOcaml rec { name = "ppx_deriving"; - version = "4.1"; + inherit (param) version; minimumSupportedOcamlVersion = "4.02"; src = fetchzip { url = "https://github.com/whitequark/${name}/archive/v${version}.tar.gz"; - sha256 = "0cy9p8d8cbcxvqyyv8fz2z9ypi121zrgaamdlp4ld9f3jnwz7my9"; + inherit (param) sha256; }; hasSharedObjects = true; buildInputs = [ cppo ounit ]; - propagatedBuildInputs = + propagatedBuildInputs = param.extraPropagatedBuildInputs ++ [ ppx_tools result ]; installPhase = "OCAMLPATH=$OCAMLPATH:`ocamlfind printconf destdir` make install"; @@ -25,6 +37,5 @@ buildOcaml rec { description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02."; maintainers = [ maintainers.maurer ]; license = licenses.mit; - broken = versionAtLeast ocaml.version "4.05"; }; } diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/default.nix b/pkgs/development/tools/ocaml/js_of_ocaml/default.nix index 23556a0edbde..f88811855a2e 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/default.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/default.nix @@ -34,5 +34,6 @@ stdenv.mkDerivation { maintainers = [ maintainers.gal_bolle ]; + broken = versionAtLeast ocaml.version "4.05"; }; }