From f816b4f5cb8929f15a86f02dc57b3cd8ce3bdb1c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 8 Nov 2017 18:34:33 +0000 Subject: [PATCH] Add fix for immutable strings. --- ocaml-gettext-0.3.7-bytes-fix.patch | 17 +++++++++++++++++ ocaml-gettext.spec | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 ocaml-gettext-0.3.7-bytes-fix.patch diff --git a/ocaml-gettext-0.3.7-bytes-fix.patch b/ocaml-gettext-0.3.7-bytes-fix.patch new file mode 100644 index 0000000..df1c80f --- /dev/null +++ b/ocaml-gettext-0.3.7-bytes-fix.patch @@ -0,0 +1,17 @@ +diff -ur ocaml-gettext-0.3.7.old/libgettext-ocaml/gettextMo_int32.ml ocaml-gettext-0.3.7/libgettext-ocaml/gettextMo_int32.ml +--- ocaml-gettext-0.3.7.old/libgettext-ocaml/gettextMo_int32.ml 2017-03-01 22:03:24.000000000 +0000 ++++ ocaml-gettext-0.3.7/libgettext-ocaml/gettextMo_int32.ml 2017-11-08 18:33:04.486280040 +0000 +@@ -104,11 +104,11 @@ + (Int32.to_int length,Int32.to_int offset) + in + if 0 <= ioffset + ilength && ioffset + ilength < in_channel_length chn then +- let str = String.make ilength 'X' ++ let str = Bytes.make ilength 'X' + in + seek_in chn ioffset; + really_input chn str 0 ilength; +- str ++ Bytes.to_string str + else + (* We use this exception, because that what should happen if we try to + read the string *) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index c4e12f2..c560ba5 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -14,6 +14,8 @@ Patch0: ocaml-gettext-0.3.4-use-ocamlopt-g.patch Patch0001: 0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch Patch0002: 0002-pr_gettext-stop-printing-extracted-strings.patch Patch0003: 0003-add-more-generated-files-to-.gitignore.patch +# Fix for immutable strings in OCaml 4.06. +Patch4: ocaml-gettext-0.3.7-bytes-fix.patch BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 @@ -207,6 +209,7 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog * Wed Nov 08 2017 Richard W.M. Jones - 0.3.7-2 - OCaml 4.06.0 rebuild. +- Add fix for immutable strings. * Sat Sep 23 2017 Richard W.M. Jones - 0.3.7-1 - Update to new upstream version 0.3.7.