[ocaml-bin-prot] - Add -fix-ints patch for ocaml 4.02 - Use native, rather than emulated endian-specific, 64-bit arit

Jerry James jjames at fedoraproject.org
Thu Sep 25 23:12:06 UTC 2014


commit e3038ba05e91c8f2d4ce64552c8b2e1c427226d8
Author: Jerry James <jamesjer at betterlinux.com>
Date:   Thu Sep 25 17:11:41 2014 -0600

    - Add -fix-ints patch for ocaml 4.02
    - Use native, rather than emulated endian-specific, 64-bit arithmetic
    - Fix license handling

 ocaml-bin-prot-2.0.9-fix-ints.patch |   14 ++++++++++++++
 ocaml-bin-prot.spec                 |   22 +++++++++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
---
diff --git a/ocaml-bin-prot-2.0.9-fix-ints.patch b/ocaml-bin-prot-2.0.9-fix-ints.patch
new file mode 100644
index 0000000..4996de9
--- /dev/null
+++ b/ocaml-bin-prot-2.0.9-fix-ints.patch
@@ -0,0 +1,14 @@
+--- bin_prot-2.0.9/lib/common_stubs.h.orig	2012-03-15 13:59:16.000000000 -0600
++++ bin_prot-2.0.9/lib/common_stubs.h	2014-09-25 12:00:00.000000000 -0600
+@@ -41,6 +41,11 @@
+ #include <caml/callback.h>
+ #include <caml/signals.h>
+ 
++#define int64 int64_t
++#define uint64 uint64_t
++#define int32 int32_t
++#define uint32 uint32_t
++
+ #ifdef ARCH_INT64_TYPE
+ #include "int64_native.h"
+ #else
diff --git a/ocaml-bin-prot.spec b/ocaml-bin-prot.spec
index 6435759..0581832 100644
--- a/ocaml-bin-prot.spec
+++ b/ocaml-bin-prot.spec
@@ -4,7 +4,7 @@
 
 Name:           ocaml-bin-prot
 Version:        2.0.9
-Release:        14%{?dist}
+Release:        15%{?dist}
 Summary:        Read and write OCaml values in a type-safe binary protocol
 License:        LGPLv2+ with exceptions
 
@@ -12,7 +12,10 @@ URL:            http://forge.ocamlcore.org/projects/bin-prot
 Source0:        http://forge.ocamlcore.org/frs/download.php/%{dlnode}/bin_prot-%{version}.tar.gz
 
 # Remove -Werror from flags.
-Patch1:         ocaml-bin-prot-2.0.9-remove-Werror.patch
+Patch1:         %{name}-2.0.9-remove-Werror.patch
+
+# Update integer types for ocaml 4.02
+Patch2:         %{name}-2.0.9-fix-ints.patch
 
 BuildRequires:  ocaml >= 3.12.0
 BuildRequires:  ocaml-findlib-devel
@@ -50,7 +53,15 @@ developing applications that use %{name}.
 %prep
 %setup -q -n bin_prot-%{version}
 %patch1 -p1
+%patch2 -p1
 
+# Use Fedora CFLAGS, and define ARCH_INT64_TYPE
+expr='                "-DARCH_INT64_TYPE";'
+for flag in %{optflags}; do
+  expr+="\\$\n"'                '"\"$flag\";"
+done
+sed -i "/-pipe/,/-Wno-long-long/c\\$expr" myocamlbuild.ml
+sed -i 's/;\$$/;/' myocamlbuild.ml
 
 %build
 ocaml setup.ml -configure --prefix %{_prefix} \
@@ -81,7 +92,7 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
 
 
 %files
-%doc COPYRIGHT LICENSE LICENSE.Tywith
+%license COPYRIGHT LICENSE LICENSE.Tywith
 %{_libdir}/ocaml/bin_prot
 %if %opt
 %exclude %{_libdir}/ocaml/bin_prot/*.a
@@ -102,6 +113,11 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
 
 
 %changelog
+* Thu Sep 25 2014 Jerry James <loganjerry at gmail.com> - 2.0.9-15
+- Add -fix-ints patch for ocaml 4.02
+- Use native, rather than emulated endian-specific, 64-bit arithmetic
+- Fix license handling
+
 * Sun Aug 31 2014 Richard W.M. Jones <rjones at redhat.com> - 2.0.9-14
 - Bump release and rebuild.
 


More information about the scm-commits mailing list