diff --git a/ocaml-411.patch b/ocaml-411.patch new file mode 100644 index 0000000..575560e --- /dev/null +++ b/ocaml-411.patch @@ -0,0 +1,11 @@ +--- ppx_deriving_yojson-3.5.2.old/src/ppx_deriving_yojson.cppo.ml 2020-02-20 21:01:12.000000000 +0000 ++++ ppx_deriving_yojson-3.5.new/src/ppx_deriving_yojson.cppo.ml 2020-04-22 18:15:35.242395194 +0100 +@@ -385,7 +385,7 @@ + let ty = Typ.poly poly_vars (polymorphize_ser [%type: [%t typ] -> Yojson.Safe.t]) in + let default_fun = + let type_path = String.concat "." (path @ [type_decl.ptype_name.txt]) in +- let e_type_path = Exp.constant (Pconst_string (type_path, None)) in ++ let e_type_path = Exp.constant (Pconst_string (type_path, Location.none, None)) in + [%expr fun _ -> + invalid_arg ("to_yojson: Maybe a [@@deriving yojson] is missing when extending the type "^ + [%e e_type_path])] diff --git a/ocaml-ppx-deriving-yojson.spec b/ocaml-ppx-deriving-yojson.spec index ddf19e1..1ad89e7 100644 --- a/ocaml-ppx-deriving-yojson.spec +++ b/ocaml-ppx-deriving-yojson.spec @@ -14,6 +14,9 @@ License: MIT URL: https://github.com/ocaml-ppx/%{upname} Source0: %{url}/archive/v%{version}/%{upname}-%{version}.tar.gz +# Fix for OCaml 4.11. Sent upstream 2020-04-22. +Patch1: ocaml-411.patch + BuildRequires: ocaml >= 4.04.0 BuildRequires: ocaml-biniou-devel BuildRequires: ocaml-cppo