[ocaml-lwt] Add lwt-fix-ocaml-camlp4-19.patch

Scott Tsai scottt at fedoraproject.org
Sun Aug 17 20:03:44 UTC 2014


commit cc9d336393072403f55a23c99d6dc8fe4f44af0d
Author: Scott Tsai <scottt.tw at gmail.com>
Date:   Mon Aug 18 04:03:24 2014 +0800

    Add lwt-fix-ocaml-camlp4-19.patch

 lwt-fix-ocaml-camlp4-19.patch |   38 ++++++++++++++++++++++++++++++++++++++
 ocaml-lwt.spec                |    8 +++++++-
 2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/lwt-fix-ocaml-camlp4-19.patch b/lwt-fix-ocaml-camlp4-19.patch
new file mode 100644
index 0000000..8cd873a
--- /dev/null
+++ b/lwt-fix-ocaml-camlp4-19.patch
@@ -0,0 +1,38 @@
+From d3226b70359cb8618d95d1105c908aa591f1b144 Mon Sep 17 00:00:00 2001
+From: Jeremie Dimino <jdimino at janestreet.com>
+Date: Thu, 17 Apr 2014 10:55:43 +0100
+Subject: [PATCH] Fix ocaml/camlp4#19
+
+---
+ syntax/pa_optcomp.ml | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/syntax/pa_optcomp.ml b/syntax/pa_optcomp.ml
+index 583248f..4b112d2 100644
+--- a/syntax/pa_optcomp.ml
++++ b/syntax/pa_optcomp.ml
+@@ -334,13 +334,19 @@ let parse_ident stream =
+ let parse_expr stream =
+   (* Lists of opened brackets *)
+   let opened_brackets = ref [] in
++  let eoi = ref None in
+ 
+   (* Return the next token of [stream] until all opened parentheses
+      have been closed and a newline is reached *)
+   let rec next_token _ =
+-    Some(match Stream.next stream, !opened_brackets with
++    match !eoi with
++    | Some _ as x -> x
++    | None ->
++        Some(match Stream.next stream, !opened_brackets with
+            | (NEWLINE, loc), [] ->
+-               EOI, loc
++               let x = EOI, loc in
++               eoi := Some x;
++               x
+ 
+            | (KEYWORD("(" | "[" | "{" as b), _) as x, l ->
+                opened_brackets := b :: l;
+-- 
+1.9.3
+
diff --git a/ocaml-lwt.spec b/ocaml-lwt.spec
index 8b0738e..7523f34 100644
--- a/ocaml-lwt.spec
+++ b/ocaml-lwt.spec
@@ -2,7 +2,7 @@
 
 Name:           ocaml-lwt
 Version:        2.4.3
-Release:        11%{?dist}
+Release:        12%{?dist}
 Summary:        OCaml lightweight thread library
 
 # The openssl linking exception is granted.
@@ -12,6 +12,8 @@ Source0:        http://ocsigen.org/download/lwt-%{version}.tar.gz
 
 # Adapt to changes in OCaml 4.01.0
 Patch1:         lwt-2.4.3-ocaml41.patch
+# https://github.com/ocaml/camlp4/issues/19
+Patch2:         lwt-fix-ocaml-camlp4-19.patch
 
 BuildRequires:  ocaml >= 3.10.0
 BuildRequires:  ocaml-findlib-devel
@@ -43,6 +45,7 @@ developing applications that use %{name}.
 %setup -q -n lwt-%{version}
 
 %patch1
+%patch2 -p1
 
 mv README README.old
 iconv -f iso-8859-1 -t utf-8 < README.old > README
@@ -96,6 +99,9 @@ OCAMLPATH=$RPM_BUILD_ROOT%{_libdir}/ocaml ocamlfind query lwt.react
 
 
 %changelog
+* Mon Aug 18 2014 Scott Tsai <scottt.tw at gmail.com> - 2.4.3-12
+- Add lwt-fix-ocaml-camlp4-19.patch to fix OCaml 4.02+ build failure
+
 * Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.4.3-11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 


More information about the scm-commits mailing list