Add fixes for OCaml 4.11, sent upstream today.

This commit is contained in:
Richard W.M. Jones 2020-04-22 17:32:29 +01:00
parent 74b23021b7
commit 081c5ff2f0
2 changed files with 58 additions and 0 deletions

View File

@ -14,6 +14,9 @@ License: MIT
URL: https://github.com/ocaml-ppx/%{upname}
Source0: %{url}/archive/v%{version}/%{upname}-%{version}.tar.gz
# Fixes for OCaml 4.11, sent upstream 2020-04-22.
Patch1: ppx_deriving-4.4.1-ocaml-4.11.patch
BuildRequires: ocaml >= 4.02.2
BuildRequires: ocaml-cppo
BuildRequires: ocaml-dune >= 1.6.3

View File

@ -0,0 +1,55 @@
diff -ur ppx_deriving-4.4.1.old/src/api/dune ppx_deriving-4.4.1.new/src/api/dune
--- ppx_deriving-4.4.1.old/src/api/dune 2020-02-19 21:28:35.000000000 +0000
+++ ppx_deriving-4.4.1.new/src/api/dune 2020-04-22 17:29:58.776369650 +0100
@@ -10,7 +10,8 @@
ppx_tools
result
ppx_derivers
- ocaml-migrate-parsetree))
+ ocaml-migrate-parsetree)
+ (flags (:standard -w "-3")))
(rule
(deps ppx_deriving.cppo.ml)
diff -ur ppx_deriving-4.4.1.old/src/api/ppx_deriving.cppo.ml ppx_deriving-4.4.1.new/src/api/ppx_deriving.cppo.ml
--- ppx_deriving-4.4.1.old/src/api/ppx_deriving.cppo.ml 2020-02-19 21:28:35.000000000 +0000
+++ ppx_deriving-4.4.1.new/src/api/ppx_deriving.cppo.ml 2020-04-22 17:30:29.933780004 +0100
@@ -165,7 +165,7 @@
let string expr =
match expr with
- | { pexp_desc = Pexp_constant (Pconst_string (n, None)) } -> Ok n
+ | { pexp_desc = Pexp_constant (Pconst_string (n, _, None)) } -> Ok n
| _ -> Error "string"
let char = function
diff -ur ppx_deriving-4.4.1.old/src/ppx_deriving_main.cppo.ml ppx_deriving-4.4.1.new/src/ppx_deriving_main.cppo.ml
--- ppx_deriving-4.4.1.old/src/ppx_deriving_main.cppo.ml 2020-02-19 21:28:35.000000000 +0000
+++ ppx_deriving-4.4.1.new/src/ppx_deriving_main.cppo.ml 2020-04-22 17:31:11.109322304 +0100
@@ -43,7 +43,7 @@
| Some { pexp_desc = Pexp_tuple exprs } ->
exprs |> List.map (fun expr ->
match expr with
- | { pexp_desc = Pexp_constant (Pconst_string (file, None)) } -> file
+ | { pexp_desc = Pexp_constant (Pconst_string (file, _, None)) } -> file
| _ -> assert false)
| Some _ -> assert false
| None -> []
@@ -54,7 +54,7 @@
List.iter load_plugin plugins;
let loaded = loaded @ plugins in
Ast_mapper.set_cookie "ppx_deriving"
- (Exp.tuple (List.map (fun file -> Exp.constant (Pconst_string (file, None))) loaded))
+ (Exp.tuple (List.map (fun file -> Exp.constant (Pconst_string (file, Location.none, None))) loaded))
let mapper argv =
get_plugins () |> List.iter load_plugin;
@@ -66,7 +66,7 @@
elems |>
List.map (fun elem ->
match elem with
- | { pexp_desc = Pexp_constant (Pconst_string (file, None))} -> file
+ | { pexp_desc = Pexp_constant (Pconst_string (file, _, None))} -> file
| _ -> assert false) |>
add_plugins;
mapper.Ast_mapper.structure mapper rest