From 284721bb1daa34629b05db060b83c88bfe76ba62 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 18 Sep 2013 11:25:49 -0600 Subject: [PATCH] Rebuild for OCaml 4.01.0, and add -ocaml41 patch to adapt to changes. Enable debuginfo. Enable glib integration. Add check script. Add manual to -devel subpackage. Minor spec file cleanups. --- lwt-2.3.2-libev.patch | 22 ---------------------- lwt-2.4.3-libev.patch | 22 ++++++++++++++++++++++ lwt-2.4.3-ocaml41.patch | 24 ++++++++++++++++++++++++ ocaml-lwt.spec | 38 +++++++++++++++++++++++++++++--------- 4 files changed, 75 insertions(+), 31 deletions(-) delete mode 100644 lwt-2.3.2-libev.patch create mode 100644 lwt-2.4.3-libev.patch create mode 100644 lwt-2.4.3-ocaml41.patch diff --git a/lwt-2.3.2-libev.patch b/lwt-2.3.2-libev.patch deleted file mode 100644 index 125f377..0000000 --- a/lwt-2.3.2-libev.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- lwt-2.3.2.orig/discover.ml 2011-04-15 17:42:59.000000000 +0200 -+++ lwt-2.3.2/discover.ml 2011-05-21 21:21:58.882050121 +0200 -@@ -56,7 +56,7 @@ - - let libev_code = " - #include --#include -+#include - - CAMLprim value lwt_test() - { ---- lwt-2.3.2.orig/src/unix/lwt_libev_stubs.c 2011-04-15 17:42:59.000000000 +0200 -+++ lwt-2.3.2/src/unix/lwt_libev_stubs.c 2011-05-21 21:24:05.681330220 +0200 -@@ -29,7 +29,7 @@ - #include - #include - #include --#include -+#include - - #include "lwt_unix.h" - diff --git a/lwt-2.4.3-libev.patch b/lwt-2.4.3-libev.patch new file mode 100644 index 0000000..656e034 --- /dev/null +++ b/lwt-2.4.3-libev.patch @@ -0,0 +1,22 @@ +--- ./discover.ml.orig 2012-12-27 05:29:57.000000000 -0700 ++++ ./discover.ml 2013-09-18 10:00:00.000000000 -0600 +@@ -96,7 +96,7 @@ CAMLprim value lwt_test() + + let libev_code = " + #include +-#include ++#include + + CAMLprim value lwt_test() + { +--- ./src/unix/lwt_libev_stubs.c.orig 2012-12-27 05:29:57.000000000 -0700 ++++ ./src/unix/lwt_libev_stubs.c 2013-09-18 10:00:00.000000000 -0600 +@@ -33,7 +33,7 @@ + #include + #include + #include +-#include ++#include + + #include "lwt_unix.h" + diff --git a/lwt-2.4.3-ocaml41.patch b/lwt-2.4.3-ocaml41.patch new file mode 100644 index 0000000..ff788d1 --- /dev/null +++ b/lwt-2.4.3-ocaml41.patch @@ -0,0 +1,24 @@ +--- ./src/unix/lwt_unix.ml.orig 2012-12-27 05:29:57.000000000 -0700 ++++ ./src/unix/lwt_unix.ml 2013-09-18 11:00:00.000000000 -0600 +@@ -596,6 +596,9 @@ type open_flag = + #if ocaml_version >= (3, 13) + | O_SHARE_DELETE + #endif ++#if ocaml_version >= (4, 1) ++ | O_CLOEXEC ++#endif + + #if windows + +--- ./src/unix/lwt_unix.mli.orig 2012-12-27 05:29:57.000000000 -0700 ++++ ./src/unix/lwt_unix.mli 2013-09-18 11:00:00.000000000 -0600 +@@ -315,6 +315,9 @@ type open_flag = + #if ocaml_version >= (3, 13) + | O_SHARE_DELETE + #endif ++#if ocaml_version >= (4, 1) ++ | O_CLOEXEC ++#endif + + val openfile : string -> open_flag list -> file_perm -> file_descr Lwt.t + (** Wrapper for [Unix.openfile]. *) diff --git a/ocaml-lwt.spec b/ocaml-lwt.spec index becee63..2b8f855 100644 --- a/ocaml-lwt.spec +++ b/ocaml-lwt.spec @@ -1,19 +1,22 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) -%global debug_package %{nil} Name: ocaml-lwt Version: 2.4.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml lightweight thread library +# The openssl linking exception is granted. License: LGPLv2+ with exceptions URL: http://ocsigen.org/lwt Source0: http://ocsigen.org/download/lwt-%{version}.tar.gz -ExcludeArch: sparc64 s390 s390x +ExclusiveArch: %{ocaml_arches} # Location of libev headers on Fedora is in /usr/include/libev/ev.h # so we need to patch the source accordingly. -Patch0: lwt-2.3.2-libev.patch +Patch0: lwt-2.4.3-libev.patch + +# Adapt to changes in OCaml 4.01.0 +Patch1: lwt-2.4.3-ocaml41.patch BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-findlib-devel @@ -22,6 +25,7 @@ BuildRequires: ocaml-camlp4-devel BuildRequires: ocaml-ssl >= 0.4.0 BuildRequires: ocaml-react >= 0.9.0 BuildRequires: chrpath +BuildRequires: glib2-devel BuildRequires: libev-devel @@ -32,7 +36,7 @@ is part of the Ocsigen project. %package devel Summary: Development files for %{name} -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel @@ -43,13 +47,16 @@ developing applications that use %{name}. %prep %setup -q -n lwt-%{version} -%patch0 -p1 +%patch0 +%patch1 mv README README.old iconv -f iso-8859-1 -t utf-8 < README.old > README +touch -r README.old README %build +./configure --enable-ssl --enable-glib --enable-react --prefix=%{_prefix} make @@ -59,10 +66,15 @@ export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs make install -strip $OCAMLFIND_DESTDIR/stublibs/dll*.so chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so +%check +./configure --enable-ssl --enable-glib --enable-react --enable-tests \ + --prefix=%{_prefix} +make test + + %files %doc LICENSE COPYING %{_libdir}/ocaml/lwt @@ -77,7 +89,7 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %files devel -%doc LICENSE COPYING CHANGES CHANGES.darcs README +%doc CHANGES CHANGES.darcs README manual/manual.pdf %if %opt %{_libdir}/ocaml/lwt/*.a %{_libdir}/ocaml/lwt/*.cmxa @@ -87,7 +99,15 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog -* Sat Sep 14 2013 Scott Tsai 2.4.3-3 +* Wed Sep 18 2013 Jerry James - 2.4.3-4 +- Rebuild for OCaml 4.01.0, and add -ocaml41 patch to adapt to changes +- Enable debuginfo +- Enable glib integration +- Add check script +- Add manual to -devel subpackage +- Minor spec file cleanups + +* Sat Sep 14 2013 Scott Tsai - 2.4.3-3 - New upstream version 2.4.3 * Sat Aug 03 2013 Fedora Release Engineering - 2.4.2-3