Richard W.M. Jones 2019-07-19 11:39:22 +01:00
parent bf0bebee85
commit 615f06a9be
12 changed files with 110 additions and 11 deletions

View File

@ -1,7 +1,7 @@
From 35d2d7381c7101bb73d0b7f00fea06442c7b2ab8 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 29 Aug 2017 18:29:34 +0200
Subject: [PATCH 1/9] pr_gettext: stop tracking (and printing) untranslated
Subject: [PATCH 01/11] pr_gettext: stop tracking (and printing) untranslated
strings
Do not collect anymore the information of untranslated strings, since it

View File

@ -1,7 +1,7 @@
From 3f4fc73c2a0315c2da16dee7db0fcb2766f55d3c Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 29 Aug 2017 18:36:10 +0200
Subject: [PATCH 2/9] pr_gettext: stop printing extracted strings
Subject: [PATCH 02/11] pr_gettext: stop printing extracted strings
They are written in the pot file already, no need to print them to
stderr (even though they are not errors).

View File

@ -1,7 +1,7 @@
From 202bf1e00eaa533e133c29b509d77cdfb7c13f5e Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 29 Aug 2017 18:55:37 +0200
Subject: [PATCH 3/9] add more generated files to .gitignore
Subject: [PATCH 03/11] add more generated files to .gitignore
Make sure all the files generated during a build are properly ignored
from the git status.

View File

@ -1,7 +1,8 @@
From b1d775dd3b59f844a89603cfcc154dd18aea6202 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 12 Jul 2019 16:12:14 +0100
Subject: [PATCH 4/9] .gitignore: Add a few more ignored files and directories.
Subject: [PATCH 04/11] .gitignore: Add a few more ignored files and
directories.
---
.gitignore | 25 ++++++++++++++-----------

View File

@ -1,7 +1,7 @@
From 685abfdad5f66b8df3ddf0713f7d3ba733b56b60 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 12 Jul 2019 13:50:31 +0100
Subject: [PATCH 5/9] Miscellaneous changes to remove deprecated features.
Subject: [PATCH 05/11] Miscellaneous changes to remove deprecated features.
- Use Bytes instead of mutable strings.
- Use String.uppercase_ascii instead of String.uppercase.

View File

@ -1,7 +1,7 @@
From 2894761bcccf8d51c87f8f0470ed7514a94dca9e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 12 Jul 2019 16:03:04 +0100
Subject: [PATCH 6/9] ocaml-gettext: Use cpp instead of camlp4 for #ifdef
Subject: [PATCH 06/11] ocaml-gettext: Use cpp instead of camlp4 for #ifdef
macros.
This requires some small changes to multiline strings to allow them to

View File

@ -1,7 +1,7 @@
From 399cf541e2abde8053b7ce39650f745c8bab8c44 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 18 Jul 2019 13:18:35 +0100
Subject: [PATCH 7/9] Fix warnings in newer OCaml.
Subject: [PATCH 07/11] Fix warnings in newer OCaml.
File "../libgettext-ocaml/gettextMo.ml", line 259, characters 13-36:
259 | | Failure("lexing: empty token") ->

View File

@ -1,7 +1,7 @@
From 1ac10b2d4ee97e490880dbf8e70842f771c4e02e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 18 Jul 2019 13:20:50 +0100
Subject: [PATCH 8/9] Fix probable incorrect definition of unit type.
Subject: [PATCH 08/11] Fix probable incorrect definition of unit type.
echo File "../libgettext-ocaml/gettextCharset.ml", line 48, characters 4-15:
48 | type u = ()

View File

@ -1,7 +1,7 @@
From 739e3a900993299e7e8b90af3da565417eb84412 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 12 Jul 2019 16:02:16 +0100
Subject: [PATCH 9/9] Convert from camlp4 to ppx for translatable string
Subject: [PATCH 09/11] Convert from camlp4 to ppx for translatable string
extraction.
---

View File

