[ocaml-lwt] Make lwt actually build on OCaml 4.00.0.

Scott Tsai scottt at fedoraproject.org
Thu Jun 14 16:26:01 UTC 2012


commit a3e250122c810fea2dd74c42cc75b0ad12b689b4
Author: Scott Tsai <scottt.tw at gmail.com>
Date:   Fri Jun 15 00:17:39 2012 +0800

    Make lwt actually build on OCaml 4.00.0.

 lwt-2.3.2-ocaml-4.patch |   16 ++++++++++++++++
 oasis-common.patch      |   38 ++++++++++++++++++++++++++++++++++++++
 ocaml-lwt.spec          |   10 +++++++++-
 3 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/lwt-2.3.2-ocaml-4.patch b/lwt-2.3.2-ocaml-4.patch
index c0983ec..badfb65 100644
--- a/lwt-2.3.2-ocaml-4.patch
+++ b/lwt-2.3.2-ocaml-4.patch
@@ -20,3 +20,19 @@ diff -ur lwt-2.3.2.old/src/unix/lwt_unix.mli lwt-2.3.2/src/unix/lwt_unix.mli
  
  val openfile : string -> open_flag list -> file_perm -> file_descr Lwt.t
    (** Wrapper for [Unix.openfile]. *)
+
+ 
+diff -ur lwt-2.3.2.old/myocamlbuild.ml lwt-2.3.2/myocamlbuild.ml
+--- lwt-2.3.2.old/myocamlbuild.ml	2011-11-04 17:49:08.000000000 +0100
++++ lwt-2.3.2/myocamlbuild.ml	2012-05-25 15:17:21.000000000 +0200
+@@ -301,8 +301,8 @@
+           (* by using Before_options one let command line options have an higher priority *)
+           (* on the contrary using After_options will guarantee to have the higher priority *)
+           (* override default commands by ocamlfind ones *)
+-          Options.ocamlc     := ocamlfind & A"ocamlc";
+-          Options.ocamlopt   := ocamlfind & A"ocamlopt";
++          Options.ocamlc     := ocamlfind & S[A"ocamlc"; A"-I"; A"+compiler-libs"];
++          Options.ocamlopt   := ocamlfind & S[A"ocamlopt"; A"-I"; A"+compiler-libs"];
+           Options.ocamldep   := ocamlfind & A"ocamldep";
+           Options.ocamldoc   := ocamlfind & A"ocamldoc";
+           Options.ocamlmktop := ocamlfind & A"ocamlmktop"
diff --git a/oasis-common.patch b/oasis-common.patch
new file mode 100644
index 0000000..6b52350
--- /dev/null
+++ b/oasis-common.patch
@@ -0,0 +1,38 @@
+--- setup.ml	2011-03-22 17:00:48.000000000 +0100
++++ setup.ml	2011-12-22 21:41:25.000000000 +0100
+@@ -2662,10 +2662,14 @@
+         (ocamlc_config_map ())
+         0
+     in
+-    let nm_config =
++    let chop_version_suffix s =
++      try String.sub s 0 (String.index s '+')
++      with _ -> s
++    in
++    let nm_config, value_config =
+       match nm with 
+-        | "ocaml_version" -> "version"
+-        | _ -> nm
++        | "ocaml_version" -> "version", chop_version_suffix
++        | _ -> nm, (fun x -> x)
+     in
+       var_redefine
+         nm 
+@@ -2677,7 +2681,7 @@
+               let value = 
+                 SMap.find nm_config map
+               in
+-                value
++                value_config value
+             with Not_found ->
+               failwithf2
+                 (f_ "Cannot find field '%s' in '%s -config' output")
+@@ -3057,7 +3061,7 @@
+             begin
+               let acc = 
+                 try 
+-                  Scanf.bscanf scbuf "%S %S@\n" 
++                  Scanf.bscanf scbuf "%S %S\n" 
+                     (fun e d ->  
+                        let t = 
+                          e, d
diff --git a/ocaml-lwt.spec b/ocaml-lwt.spec
index cd2014a..d79243f 100644
--- a/ocaml-lwt.spec
+++ b/ocaml-lwt.spec
@@ -3,7 +3,7 @@
 
 Name:           ocaml-lwt
 Version:        2.3.2
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        OCaml lightweight thread library
 
 Group:          Development/Libraries
@@ -18,6 +18,7 @@ ExcludeArch:    sparc64 s390 s390x
 Patch0:         lwt-2.3.2-libev.patch
 
 Patch1:         lwt-2.3.2-ocaml-4.patch
+Patch2:         oasis-common.patch
 
 BuildRequires:  ocaml >= 3.10.0
 BuildRequires:  ocaml-findlib-devel
@@ -54,6 +55,7 @@ developing applications that use %{name}.
 
 %patch0 -p1
 %patch1 -p1
+%patch2 -p0
 
 mv README README.old
 iconv -f iso-8859-1 -t utf-8 < README.old > README
@@ -104,6 +106,12 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Thu Jun 14 2012 Scott Tsai <scottt.tw at gmail.com> - 2.3.2-5
+- Patch myocamlobuild.ml in lwt-2.3.2-ocaml-4.patch to
+  add compiler-libs to search patch for "Toploop".
+- Add oasis-common.patch to make setup.ml work on OCaml 4.00.0
+- Both patches from https://sympa.inria.fr/sympa/arc/caml-list/2012-05/msg00223.html
+
 * Mon Jun 11 2012 Richard W.M. Jones <rjones at redhat.com> - 2.3.2-4
 - Patch for OCaml 4.00.0.
 


More information about the scm-commits mailing list