@ -0,0 +1,33 @@
From 5030d465a8b7b8232b3559d48cf9aba592efefab Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 19 Jul 2019 11:23:09 +0100
Subject: [PATCH 10/11] xgettext: Print filename when exceptions are thrown.
---
ocaml-gettext/xgettext.ml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ocaml-gettext/xgettext.ml b/ocaml-gettext/xgettext.ml
index 76232d8..569d40d 100644
--- a/ocaml-gettext/xgettext.ml
+++ b/ocaml-gettext/xgettext.ml
@@ -218,9 +218,13 @@ let ast_iterator =
let go fn =
current_file := fn;
- let lexbuf = Lexing.from_channel (open_in fn) in
- let structure = Parse.implementation lexbuf in
- ast_iterator.Ast_iterator.structure ast_iterator structure
+ try
+ let lexbuf = Lexing.from_channel (open_in fn) in
+ let structure = Parse.implementation lexbuf in
+ ast_iterator.Ast_iterator.structure ast_iterator structure
+ with
+ exn ->
+ failwith (fn ^ ": " ^ Printexc.to_string exn)
let () =
(* XXX Add -default-textdomain option which sets default_textdomain. *)
--
2.22.0

View File

@ -0,0 +1,61 @@
From e15ca7b11c6da676097c1458df8306355044e817 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 19 Jul 2019 11:34:28 +0100
Subject: [PATCH 11/11] xgettext: Remove attempt to convert strings from "OCaml
strings" to strings.
---
ocaml-gettext/xgettext.ml | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/ocaml-gettext/xgettext.ml b/ocaml-gettext/xgettext.ml
index 569d40d..111514c 100644
--- a/ocaml-gettext/xgettext.ml
+++ b/ocaml-gettext/xgettext.ml
@@ -63,19 +63,13 @@ type t = {
translated: SetString.t;
}
-let string_of_ocaml_string str =
- Scanf.sscanf
- (Printf.sprintf "\"%s\"" str)
- "%S"
- (fun s -> s)
-
let translations = ref { po_content = empty_po; translated = SetString.empty }
let default_textdomain = ref None
let current_file = ref ""
-let add_translation loc ocaml_singular plural_opt domain =
+let add_translation loc singular plural_opt domain =
let t = !translations in
let filepos =
@@ -85,19 +79,13 @@ let add_translation loc ocaml_singular plural_opt domain =
| fname -> fname in
fname, start.Lexing.pos_lnum
in
- let singular =
- string_of_ocaml_string ocaml_singular
- in
let translated =
- SetString.add ocaml_singular t.translated
+ SetString.add singular t.translated
in
let translated, translation =
match plural_opt with
- | Some ocaml_plural ->
- let plural =
- string_of_ocaml_string ocaml_plural
- in
- SetString.add ocaml_plural translated,
+ | Some plural ->
+ SetString.add plural translated,
{
po_comment_special = [];
po_comment_filepos = [filepos];
--
2.22.0

View File

@ -2,7 +2,7 @@
Name: ocaml-gettext
Version: 0.3.7
Release: 8%{?dist}
Release: 9%{?dist}
Summary: OCaml library for i18n
License: LGPLv2+ with exceptions
@ -25,6 +25,10 @@ Patch0007: 0007-Fix-warnings-in-newer-OCaml.patch
Patch0008: 0008-Fix-probable-incorrect-definition-of-unit-type.patch
Patch0009: 0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch
# https://github.com/gildor478/ocaml-gettext/pull/5
Patch0010: 0010-xgettext-Print-filename-when-exceptions-are-thrown.patch
Patch0011: 0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch
BuildRequires: ocaml >= 4.00.1
BuildRequires: ocaml-findlib-devel >= 1.3.3-3
BuildRequires: ocaml-compiler-libs
@ -218,7 +222,7 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
%changelog
* Fri Jul 19 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.7-8
* Fri Jul 19 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.7-9
- Remove camlp4 dependency.
- Add all upstream patches since 0.3.7.