From f405b508d2cffe720bd6217e317de423a0fccfae Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Nov 2016 16:50:26 +0000 Subject: [PATCH 01/85] Disable a warning produced with OCaml 4.04. --- ocaml-gettext-0.3.5-disable-warning-31.patch | 11 +++++++++++ ocaml-gettext.spec | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ocaml-gettext-0.3.5-disable-warning-31.patch diff --git a/ocaml-gettext-0.3.5-disable-warning-31.patch b/ocaml-gettext-0.3.5-disable-warning-31.patch new file mode 100644 index 0000000..7b07266 --- /dev/null +++ b/ocaml-gettext-0.3.5-disable-warning-31.patch @@ -0,0 +1,11 @@ +--- ocaml-gettext-0.3.5.old/ConfMakefile.in 2014-08-04 22:33:52.000000000 +0100 ++++ ocaml-gettext-0.3.5/ConfMakefile.in 2016-11-04 16:47:56.012135630 +0000 +@@ -37,7 +37,7 @@ + OCAMLFIND_COMMANDS = "ocamlc=@OCAMLC@ \ + ocamlopt=@OCAMLOPT@ \ + ocamldep=@OCAMLDEP@" +-OCAMLC = @OCAMLFIND@ ocamlc ++OCAMLC = @OCAMLFIND@ ocamlc -w -31 + OCAMLOPT = @OCAMLFIND@ ocamlopt + OCAMLDEP = @OCAMLFIND@ ocamldep + OCAMLBEST = @OCAMLBEST@ diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index ba1ca94..e2855c8 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 8%{?dist} +Release: 9%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -11,6 +11,8 @@ URL: http://forge.ocamlcore.org/projects/ocaml-gettext Source0: https://forge.ocamlcore.org/frs/download.php/1433/%{name}-%{version}.tar.gz Patch1: ocaml-gettext-0.3.4-use-ocamlopt-g.patch +# Disable warning 31, so we can compile (with warnings) on OCaml 4.04. +Patch2: ocaml-gettext-0.3.5-disable-warning-31.patch BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 @@ -89,6 +91,7 @@ signature files for developing applications that use %setup -q %patch1 -p1 +%patch2 -p1 %build @@ -199,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri Nov 04 2016 Richard W.M. Jones - 0.3.5-9 +- Disable a warning produced with OCaml 4.04. + * Thu Feb 04 2016 Fedora Release Engineering - 0.3.5-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 74c391f4ad33c771af9c7f4507c572f4322ef935 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 00:31:55 +0000 Subject: [PATCH 02/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index e2855c8..c43a63a 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 9%{?dist} +Release: 10%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 0.3.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Fri Nov 04 2016 Richard W.M. Jones - 0.3.5-9 - Disable a warning produced with OCaml 4.04. From b4f5f8e9e1ca54a94dd685a45e8ff8505c78c902 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 12 May 2017 13:18:28 +0100 Subject: [PATCH 03/85] OCaml 4.04.1 rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index c43a63a..55afc58 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 10%{?dist} +Release: 11%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri May 12 2017 Richard W.M. Jones - 0.3.5-11 +- OCaml 4.04.1 rebuild. + * Sat Feb 11 2017 Fedora Release Engineering - 0.3.5-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 3ccc5068b09f26c996a15b6df3ce9224dc9b9de7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 12 May 2017 14:29:04 +0100 Subject: [PATCH 04/85] Bump release and rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 55afc58..462fbd3 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 11%{?dist} +Release: 12%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri May 12 2017 Richard W.M. Jones - 0.3.5-12 +- Bump release and rebuild. + * Fri May 12 2017 Richard W.M. Jones - 0.3.5-11 - OCaml 4.04.1 rebuild. From a5f3466f1afd59a3bd35f665e7cc11f0b063e3b1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 26 Jun 2017 21:06:58 +0100 Subject: [PATCH 05/85] OCaml 4.04.2 rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 462fbd3..5c99229 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 12%{?dist} +Release: 13%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Mon Jun 26 2017 Richard W.M. Jones - 0.3.5-13 +- OCaml 4.04.2 rebuild. + * Fri May 12 2017 Richard W.M. Jones - 0.3.5-12 - Bump release and rebuild. From beefcb4114c2aac83869a5678f3dee113e3d8697 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 26 Jun 2017 21:45:52 +0100 Subject: [PATCH 06/85] Bump release and rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 5c99229..fdeec33 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 13%{?dist} +Release: 14%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Mon Jun 26 2017 Richard W.M. Jones - 0.3.5-14 +- Bump release and rebuild. + * Mon Jun 26 2017 Richard W.M. Jones - 0.3.5-13 - OCaml 4.04.2 rebuild. From 07e39c47b7fc5163ce3b15de6a6ef48e9cc1c281 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 01:28:18 +0000 Subject: [PATCH 07/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index fdeec33..b758e48 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 14%{?dist} +Release: 15%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 0.3.5-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Mon Jun 26 2017 Richard W.M. Jones - 0.3.5-14 - Bump release and rebuild. From d889868337c532e3c366518c9e74f9b433ba4f76 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 04:15:57 +0000 Subject: [PATCH 08/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index b758e48..754f34b 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 15%{?dist} +Release: 16%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 0.3.5-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 0.3.5-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From f33d7cf5d977218cfa475ac23c136ae72ade2822 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 7 Aug 2017 23:37:40 +0100 Subject: [PATCH 09/85] OCaml 4.05.0 rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 754f34b..59a0f3b 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 16%{?dist} +Release: 17%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Mon Aug 07 2017 Richard W.M. Jones - 0.3.5-17 +- OCaml 4.05.0 rebuild. + * Thu Aug 03 2017 Fedora Release Engineering - 0.3.5-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 47d5341297b19f164f6c7845d527941cebdee4b5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 30 Aug 2017 10:16:20 +0100 Subject: [PATCH 10/85] Subpackage ocaml-gettext-camomile-devel should depend on ocaml-gettext-camomile (thanks: Pino Toscano). --- ocaml-gettext.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 59a0f3b..35c505a 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.5 -Release: 17%{?dist} +Release: 18%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -78,6 +78,7 @@ depend on Camomile. %package camomile-devel Summary: Development files for %{name}-camomile Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-camomile = %{version}-%{release} %description camomile-devel @@ -202,6 +203,10 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Wed Aug 30 2017 Richard W.M. Jones - 0.3.5-18 +- Subpackage ocaml-gettext-camomile-devel should depend on + ocaml-gettext-camomile (thanks: Pino Toscano). + * Mon Aug 07 2017 Richard W.M. Jones - 0.3.5-17 - OCaml 4.05.0 rebuild. From 568eb7d26c5062edc54a057ab1bcdcaf8c357973 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 23 Sep 2017 10:20:54 +0100 Subject: [PATCH 11/85] Update to new upstream version 0.3.7. New URL. Include upstream patches since 0.3.7 was released. --- .gitignore | 1 + ...tracking-and-printing-untranslated-s.patch | 109 ++++++++++++++++++ ...text-stop-printing-extracted-strings.patch | 26 +++++ ...d-more-generated-files-to-.gitignore.patch | 44 +++++++ ocaml-gettext-0.3.5-disable-warning-31.patch | 11 -- ocaml-gettext.spec | 25 ++-- sources | 2 +- 7 files changed, 197 insertions(+), 21 deletions(-) create mode 100644 0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch create mode 100644 0002-pr_gettext-stop-printing-extracted-strings.patch create mode 100644 0003-add-more-generated-files-to-.gitignore.patch delete mode 100644 ocaml-gettext-0.3.5-disable-warning-31.patch diff --git a/.gitignore b/.gitignore index 6e180d9..e11a1eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ ocaml-gettext-0.3.3.tar.gz /ocaml-gettext-0.3.4.tar.gz /ocaml-gettext-0.3.5.tar.gz +/0.3.7.tar.gz diff --git a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch new file mode 100644 index 0000000..511eb3b --- /dev/null +++ b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch @@ -0,0 +1,109 @@ +From 35d2d7381c7101bb73d0b7f00fea06442c7b2ab8 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 29 Aug 2017 18:29:34 +0200 +Subject: [PATCH 1/3] pr_gettext: stop tracking (and printing) untranslated + strings + +Do not collect anymore the information of untranslated strings, since it +is only used to print all of them at the end of the message extraction. + +While I understand the reason why this was done (i.e. to discover +potentially untranslated user strings), this is something that just +causes lots of output in complex projects, since strings are basically +used for many non-UI tasks (say Str, Sys.command, etc), so the actual +result is that there are lots of false positive. Also, this is not +something xgettext (from GNU gettext) does. +--- + libgettext-ocaml/pr_gettext.ml | 44 ------------------------------------------ + 1 file changed, 44 deletions(-) + +diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml +index c44933f..d78cf21 100644 +--- a/libgettext-ocaml/pr_gettext.ml ++++ b/libgettext-ocaml/pr_gettext.ml +@@ -71,17 +71,10 @@ struct + module Loc = Syntax.Loc + module Ast = Syntax.Ast + +- type untranslated_t = +- { +- str: string; (* Real string, not OCaml one *) +- locations: (string * int) list; (* Location in the file *) +- } +- + type t = + { + po_content: po_content; + translated: SetString.t; +- untranslated: untranslated_t MapString.t; + } + + let string_of_ocaml_string str = +@@ -91,29 +84,6 @@ struct + "%S" + (fun s -> s) + +- let string_not_translated t ocaml_str = +- not (SetString.mem ocaml_str t.translated) +- +- let add_untranslated t loc ocaml_str = +- let cur = +- try +- MapString.find ocaml_str t.untranslated +- with Not_found -> +- { +- str = string_of_ocaml_string ocaml_str; +- locations = []; +- } +- in +- let untranslated = +- MapString.add +- ocaml_str +- {cur with +- locations = +- (Loc.file_name loc, Loc.start_line loc) :: cur.locations} +- t.untranslated +- in +- {t with untranslated = untranslated} +- + + let add_translation t loc ocaml_singular plural_opt domain = + let filepos = +@@ -164,15 +134,6 @@ struct + | Some f -> open_out f + | None -> stdout + in +- MapString.iter +- (fun _ {str = str; locations = locs} -> +- List.iter +- (fun (fn, lineno) -> +- Printf.eprintf +- "%s:%d String %S not translated\n%!" +- fn lineno str) +- locs) +- t.untranslated; + Marshal.to_channel fd t.po_content [] + + (* Check if the given node belong to the given functions *) +@@ -197,7 +158,6 @@ struct + val t = + { + po_content = empty_po; +- untranslated = MapString.empty; + translated = SetString.empty; + } + +@@ -234,10 +194,6 @@ struct + (* Add a plural / defined domain string *) + {< t = add_translation t loc singular (Some plural) (Some domain) >} + +- | <:expr@loc<$str:str$>> when +- string_not_translated t str -> +- {< t = add_untranslated t loc str >} +- + | e -> super#expr e + + end +-- +2.13.2 + diff --git a/0002-pr_gettext-stop-printing-extracted-strings.patch b/0002-pr_gettext-stop-printing-extracted-strings.patch new file mode 100644 index 0000000..6d656d9 --- /dev/null +++ b/0002-pr_gettext-stop-printing-extracted-strings.patch @@ -0,0 +1,26 @@ +From 3f4fc73c2a0315c2da16dee7db0fcb2766f55d3c Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 29 Aug 2017 18:36:10 +0200 +Subject: [PATCH 2/3] 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). +--- + libgettext-ocaml/pr_gettext.ml | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml +index d78cf21..47d93e5 100644 +--- a/libgettext-ocaml/pr_gettext.ml ++++ b/libgettext-ocaml/pr_gettext.ml +@@ -78,7 +78,6 @@ struct + } + + let string_of_ocaml_string str = +- prerr_endline str; + Scanf.sscanf + (Printf.sprintf "\"%s\"" str) + "%S" +-- +2.13.2 + diff --git a/0003-add-more-generated-files-to-.gitignore.patch b/0003-add-more-generated-files-to-.gitignore.patch new file mode 100644 index 0000000..00b410c --- /dev/null +++ b/0003-add-more-generated-files-to-.gitignore.patch @@ -0,0 +1,44 @@ +From 202bf1e00eaa533e133c29b509d77cdfb7c13f5e Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 29 Aug 2017 18:55:37 +0200 +Subject: [PATCH 3/3] add more generated files to .gitignore + +Make sure all the files generated during a build are properly ignored +from the git status. +--- + .gitignore | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/.gitignore b/.gitignore +index d853d40..87821c3 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,3 +1,12 @@ ++*.a ++*.cma ++*.cmi ++*.cmo ++*.cmx ++*.cmxa ++*.o ++*.so ++*_parser.output + /_build/ + /setup.data + /setup.log +@@ -7,6 +16,12 @@ + /configure + /libgettext-ocaml/META + /libgettext-ocaml/gettextConfig.ml ++/libgettext-ocaml/gettextPo_parser.mli + /config.log + /config.status ++/po/*.mo + /po/fr.po.bak ++/doc/*.1 ++/doc/*.5 ++/ocaml-gettext/ocaml-gettext ++/ocaml-gettext/ocaml-xgettext +-- +2.13.2 + diff --git a/ocaml-gettext-0.3.5-disable-warning-31.patch b/ocaml-gettext-0.3.5-disable-warning-31.patch deleted file mode 100644 index 7b07266..0000000 --- a/ocaml-gettext-0.3.5-disable-warning-31.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ocaml-gettext-0.3.5.old/ConfMakefile.in 2014-08-04 22:33:52.000000000 +0100 -+++ ocaml-gettext-0.3.5/ConfMakefile.in 2016-11-04 16:47:56.012135630 +0000 -@@ -37,7 +37,7 @@ - OCAMLFIND_COMMANDS = "ocamlc=@OCAMLC@ \ - ocamlopt=@OCAMLOPT@ \ - ocamldep=@OCAMLDEP@" --OCAMLC = @OCAMLFIND@ ocamlc -+OCAMLC = @OCAMLFIND@ ocamlc -w -31 - OCAMLOPT = @OCAMLFIND@ ocamlopt - OCAMLDEP = @OCAMLFIND@ ocamldep - OCAMLBEST = @OCAMLBEST@ diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 35c505a..14a033d 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,18 +1,19 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) Name: ocaml-gettext -Version: 0.3.5 -Release: 18%{?dist} +Version: 0.3.7 +Release: 1%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions -URL: http://forge.ocamlcore.org/projects/ocaml-gettext +URL: https://github.com/gildor478/ocaml-gettext -Source0: https://forge.ocamlcore.org/frs/download.php/1433/%{name}-%{version}.tar.gz +Source0: https://github.com/gildor478/%{name}/archive/%{version}.tar.gz -Patch1: ocaml-gettext-0.3.4-use-ocamlopt-g.patch -# Disable warning 31, so we can compile (with warnings) on OCaml 4.04. -Patch2: ocaml-gettext-0.3.5-disable-warning-31.patch +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 BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 @@ -29,6 +30,7 @@ BuildRequires: ocaml-ounit-devel BuildRequires: ocaml-camomile-devel >= 0.8.1 BuildRequires: ocaml-camomile-data %endif +BuildRequires: autoconf, automake %if !0%{?rhel} # ocaml-gettext program needs camomile data files @@ -90,9 +92,9 @@ signature files for developing applications that use %prep %setup -q +%autopatch -p1 -%patch1 -p1 -%patch2 -p1 +autoreconf -i %build @@ -203,6 +205,11 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Sat Sep 23 2017 Richard W.M. Jones - 0.3.7-1 +- Update to new upstream version 0.3.7. +- New URL. +- Include upstream patches since 0.3.7 was released. + * Wed Aug 30 2017 Richard W.M. Jones - 0.3.5-18 - Subpackage ocaml-gettext-camomile-devel should depend on ocaml-gettext-camomile (thanks: Pino Toscano). diff --git a/sources b/sources index d950627..9645c1e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3c3c5156578104819b486584aa14f807 ocaml-gettext-0.3.5.tar.gz +SHA512 (0.3.7.tar.gz) = 1358320359b9d2f3fd97a47d69b2a619942a65605c1e5cbf25e33ef42a10273167b526bca15e6c9523b87d8ea9dfd3215334050ad8eb84a8c41d4feef880a27a From 67ee8833b446b6c2ad95f4057125ff78e24ce278 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 8 Nov 2017 18:17:15 +0000 Subject: [PATCH 12/85] OCaml 4.06.0 rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 14a033d..c4e12f2 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -205,6 +205,9 @@ 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. + * Sat Sep 23 2017 Richard W.M. Jones - 0.3.7-1 - Update to new upstream version 0.3.7. - New URL. 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 13/85] 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. From 6d3a5618f8ffbb9ab8956b56e8712f4b619805b9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 8 Nov 2017 18:53:01 +0000 Subject: [PATCH 14/85] Build requires fixed ocaml camomile package. --- ocaml-gettext.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index c560ba5..b36fa69 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -29,7 +29,7 @@ BuildRequires: chrpath BuildRequires: autoconf %if !0%{?rhel} BuildRequires: ocaml-ounit-devel -BuildRequires: ocaml-camomile-devel >= 0.8.1 +BuildRequires: ocaml-camomile-devel >= 0.8.6-3 BuildRequires: ocaml-camomile-data %endif BuildRequires: autoconf, automake From 5a3b9f1e1a449d9c8d367cc9fbecf4122e123e49 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 8 Feb 2018 08:50:40 +0000 Subject: [PATCH 15/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index b36fa69..df911b8 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -207,6 +207,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Thu Feb 08 2018 Fedora Release Engineering - 0.3.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Wed Nov 08 2017 Richard W.M. Jones - 0.3.7-2 - OCaml 4.06.0 rebuild. - Add fix for immutable strings. From 6f73f218aa53366259a3389925a734830b2d9a0a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 20 Jun 2018 10:07:26 +0100 Subject: [PATCH 16/85] OCaml 4.07.0-rc1 rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index df911b8..0231c51 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -207,6 +207,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Wed Jun 20 2018 Richard W.M. Jones - 0.3.7-4 +- OCaml 4.07.0-rc1 rebuild. + * Thu Feb 08 2018 Fedora Release Engineering - 0.3.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 481f08f63f7ac43acf6a1bca7771b3e8b8373d6b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 11 Jul 2018 16:28:08 +0100 Subject: [PATCH 17/85] OCaml 4.07.0 (final) rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 0231c51..5810197 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 4%{?dist} +Release: 5%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -207,6 +207,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Wed Jul 11 2018 Richard W.M. Jones - 0.3.7-5 +- OCaml 4.07.0 (final) rebuild. + * Wed Jun 20 2018 Richard W.M. Jones - 0.3.7-4 - OCaml 4.07.0-rc1 rebuild. From 8cce454a571a380b662b484ec4d6693fc2405f3d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 14:43:43 +0000 Subject: [PATCH 18/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 5810197..35e64b6 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 5%{?dist} +Release: 6%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -207,6 +207,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 0.3.7-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Wed Jul 11 2018 Richard W.M. Jones - 0.3.7-5 - OCaml 4.07.0 (final) rebuild. From 85e0c7b354c69a2ca57a19c0c0d5c875e85cfd14 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 16:50:24 +0000 Subject: [PATCH 19/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 35e64b6..733784d 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 6%{?dist} +Release: 7%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -207,6 +207,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 0.3.7-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Fri Jul 13 2018 Fedora Release Engineering - 0.3.7-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From bf0bebee85502e7a5efc0e31e36f86dec4ca0919 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 19 Jul 2019 10:54:04 +0100 Subject: [PATCH 20/85] Remove camlp4 dependency. Add all upstream patches since 0.3.7. --- ...tracking-and-printing-untranslated-s.patch | 6 +- ...text-stop-printing-extracted-strings.patch | 4 +- ...d-more-generated-files-to-.gitignore.patch | 4 +- ...-few-more-ignored-files-and-director.patch | 52 ++ ...hanges-to-remove-deprecated-features.patch | 64 ++ ...e-cpp-instead-of-camlp4-for-ifdef-ma.patch | 106 ++++ 0007-Fix-warnings-in-newer-OCaml.patch | 82 +++ ...le-incorrect-definition-of-unit-type.patch | 31 + ...lp4-to-ppx-for-translatable-string-e.patch | 597 ++++++++++++++++++ ocaml-gettext-0.3.7-bytes-fix.patch | 17 - ocaml-gettext.spec | 23 +- 11 files changed, 958 insertions(+), 28 deletions(-) create mode 100644 0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch create mode 100644 0005-Miscellaneous-changes-to-remove-deprecated-features.patch create mode 100644 0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch create mode 100644 0007-Fix-warnings-in-newer-OCaml.patch create mode 100644 0008-Fix-probable-incorrect-definition-of-unit-type.patch create mode 100644 0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch delete mode 100644 ocaml-gettext-0.3.7-bytes-fix.patch diff --git a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch index 511eb3b..0c49ab5 100644 --- a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch +++ b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch @@ -1,7 +1,7 @@ From 35d2d7381c7101bb73d0b7f00fea06442c7b2ab8 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 29 Aug 2017 18:29:34 +0200 -Subject: [PATCH 1/3] pr_gettext: stop tracking (and printing) untranslated +Subject: [PATCH 1/9] pr_gettext: stop tracking (and printing) untranslated strings Do not collect anymore the information of untranslated strings, since it @@ -14,7 +14,7 @@ used for many non-UI tasks (say Str, Sys.command, etc), so the actual result is that there are lots of false positive. Also, this is not something xgettext (from GNU gettext) does. --- - libgettext-ocaml/pr_gettext.ml | 44 ------------------------------------------ + libgettext-ocaml/pr_gettext.ml | 44 ---------------------------------- 1 file changed, 44 deletions(-) diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml @@ -105,5 +105,5 @@ index c44933f..d78cf21 100644 end -- -2.13.2 +2.22.0 diff --git a/0002-pr_gettext-stop-printing-extracted-strings.patch b/0002-pr_gettext-stop-printing-extracted-strings.patch index 6d656d9..e327c2e 100644 --- a/0002-pr_gettext-stop-printing-extracted-strings.patch +++ b/0002-pr_gettext-stop-printing-extracted-strings.patch @@ -1,7 +1,7 @@ From 3f4fc73c2a0315c2da16dee7db0fcb2766f55d3c Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 29 Aug 2017 18:36:10 +0200 -Subject: [PATCH 2/3] pr_gettext: stop printing extracted strings +Subject: [PATCH 2/9] 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). @@ -22,5 +22,5 @@ index d78cf21..47d93e5 100644 (Printf.sprintf "\"%s\"" str) "%S" -- -2.13.2 +2.22.0 diff --git a/0003-add-more-generated-files-to-.gitignore.patch b/0003-add-more-generated-files-to-.gitignore.patch index 00b410c..5a98d58 100644 --- a/0003-add-more-generated-files-to-.gitignore.patch +++ b/0003-add-more-generated-files-to-.gitignore.patch @@ -1,7 +1,7 @@ From 202bf1e00eaa533e133c29b509d77cdfb7c13f5e Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 29 Aug 2017 18:55:37 +0200 -Subject: [PATCH 3/3] add more generated files to .gitignore +Subject: [PATCH 3/9] add more generated files to .gitignore Make sure all the files generated during a build are properly ignored from the git status. @@ -40,5 +40,5 @@ index d853d40..87821c3 100644 +/ocaml-gettext/ocaml-gettext +/ocaml-gettext/ocaml-xgettext -- -2.13.2 +2.22.0 diff --git a/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch b/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch new file mode 100644 index 0000000..a83e7de --- /dev/null +++ b/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch @@ -0,0 +1,52 @@ +From b1d775dd3b59f844a89603cfcc154dd18aea6202 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 12 Jul 2019 16:12:14 +0100 +Subject: [PATCH 4/9] .gitignore: Add a few more ignored files and directories. + +--- + .gitignore | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/.gitignore b/.gitignore +index 87821c3..59dfc69 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -7,21 +7,24 @@ + *.o + *.so + *_parser.output +-/_build/ +-/setup.data +-/setup.log +-/dist/ +-/test.byte ++ + /ConfMakefile +-/configure +-/libgettext-ocaml/META +-/libgettext-ocaml/gettextConfig.ml +-/libgettext-ocaml/gettextPo_parser.mli ++/_build/ ++/autom4te.cache/ + /config.log + /config.status +-/po/*.mo +-/po/fr.po.bak ++/configure ++/dist/ + /doc/*.1 + /doc/*.5 ++/libgettext-ocaml/META ++/libgettext-ocaml/gettextConfig.ml ++/libgettext-ocaml/gettextMo_parser.ml ++/libgettext-ocaml/gettextPo_parser.mli + /ocaml-gettext/ocaml-gettext + /ocaml-gettext/ocaml-xgettext ++/po/*.mo ++/po/fr.po.bak ++/setup.data ++/setup.log ++/test.byte +-- +2.22.0 + diff --git a/0005-Miscellaneous-changes-to-remove-deprecated-features.patch b/0005-Miscellaneous-changes-to-remove-deprecated-features.patch new file mode 100644 index 0000000..058a364 --- /dev/null +++ b/0005-Miscellaneous-changes-to-remove-deprecated-features.patch @@ -0,0 +1,64 @@ +From 685abfdad5f66b8df3ddf0713f7d3ba733b56b60 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 12 Jul 2019 13:50:31 +0100 +Subject: [PATCH 5/9] Miscellaneous changes to remove deprecated features. + + - Use Bytes instead of mutable strings. + - Use String.uppercase_ascii instead of String.uppercase. +--- + libgettext-ocaml/gettextMo.ml | 4 ++-- + libgettext-ocaml/gettextMo_int32.ml | 2 +- + libgettext-ocaml/gettextMo_parser.mly | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libgettext-ocaml/gettextMo.ml b/libgettext-ocaml/gettextMo.ml +index fb395e8..246a115 100644 +--- a/libgettext-ocaml/gettextMo.ml ++++ b/libgettext-ocaml/gettextMo.ml +@@ -164,7 +164,7 @@ let input_mo_untranslated failsafe chn mo_header number = + with End_of_file -> + raise (MoInvalidStringOutOfBound(in_channel_length chn,offset_pair)) + in +- split_plural str ++ split_plural (Bytes.to_string str) + else + raise (MoInvalidStringOutOfBound(Int32.to_int mo_header.number_of_strings, number)) + ;; +@@ -183,7 +183,7 @@ let input_mo_translated failsafe chn mo_header number = + raise (MoInvalidTranslationOutOfBound + (in_channel_length chn,offset_pair)) + in +- split_plural str ++ split_plural (Bytes.to_string str) + ) + else + ( +diff --git a/libgettext-ocaml/gettextMo_int32.ml b/libgettext-ocaml/gettextMo_int32.ml +index 7490a3e..4816d83 100644 +--- a/libgettext-ocaml/gettextMo_int32.ml ++++ b/libgettext-ocaml/gettextMo_int32.ml +@@ -104,7 +104,7 @@ let input_int32_pair_string chn endian = + (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; +diff --git a/libgettext-ocaml/gettextMo_parser.mly b/libgettext-ocaml/gettextMo_parser.mly +index 95d50e3..b2e55ca 100644 +--- a/libgettext-ocaml/gettextMo_parser.mly ++++ b/libgettext-ocaml/gettextMo_parser.mly +@@ -99,7 +99,7 @@ plural_forms: + ; + + content_type: +- STRING SEMICOLON CHARSET EQUAL STRING { ($1,String.uppercase $5) } ++ STRING SEMICOLON CHARSET EQUAL STRING { ($1,String.uppercase_ascii $5) } + ; + + expr: +-- +2.22.0 + diff --git a/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch b/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch new file mode 100644 index 0000000..1ed4615 --- /dev/null +++ b/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch @@ -0,0 +1,106 @@ +From 2894761bcccf8d51c87f8f0470ed7514a94dca9e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 12 Jul 2019 16:03:04 +0100 +Subject: [PATCH 6/9] ocaml-gettext: Use cpp instead of camlp4 for #ifdef + macros. + +This requires some small changes to multiline strings to allow them to +pass through cpp without error or warning. +--- + ocaml-gettext/Makefile | 4 ++-- + ocaml-gettext/OCamlGettext.ml | 33 +++++++++++++++++---------------- + 2 files changed, 19 insertions(+), 18 deletions(-) + +diff --git a/ocaml-gettext/Makefile b/ocaml-gettext/Makefile +index 3858ea8..d5f37fa 100644 +--- a/ocaml-gettext/Makefile ++++ b/ocaml-gettext/Makefile +@@ -41,12 +41,12 @@ REQUIRES = gettext.extension fileutils + + ifeq ($(GETTEXT_MODULES),CAMOMILE) + REQUIRES += gettext-camomile +-INCLUDES += -pp 'camlp4o -I +camlp4 pa_macro.cmo -DCAMOMILE' ++INCLUDES += -pp 'cpp -DCAMOMILE' + endif + + ifeq ($(GETTEXT_MODULES),STUB) + REQUIRES += gettext-stub +-INCLUDES += -pp 'camlp4o -I +camlp4 pa_macro.cmo -DSTUB' ++INCLUDES += -pp 'cpp -DSTUB' + endif + + include ../TopMakefile +diff --git a/ocaml-gettext/OCamlGettext.ml b/ocaml-gettext/OCamlGettext.ml +index 6e72971..837057e 100644 +--- a/ocaml-gettext/OCamlGettext.ml ++++ b/ocaml-gettext/OCamlGettext.ml +@@ -36,14 +36,15 @@ open GettextCategory;; + open GettextUtils;; + open FilePath.DefaultPath;; + +-IFDEF CAMOMILE THEN ++#ifdef CAMOMILE + module OcamlGettextRealize = GettextCamomile.Open +-ELSE IFDEF STUB THEN ++#else ++#ifdef STUB + module OcamlGettextRealize = GettextStub.Native +-ELSE ++#else + module OcamlGettextRealize = GettextDummy.Dummy +-ENDIF +-ENDIF ++#endif ++#endif + ;; + + module OcamlGettext = Gettext.Program +@@ -104,12 +105,12 @@ let string_of_exception exc = + (s_ "You must specify one action.") + | InstallUninstallTooManyFilename -> + (s_ +-"You cannot specify at the same time a language, a textdomain +-and provide more than one file to install/uninstall : all files ++"You cannot specify at the same time a language, a textdomain\n\ ++and provide more than one file to install/uninstall : all files\n\ + will have the same destination filename.") + | CompileTooManyFilename -> + (s_ +-"You cannot specify a output filename and more than one ++"You cannot specify a output filename and more than one\n\ + filename : all the compiled file will have the same output filename") + | _ -> + Gettext.string_of_exception exc +@@ -197,8 +198,8 @@ let guess_language_textdomain (language_option,textdomain_option) lst = + in + * (((chop_extension str_reduce), (get_extension str_reduce)),fl_mo)*) + raise (Failure +-"FilePath suffers from a default with the handling of +-chop/get_extension. This bug should disappears with ++"FilePath suffers from a default with the handling of\n\ ++chop/get_extension. This bug should disappears with\n\ + newer version of ocaml-fileutils") + ) lst + ;; +@@ -526,12 +527,12 @@ let () = + t := { !t with input_files = str :: !t.input_files } + ) + ( +- spf (f_ "%s +- +-Command: ocaml-gettext -action (%s) [options] +-When trying to guess language and textdomain from a +-MO file, the rules applied are: language.textdomain.mo +- ++ spf (f_ "%s\n\ ++\n\ ++Command: ocaml-gettext -action (%s) [options]\n\ ++When trying to guess language and textdomain from a\n\ ++MO file, the rules applied are: language.textdomain.mo\n\ ++\n\ + Options:") + gettext_copyright + (String.concat "|" (List.map fst actions)) +-- +2.22.0 + diff --git a/0007-Fix-warnings-in-newer-OCaml.patch b/0007-Fix-warnings-in-newer-OCaml.patch new file mode 100644 index 0000000..409a0ce --- /dev/null +++ b/0007-Fix-warnings-in-newer-OCaml.patch @@ -0,0 +1,82 @@ +From 399cf541e2abde8053b7ce39650f745c8bab8c44 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 18 Jul 2019 13:18:35 +0100 +Subject: [PATCH 7/9] Fix warnings in newer OCaml. + +File "../libgettext-ocaml/gettextMo.ml", line 259, characters 13-36: +259 | | Failure("lexing: empty token") -> + ^^^^^^^^^^^^^^^^^^^^^^^ +Warning 52: Code should not depend on the actual values of +this constructor's arguments. They are only for information +and may change in future versions. (See manual section 9.5) +File "../libgettext-ocaml/gettextMo.ml", line 275, characters 15-38: +275 | | Failure("lexing: empty token") -> + ^^^^^^^^^^^^^^^^^^^^^^^ +Warning 52: Code should not depend on the actual values of +this constructor's arguments. They are only for information +and may change in future versions. (See manual section 9.5) +File "../libgettext-ocaml/gettextMo.ml", line 296, characters 15-38: +296 | | Failure("lexing: empty token") -> + ^^^^^^^^^^^^^^^^^^^^^^^ +Warning 52: Code should not depend on the actual values of +this constructor's arguments. They are only for information +and may change in future versions. (See manual section 9.5) + +File "gettextStub.ml", line 101, characters 28-63: +101 | with Failure("setlocale(invalid localization)") as exc -> + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Warning 52: Code should not depend on the actual values of +this constructor's arguments. They are only for information +and may change in future versions. (See manual section 9.5) +--- + libgettext-ocaml/gettextMo.ml | 6 +++--- + libgettext-stub-ocaml/gettextStub.ml | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libgettext-ocaml/gettextMo.ml b/libgettext-ocaml/gettextMo.ml +index 246a115..22630d4 100644 +--- a/libgettext-ocaml/gettextMo.ml ++++ b/libgettext-ocaml/gettextMo.ml +@@ -256,7 +256,7 @@ let input_mo_informations failsafe chn mo_header = + GettextMo_parser.main GettextMo_lexer.token_field_name lexbuf + with + Parsing.Parse_error +- | Failure("lexing: empty token") -> ++ | Failure _ -> + fail_or_continue failsafe + (MoInvalidOptions (lexbuf,empty_translation)) + [] +@@ -272,7 +272,7 @@ let input_mo_informations failsafe chn mo_header = + GettextMo_lexer.token_field_plural_value lexbuf + with + Parsing.Parse_error +- | Failure("lexing: empty token") -> ++ | Failure _ -> + fail_or_continue + failsafe + (MoInvalidPlurals(lexbuf,field_plural_forms)) +@@ -293,7 +293,7 @@ let input_mo_informations failsafe chn mo_header = + GettextMo_lexer.token_field_content_type lexbuf + with + Parsing.Parse_error +- | Failure("lexing: empty token") -> ++ | Failure _ -> + fail_or_continue failsafe + (MoInvalidContentType(lexbuf,field_content_type)) + gettext_content +diff --git a/libgettext-stub-ocaml/gettextStub.ml b/libgettext-stub-ocaml/gettextStub.ml +index 03ac2a5..dc798a2 100644 +--- a/libgettext-stub-ocaml/gettextStub.ml ++++ b/libgettext-stub-ocaml/gettextStub.ml +@@ -98,7 +98,7 @@ module Native : GettextTypes.REALIZE_TYPE = + ( + try + GettextStubCompat.setlocale GettextStubCompat.LC_ALL language +- with Failure("setlocale(invalid localization)") as exc -> ++ with Failure _ as exc -> + let () = + fail_or_continue t.failsafe exc () + in +-- +2.22.0 + diff --git a/0008-Fix-probable-incorrect-definition-of-unit-type.patch b/0008-Fix-probable-incorrect-definition-of-unit-type.patch new file mode 100644 index 0000000..00e0bb7 --- /dev/null +++ b/0008-Fix-probable-incorrect-definition-of-unit-type.patch @@ -0,0 +1,31 @@ +From 1ac10b2d4ee97e490880dbf8e70842f771c4e02e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 18 Jul 2019 13:20:50 +0100 +Subject: [PATCH 8/9] Fix probable incorrect definition of unit type. + +echo File "../libgettext-ocaml/gettextCharset.ml", line 48, characters 4-15: +48 | type u = () + ^^^^^^^^^^^ +Warning 65: This type declaration is defining a new '()' constructor +which shadows the existing one. +Hint: Did you mean 'type u = unit'? +--- + libgettext-ocaml/gettextCharset.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libgettext-ocaml/gettextCharset.ml b/libgettext-ocaml/gettextCharset.ml +index 54cd75d..1963708 100644 +--- a/libgettext-ocaml/gettextCharset.ml ++++ b/libgettext-ocaml/gettextCharset.ml +@@ -45,7 +45,7 @@ module type CHARSET_TYPE = + module Dummy : CHARSET_TYPE = + struct + type encoding = string +- type u = () ++ type u = unit + + let create t in_enc out_enc = () + +-- +2.22.0 + diff --git a/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch b/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch new file mode 100644 index 0000000..6358c20 --- /dev/null +++ b/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch @@ -0,0 +1,597 @@ +From 739e3a900993299e7e8b90af3da565417eb84412 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 12 Jul 2019 16:02:16 +0100 +Subject: [PATCH 9/9] Convert from camlp4 to ppx for translatable string + extraction. + +--- + aclocal.m4 | 6 +- + configure.in | 3 - + libgettext-ocaml/Makefile | 17 --- + libgettext-ocaml/pr_gettext.ml | 218 ------------------------------- + ocaml-gettext/Makefile | 11 +- + ocaml-gettext/OCamlGettext.ml | 2 +- + ocaml-gettext/xgettext.ml | 228 +++++++++++++++++++++++++++++++++ + test/test.ml | 4 +- + 8 files changed, 234 insertions(+), 255 deletions(-) + delete mode 100644 libgettext-ocaml/pr_gettext.ml + create mode 100644 ocaml-gettext/xgettext.ml + +diff --git a/aclocal.m4 b/aclocal.m4 +index 72a27da..2a1110f 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -204,7 +204,7 @@ else + fi + ]) + +-# AC_CHECK_[CAMLP4,CAMLIDL,OCAMLMKLIB,MKCAMLP4] ([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) ++# AC_CHECK_[CAMLIDL,OCAMLMKLIB] ([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) + #--------------------------------------------------------- + # Subst the corresponding var + AC_DEFUN([AC_CHECK_STAR], +@@ -219,12 +219,8 @@ else + fi + AC_SUBST($1) + ]) +-AC_DEFUN([AC_CHECK_CAMLP4], [AC_CHECK_STAR(CAMLP4,camlp4,$1,$2)]) +-AC_DEFUN([AC_CHECK_CAMLP4OF], [AC_CHECK_STAR(CAMLP4OF,camlp4of,$1,$2)]) +-AC_DEFUN([AC_CHECK_CAMLP4O], [AC_CHECK_STAR(CAMLP4O,camlp4o,$1,$2)]) + AC_DEFUN([AC_CHECK_CAMLIDL], [AC_CHECK_STAR(CAMLIDL,camlidl,$1,$2)]) + AC_DEFUN([AC_CHECK_OCAMLMKLIB], [AC_CHECK_STAR(OCAMLMKLIB,ocamlmklib,$1,$2)]) +-AC_DEFUN([AC_CHECK_MKCAMLP4], [AC_CHECK_STAR(MKCAMLP4,mkcamlp4,$1,$2)]) + AC_DEFUN([AC_CHECK_OCAMLDOC], [AC_CHECK_STAR(OCAMLDOC,ocamldoc,$1,$2)]) + AC_DEFUN([AC_CHECK_XSLTPROC], [AC_CHECK_STAR(XSLTPROC,xsltproc,$1,$2)]) + AC_DEFUN([AC_CHECK_XMLLINT], [AC_CHECK_STAR(XMLLINT,xmllint,$1,$2)]) +diff --git a/configure.in b/configure.in +index 9840d2b..3ef4c8d 100644 +--- a/configure.in ++++ b/configure.in +@@ -85,9 +85,6 @@ AC_CHECK_OCAMLOPT([],[AC_MSG_WARN(Cannot find ocamlopt, byte compilation only)]) + AC_CHECK_OCAMLLEX([],[AC_MSG_ERROR(Cannot find ocamllex.)]) + AC_CHECK_OCAMLYACC([],[AC_MSG_ERROR(Cannot find ocamlyacc.)]) + AC_CHECK_OCAMLFIND([],[AC_MSG_ERROR(Cannot find ocamlfind.)]) +-AC_CHECK_CAMLP4([],[AC_MSG_ERROR(Cannot find camlp4.)]) +-AC_CHECK_CAMLP4O([],[AC_MSG_ERROR(Cannot find camlp4o.)]) +-AC_CHECK_CAMLP4OF([],[AC_MSG_ERROR(Cannot find camlp4of.)]) + AC_CHECK_OCAMLMKLIB([],[AC_MSG_ERROR(Cannot find ocamlmklib.)]) + + if test "x$BUILD_DOC" = "xyes"; then +diff --git a/libgettext-ocaml/Makefile b/libgettext-ocaml/Makefile +index 1a155c1..e64e0a1 100644 +--- a/libgettext-ocaml/Makefile ++++ b/libgettext-ocaml/Makefile +@@ -161,22 +161,5 @@ clean:: + -$(RM) gettextCompile.mli + -$(RM) gettextMo.mli + +-######################## +-# Pa_gettext extension # +-######################## +- +-INSTALLIB += \ +- pr_gettext.cmo +- +-pr_gettext.cmo: pr_gettext.ml +- ocamlc \ +- -I +camlp4 \ +- -I $(shell ocamlc -where)/camlp4/Camlp4Parsers \ +- -pp camlp4of \ +- camlp4lib.cma \ +- gettextBase.cma \ +- gettextExtension.cma \ +- -c $< -o $@ +- + include ../ConfMakefile + include ../TopMakefile +diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml +deleted file mode 100644 +index 47d93e5..0000000 +--- a/libgettext-ocaml/pr_gettext.ml ++++ /dev/null +@@ -1,218 +0,0 @@ +-(**************************************************************************) +-(* ocaml-gettext: a library to translate messages *) +-(* *) +-(* Copyright (C) 2003-2008 Sylvain Le Gall *) +-(* *) +-(* This library is free software; you can redistribute it and/or *) +-(* modify it under the terms of the GNU Lesser General Public *) +-(* License as published by the Free Software Foundation; either *) +-(* version 2.1 of the License, or (at your option) any later version; *) +-(* with the OCaml static compilation exception. *) +-(* *) +-(* This library is distributed in the hope that it will be useful, *) +-(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) +-(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *) +-(* Lesser General Public License for more details. *) +-(* *) +-(* You should have received a copy of the GNU Lesser General Public *) +-(* License along with this library; if not, write to the Free Software *) +-(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *) +-(* USA *) +-(**************************************************************************) +- +-(** Camlp4 dumper to extract strings. +- @author Sylvain Le Gall +- @author Richard W.M. Jones (translation to OCaml 3.10.X new camlp4) +- *) +- +-(* Extract the string which should be used for a gettext translation. Output a +- po_content list through the function Marshal.to_channel +- Functions that are looked for : +-Functions Arg 1 Arg 2 Arg 3 Arg 4 Arg 5 Arg 6 ... +-s_ singular +-f_ singular +-sn_ singular plural _ +-fn_ singular plural _ +-gettext _ singular +-fgettext _ singular +-dgettext _ domain singular +-fdgettext _ domain singular +-dcgettext _ domain singular _ +-fdcgettext _ domain singular _ +-ngettext _ singular plural _ +-fngettext _ singular plural _ +-dngettext _ domain singular plural _ +-fdngettext _ domain singular plural _ +-dcngettext _ domain singular plural _ _ +-fdcngettext _ domain singular plural _ _ +- +- +-All this function name should also be matched when they are called using a +-module. +- +-*) +- +-open Format +-open GettextTypes +-open GettextPo +- +-let default_textdomain = ref None +- +-module Id = struct +- (* name is printed with the -loaded-modules switch *) +- let name = "pr_gettext" +- (* cvs id's seem to be the preferred version string *) +- let version = "$Id$" +-end +- +-module Make (Syntax : Camlp4.Sig.Camlp4Syntax) +- : Camlp4.Sig.Printer(Syntax.Ast).S = +-struct +- module Loc = Syntax.Loc +- module Ast = Syntax.Ast +- +- type t = +- { +- po_content: po_content; +- translated: SetString.t; +- } +- +- let string_of_ocaml_string str = +- Scanf.sscanf +- (Printf.sprintf "\"%s\"" str) +- "%S" +- (fun s -> s) +- +- +- let add_translation t loc ocaml_singular plural_opt domain = +- let filepos = +- Loc.file_name loc, Loc.start_line loc +- in +- let singular = +- string_of_ocaml_string ocaml_singular +- in +- let translated = +- SetString.add ocaml_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, +- { +- po_comment_special = []; +- po_comment_filepos = [filepos]; +- po_comment_translation = PoPlural([singular],[plural],[[""];[""]]); +- } +- | None -> +- translated, +- { +- po_comment_special = []; +- po_comment_filepos = [filepos]; +- po_comment_translation = PoSingular([singular],[""]); +- } +- in +- let po_content = +- match domain, !default_textdomain with +- | Some domain, _ -> +- add_po_translation_domain domain t.po_content translation +- | None, Some domain -> +- add_po_translation_domain domain t.po_content translation +- | None, None -> +- add_po_translation_no_domain t.po_content translation +- in +- {t with +- po_content = po_content; +- translated = translated} +- +- let output_translations ?output_file t = +- let fd = +- match output_file with +- | Some f -> open_out f +- | None -> stdout +- in +- Marshal.to_channel fd t.po_content [] +- +- (* Check if the given node belong to the given functions *) +- let is_like e functions = +- let rec function_name e = +- match e with +- | <:ident<$_$.$id:e$>> -> +- function_name e +- | <:ident<$lid:s$>> -> +- s +- | _ -> +- raise Not_found +- in +- try +- List.mem (function_name e) functions +- with Not_found -> +- false +- +- class visitor = object +- inherit Ast.fold as super +- +- val t = +- { +- po_content = empty_po; +- translated = SetString.empty; +- } +- +- method t = t +- +- method expr = function +- | <:expr@loc< $id:e$ $str:singular$ >> when +- is_like e ["s_"; "f_"] -> +- (* Add a singular / default domain string *) +- {< t = add_translation t loc singular None None >} +- +- | <:expr@loc< $id:e$ $str:singular$ $str:plural$ >> when +- is_like e ["sn_"; "fn_"] -> +- (* Add a plural / default domain string *) +- {< t = add_translation t loc singular (Some plural) None >} +- +- | <:expr@loc< $id:e$ $expr$ $str:singular$ >> when +- is_like e ["gettext"; "fgettext"] -> +- (* Add a singular / default domain string *) +- {< t = add_translation t loc singular None None >} +- +- | <:expr@loc< $id:e$ $expr$ $str:domain$ $str:singular$ >> when +- is_like e ["dgettext"; "fdgettext"; "dcgettext"; "fdcgettext"] -> +- (* Add a singular / defined domain string *) +- {< t = add_translation t loc singular None (Some domain) >} +- +- | <:expr@loc< $id:e$ $expr$ $str:singular$ $str:plural$ >> when +- is_like e ["ngettext"; "fngettext"] -> +- (* Add a plural / default domain string *) +- {< t = add_translation t loc singular (Some plural) None >} +- +- | <:expr@loc< $id:e$ $expr$ $str:domain$ $str:singular$ $str:plural$ >> when +- is_like e ["dngettext"; "fdngettext"; "dcngettext"; "fdcngettext"] -> +- (* Add a plural / defined domain string *) +- {< t = add_translation t loc singular (Some plural) (Some domain) >} +- +- | e -> super#expr e +- +- end +- +- (* Called on *.mli files, but cannot contain translateable strings. *) +- let print_interf ?input_file ?output_file _ = () +- +- (* Called on *.ml files. *) +- let print_implem ?input_file ?output_file ast = +- let visitor = (new visitor)#str_item in +- let t = (visitor ast)#t in +- output_translations ?output_file t +-end +- +-(* Register the new printer. *) +-module M = Camlp4.Register.OCamlPrinter(Id)(Make) ;; +- +-(* XXX How to do this? +-Pcaml.add_option "-default-textdomain" +- (Arg.String ( fun textdomain -> default_textdomain := Some textdomain ) ) +- " Defines the default textdomain" +-;; +-*) +diff --git a/ocaml-gettext/Makefile b/ocaml-gettext/Makefile +index d5f37fa..0c1199e 100644 +--- a/ocaml-gettext/Makefile ++++ b/ocaml-gettext/Makefile +@@ -61,14 +61,9 @@ install: ocaml-xgettext-install + + uninstall: ocaml-xgettext-uninstall + +-ocaml-xgettext: $(BUILDBIN) +- $(OCAMLC) \ +- -I +camlp4 dynlink.cma camlp4lib.cma \ +- `$(OCAMLFIND) query -r -predicates byte gettext.extract -i-format` \ +- `$(OCAMLFIND) query -r -predicates byte gettext.extract -a-format` \ +- `$(OCAMLFIND) query -r -predicates byte gettext.extract -o-format` \ +- Camlp4Bin.cmo \ +- -o $@ ++ocaml-xgettext: xgettext.ml ++ $(OCAMLC) -I ../libgettext-ocaml -I +compiler-libs \ ++ ocamlcommon.cma gettextBase.cma gettextExtension.cma $< -o $@ + $(INSTALL_SCRIPT) -t $(BUILDBIN) $@ + + ocaml-xgettext-install: +diff --git a/ocaml-gettext/OCamlGettext.ml b/ocaml-gettext/OCamlGettext.ml +index 837057e..d643a9b 100644 +--- a/ocaml-gettext/OCamlGettext.ml ++++ b/ocaml-gettext/OCamlGettext.ml +@@ -283,7 +283,7 @@ let () = + { + action_option = None; + extract_command = "ocaml-xgettext"; +- extract_default_option = "-I +camlp4 pa_o.cmo"; ++ extract_default_option = ""; + extract_filename_options = []; + extract_pot = "messages.pot"; + compile_output_file_option = None; +diff --git a/ocaml-gettext/xgettext.ml b/ocaml-gettext/xgettext.ml +new file mode 100644 +index 0000000..76232d8 +--- /dev/null ++++ b/ocaml-gettext/xgettext.ml +@@ -0,0 +1,228 @@ ++(**************************************************************************) ++(* ocaml-gettext: a library to translate messages *) ++(* *) ++(* Copyright (C) 2003-2008 Sylvain Le Gall *) ++(* *) ++(* This library is free software; you can redistribute it and/or *) ++(* modify it under the terms of the GNU Lesser General Public *) ++(* License as published by the Free Software Foundation; either *) ++(* version 2.1 of the License, or (at your option) any later version; *) ++(* with the OCaml static compilation exception. *) ++(* *) ++(* This library is distributed in the hope that it will be useful, *) ++(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) ++(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *) ++(* Lesser General Public License for more details. *) ++(* *) ++(* You should have received a copy of the GNU Lesser General Public *) ++(* License along with this library; if not, write to the Free Software *) ++(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *) ++(* USA *) ++(**************************************************************************) ++ ++(** PPX dumper to extract strings. ++ @author Richard W.M. Jones ++ @author Sylvain Le Gall ++ *) ++ ++(* Extract the string which should be used for a gettext translation. Output a ++ po_content list through the function Marshal.to_channel ++ Functions that are looked for : ++ ++Functions Arg 1 Arg 2 Arg 3 Arg 4 Arg 5 Arg 6 ... ++s_ singular ++f_ singular ++sn_ singular plural _ ++fn_ singular plural _ ++gettext _ singular ++fgettext _ singular ++dgettext _ domain singular ++fdgettext _ domain singular ++dcgettext _ domain singular _ ++fdcgettext _ domain singular _ ++ngettext _ singular plural _ ++fngettext _ singular plural _ ++dngettext _ domain singular plural _ ++fdngettext _ domain singular plural _ ++dcngettext _ domain singular plural _ _ ++fdcngettext _ domain singular plural _ _ ++ ++All this function name should also be matched when they are called using a ++module. ++ ++*) ++ ++open GettextTypes ++open GettextPo ++open Parsetree ++open Longident ++open Location ++ ++type t = { ++ po_content: po_content; ++ 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 t = !translations in ++ ++ let filepos = ++ let start = loc.Location.loc_start in ++ let fname = ++ match start.Lexing.pos_fname with "" -> !current_file ++ | 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 ++ 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, ++ { ++ po_comment_special = []; ++ po_comment_filepos = [filepos]; ++ po_comment_translation = PoPlural([singular],[plural],[[""];[""]]); ++ } ++ | None -> ++ translated, ++ { ++ po_comment_special = []; ++ po_comment_filepos = [filepos]; ++ po_comment_translation = PoSingular([singular],[""]); ++ } ++ in ++ let po_content = ++ match domain, !default_textdomain with ++ | Some domain, _ -> ++ add_po_translation_domain domain t.po_content translation ++ | None, Some domain -> ++ add_po_translation_domain domain t.po_content translation ++ | None, None -> ++ add_po_translation_no_domain t.po_content translation ++ in ++ ++ translations := { po_content; translated } ++ ++let output_translations ?output_file t = ++ let fd = ++ match output_file with ++ | Some f -> open_out f ++ | None -> stdout ++ in ++ Marshal.to_channel fd t.po_content [] ++ ++let rec is_like lid = function ++ | [] -> false ++ | func :: functions -> ++ match lid with ++ | Lident f ++ | Ldot (_, f) when f = func -> true ++ | _ -> is_like lid functions ++ ++let visit_expr (iterator : Ast_iterator.iterator) expr = ++ let loc = expr.pexp_loc in ++ match expr.pexp_desc with ++ | Pexp_apply ( ++ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: ++ _) ++ when is_like lid ["s_"; "f_"] -> ++ (* Add a singular / default domain string *) ++ add_translation loc singular None None ++ ++ | Pexp_apply ( ++ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (plural, _)) }) :: ++ _) ++ when is_like lid ["sn_"; "fn_"] -> ++ (* Add a plural / default domain string *) ++ add_translation loc singular (Some plural) None ++ ++ | Pexp_apply ( ++ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, ++ (_ :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: ++ _)) ++ when is_like lid ["gettext"; "fgettext"] -> ++ (* Add a singular / default domain string *) ++ add_translation loc singular None None ++ ++ | Pexp_apply ( ++ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, ++ (_ :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (domain, _)) }) :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: ++ _)) ++ when is_like lid ["dgettext"; "fdgettext"; "dcgettext"; "fdcgettext"] -> ++ (* Add a singular / defined domain string *) ++ add_translation loc singular None (Some domain) ++ ++ | Pexp_apply ( ++ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, ++ (_ :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (plural, _)) }) :: ++ _)) ++ when is_like lid ["ngettext"; "fngettext"] -> ++ (* Add a plural / default domain string *) ++ add_translation loc singular (Some plural) None ++ ++ | Pexp_apply ( ++ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, ++ (_ :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (domain, _)) }) :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: ++ (Asttypes.Nolabel, ++ { pexp_desc = Pexp_constant (Pconst_string (plural, _)) }) :: ++ _)) ++ when is_like lid ["dngettext"; "fdngettext"; "dcngettext"; "fdcngettext"] -> ++ (* Add a plural / defined domain string *) ++ add_translation loc singular (Some plural) (Some domain) ++ ++ | _ -> ++ Ast_iterator.default_iterator.expr iterator expr ++ ++let ast_iterator = ++ { Ast_iterator.default_iterator with expr = visit_expr } ++ ++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 ++ ++let () = ++ (* XXX Add -default-textdomain option which sets default_textdomain. *) ++ Arg.parse [] go ""; ++ output_translations !translations +diff --git a/test/test.ml b/test/test.ml +index bf59889..331c677 100644 +--- a/test/test.ml ++++ b/test/test.ml +@@ -353,9 +353,7 @@ let compatibility_test tests = + (*******************************************) + + let extract_test tests = +- let default_options = +- "-I +camlp4 pa_o.cmo" +- in ++ let default_options = "" in + let filename_options = + MapString.empty + in +-- +2.22.0 + diff --git a/ocaml-gettext-0.3.7-bytes-fix.patch b/ocaml-gettext-0.3.7-bytes-fix.patch deleted file mode 100644 index df1c80f..0000000 --- a/ocaml-gettext-0.3.7-bytes-fix.patch +++ /dev/null @@ -1,17 +0,0 @@ -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 733784d..605bc11 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 7%{?dist} +Release: 8%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -11,16 +11,24 @@ URL: https://github.com/gildor478/ocaml-gettext Source0: https://github.com/gildor478/%{name}/archive/%{version}.tar.gz Patch0: ocaml-gettext-0.3.4-use-ocamlopt-g.patch + +# All patches from upstream since 0.3.7 was released. In particular +# these fix immutable strings and remove the dependency on camlp4, as +# well as fixing some warnings and other minor issues. 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 +Patch0004: 0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch +Patch0005: 0005-Miscellaneous-changes-to-remove-deprecated-features.patch +Patch0006: 0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch +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 BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 +BuildRequires: ocaml-compiler-libs BuildRequires: ocaml-ocamldoc -BuildRequires: ocaml-camlp4-devel BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 BuildRequires: docbook-style-xsl BuildRequires: libxslt @@ -115,6 +123,9 @@ make all %check +# Some of these tests fail, and unfortunately the test program doesn't +# exit with a failure code. However I have examined the test failures +# together with upstream to check that there is nothing important. %if %opt %if !0%{?rhel} pushd test @@ -207,6 +218,10 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri Jul 19 2019 Richard W.M. Jones - 0.3.7-8 +- Remove camlp4 dependency. +- Add all upstream patches since 0.3.7. + * Fri Feb 01 2019 Fedora Release Engineering - 0.3.7-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 615f06a9befb0cf8b61c27a10e952af8251c859e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 19 Jul 2019 11:39:22 +0100 Subject: [PATCH 21/85] Add https://github.com/gildor478/ocaml-gettext/pull/5 --- ...tracking-and-printing-untranslated-s.patch | 2 +- ...text-stop-printing-extracted-strings.patch | 2 +- ...d-more-generated-files-to-.gitignore.patch | 2 +- ...-few-more-ignored-files-and-director.patch | 3 +- ...hanges-to-remove-deprecated-features.patch | 2 +- ...e-cpp-instead-of-camlp4-for-ifdef-ma.patch | 2 +- 0007-Fix-warnings-in-newer-OCaml.patch | 2 +- ...le-incorrect-definition-of-unit-type.patch | 2 +- ...lp4-to-ppx-for-translatable-string-e.patch | 2 +- ...-filename-when-exceptions-are-thrown.patch | 33 ++++++++++ ...attempt-to-convert-strings-from-OCam.patch | 61 +++++++++++++++++++ ocaml-gettext.spec | 8 ++- 12 files changed, 110 insertions(+), 11 deletions(-) create mode 100644 0010-xgettext-Print-filename-when-exceptions-are-thrown.patch create mode 100644 0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch diff --git a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch index 0c49ab5..3fe155b 100644 --- a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch +++ b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch @@ -1,7 +1,7 @@ From 35d2d7381c7101bb73d0b7f00fea06442c7b2ab8 Mon Sep 17 00:00:00 2001 From: Pino Toscano 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 diff --git a/0002-pr_gettext-stop-printing-extracted-strings.patch b/0002-pr_gettext-stop-printing-extracted-strings.patch index e327c2e..bcc5d8f 100644 --- a/0002-pr_gettext-stop-printing-extracted-strings.patch +++ b/0002-pr_gettext-stop-printing-extracted-strings.patch @@ -1,7 +1,7 @@ From 3f4fc73c2a0315c2da16dee7db0fcb2766f55d3c Mon Sep 17 00:00:00 2001 From: Pino Toscano 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). diff --git a/0003-add-more-generated-files-to-.gitignore.patch b/0003-add-more-generated-files-to-.gitignore.patch index 5a98d58..1fcf3a8 100644 --- a/0003-add-more-generated-files-to-.gitignore.patch +++ b/0003-add-more-generated-files-to-.gitignore.patch @@ -1,7 +1,7 @@ From 202bf1e00eaa533e133c29b509d77cdfb7c13f5e Mon Sep 17 00:00:00 2001 From: Pino Toscano 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. diff --git a/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch b/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch index a83e7de..4765db2 100644 --- a/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch +++ b/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch @@ -1,7 +1,8 @@ From b1d775dd3b59f844a89603cfcc154dd18aea6202 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" 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 ++++++++++++++----------- diff --git a/0005-Miscellaneous-changes-to-remove-deprecated-features.patch b/0005-Miscellaneous-changes-to-remove-deprecated-features.patch index 058a364..904448b 100644 --- a/0005-Miscellaneous-changes-to-remove-deprecated-features.patch +++ b/0005-Miscellaneous-changes-to-remove-deprecated-features.patch @@ -1,7 +1,7 @@ From 685abfdad5f66b8df3ddf0713f7d3ba733b56b60 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" 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. diff --git a/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch b/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch index 1ed4615..97235e4 100644 --- a/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch +++ b/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch @@ -1,7 +1,7 @@ From 2894761bcccf8d51c87f8f0470ed7514a94dca9e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" 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 diff --git a/0007-Fix-warnings-in-newer-OCaml.patch b/0007-Fix-warnings-in-newer-OCaml.patch index 409a0ce..c4cf09f 100644 --- a/0007-Fix-warnings-in-newer-OCaml.patch +++ b/0007-Fix-warnings-in-newer-OCaml.patch @@ -1,7 +1,7 @@ From 399cf541e2abde8053b7ce39650f745c8bab8c44 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" 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") -> diff --git a/0008-Fix-probable-incorrect-definition-of-unit-type.patch b/0008-Fix-probable-incorrect-definition-of-unit-type.patch index 00e0bb7..aa598be 100644 --- a/0008-Fix-probable-incorrect-definition-of-unit-type.patch +++ b/0008-Fix-probable-incorrect-definition-of-unit-type.patch @@ -1,7 +1,7 @@ From 1ac10b2d4ee97e490880dbf8e70842f771c4e02e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" 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 = () diff --git a/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch b/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch index 6358c20..3699302 100644 --- a/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch +++ b/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch @@ -1,7 +1,7 @@ From 739e3a900993299e7e8b90af3da565417eb84412 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" 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. --- diff --git a/0010-xgettext-Print-filename-when-exceptions-are-thrown.patch b/0010-xgettext-Print-filename-when-exceptions-are-thrown.patch new file mode 100644 index 0000000..3bde6c1 --- /dev/null +++ b/0010-xgettext-Print-filename-when-exceptions-are-thrown.patch @@ -0,0 +1,33 @@ +From 5030d465a8b7b8232b3559d48cf9aba592efefab Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +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 + diff --git a/0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch b/0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch new file mode 100644 index 0000000..43395cf --- /dev/null +++ b/0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch @@ -0,0 +1,61 @@ +From e15ca7b11c6da676097c1458df8306355044e817 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +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 + diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 605bc11..47d21a2 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -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 - 0.3.7-8 +* Fri Jul 19 2019 Richard W.M. Jones - 0.3.7-9 - Remove camlp4 dependency. - Add all upstream patches since 0.3.7. From 0dd81cfb7784bafbd4069c62d416ea454fa3036c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 22:53:06 +0000 Subject: [PATCH 22/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 47d21a2..4fac75d 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 9%{?dist} +Release: 10%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -222,6 +222,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 0.3.7-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Jul 19 2019 Richard W.M. Jones - 0.3.7-9 - Remove camlp4 dependency. - Add all upstream patches since 0.3.7. From c23e8f8798edce44b0f58ff96436c5ac9ffb86ad Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Aug 2019 00:00:58 +0100 Subject: [PATCH 23/85] OCaml 4.08.1 (rc2) rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 4fac75d..c1e61b6 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 10%{?dist} +Release: 11%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -222,6 +222,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Wed Jul 31 2019 Richard W.M. Jones - 0.3.7-11 +- OCaml 4.08.1 (rc2) rebuild. + * Thu Jul 25 2019 Fedora Release Engineering - 0.3.7-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From fe6194206e8496934b99efa2764ceca1c6dc450f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 16 Aug 2019 15:59:33 +0100 Subject: [PATCH 24/85] OCaml 4.08.1 (final) rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index c1e61b6..e0ff0d6 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 11%{?dist} +Release: 12%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -222,6 +222,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri Aug 16 2019 Richard W.M. Jones - 0.3.7-12 +- OCaml 4.08.1 (final) rebuild. + * Wed Jul 31 2019 Richard W.M. Jones - 0.3.7-11 - OCaml 4.08.1 (rc2) rebuild. From 4bcc0d82b60b0a66fd80eab45d235378b4ebd594 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 16 Aug 2019 16:11:26 +0100 Subject: [PATCH 25/85] Bump release and rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index e0ff0d6..fbae20f 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.7 -Release: 12%{?dist} +Release: 13%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -222,6 +222,9 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Fri Aug 16 2019 Richard W.M. Jones - 0.3.7-13 +- Bump release and rebuild. + * Fri Aug 16 2019 Richard W.M. Jones - 0.3.7-12 - OCaml 4.08.1 (final) rebuild. From 90d5b1884b3e1fccda10f02873067ca974946bc8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Oct 2019 10:27:06 +0100 Subject: [PATCH 26/85] Move to pre-release of 0.3.8. Requires dune. --- .gitignore | 1 + ...tracking-and-printing-untranslated-s.patch | 109 ---- ...text-stop-printing-extracted-strings.patch | 26 - ...d-more-generated-files-to-.gitignore.patch | 44 -- ...-few-more-ignored-files-and-director.patch | 53 -- ...hanges-to-remove-deprecated-features.patch | 64 -- ...e-cpp-instead-of-camlp4-for-ifdef-ma.patch | 106 ---- 0007-Fix-warnings-in-newer-OCaml.patch | 82 --- ...le-incorrect-definition-of-unit-type.patch | 31 - ...lp4-to-ppx-for-translatable-string-e.patch | 597 ------------------ ...-filename-when-exceptions-are-thrown.patch | 33 - ...attempt-to-convert-strings-from-OCam.patch | 61 -- ocaml-gettext-0.3.4-use-ocamlopt-g.patch | 33 - ocaml-gettext.spec | 108 +--- sources | 2 +- 15 files changed, 37 insertions(+), 1313 deletions(-) delete mode 100644 0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch delete mode 100644 0002-pr_gettext-stop-printing-extracted-strings.patch delete mode 100644 0003-add-more-generated-files-to-.gitignore.patch delete mode 100644 0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch delete mode 100644 0005-Miscellaneous-changes-to-remove-deprecated-features.patch delete mode 100644 0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch delete mode 100644 0007-Fix-warnings-in-newer-OCaml.patch delete mode 100644 0008-Fix-probable-incorrect-definition-of-unit-type.patch delete mode 100644 0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch delete mode 100644 0010-xgettext-Print-filename-when-exceptions-are-thrown.patch delete mode 100644 0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch delete mode 100644 ocaml-gettext-0.3.4-use-ocamlopt-g.patch diff --git a/.gitignore b/.gitignore index e11a1eb..4bf0b04 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ ocaml-gettext-0.3.3.tar.gz /ocaml-gettext-0.3.4.tar.gz /ocaml-gettext-0.3.5.tar.gz /0.3.7.tar.gz +/ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz diff --git a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch b/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch deleted file mode 100644 index 3fe155b..0000000 --- a/0001-pr_gettext-stop-tracking-and-printing-untranslated-s.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 35d2d7381c7101bb73d0b7f00fea06442c7b2ab8 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Tue, 29 Aug 2017 18:29:34 +0200 -Subject: [PATCH 01/11] pr_gettext: stop tracking (and printing) untranslated - strings - -Do not collect anymore the information of untranslated strings, since it -is only used to print all of them at the end of the message extraction. - -While I understand the reason why this was done (i.e. to discover -potentially untranslated user strings), this is something that just -causes lots of output in complex projects, since strings are basically -used for many non-UI tasks (say Str, Sys.command, etc), so the actual -result is that there are lots of false positive. Also, this is not -something xgettext (from GNU gettext) does. ---- - libgettext-ocaml/pr_gettext.ml | 44 ---------------------------------- - 1 file changed, 44 deletions(-) - -diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml -index c44933f..d78cf21 100644 ---- a/libgettext-ocaml/pr_gettext.ml -+++ b/libgettext-ocaml/pr_gettext.ml -@@ -71,17 +71,10 @@ struct - module Loc = Syntax.Loc - module Ast = Syntax.Ast - -- type untranslated_t = -- { -- str: string; (* Real string, not OCaml one *) -- locations: (string * int) list; (* Location in the file *) -- } -- - type t = - { - po_content: po_content; - translated: SetString.t; -- untranslated: untranslated_t MapString.t; - } - - let string_of_ocaml_string str = -@@ -91,29 +84,6 @@ struct - "%S" - (fun s -> s) - -- let string_not_translated t ocaml_str = -- not (SetString.mem ocaml_str t.translated) -- -- let add_untranslated t loc ocaml_str = -- let cur = -- try -- MapString.find ocaml_str t.untranslated -- with Not_found -> -- { -- str = string_of_ocaml_string ocaml_str; -- locations = []; -- } -- in -- let untranslated = -- MapString.add -- ocaml_str -- {cur with -- locations = -- (Loc.file_name loc, Loc.start_line loc) :: cur.locations} -- t.untranslated -- in -- {t with untranslated = untranslated} -- - - let add_translation t loc ocaml_singular plural_opt domain = - let filepos = -@@ -164,15 +134,6 @@ struct - | Some f -> open_out f - | None -> stdout - in -- MapString.iter -- (fun _ {str = str; locations = locs} -> -- List.iter -- (fun (fn, lineno) -> -- Printf.eprintf -- "%s:%d String %S not translated\n%!" -- fn lineno str) -- locs) -- t.untranslated; - Marshal.to_channel fd t.po_content [] - - (* Check if the given node belong to the given functions *) -@@ -197,7 +158,6 @@ struct - val t = - { - po_content = empty_po; -- untranslated = MapString.empty; - translated = SetString.empty; - } - -@@ -234,10 +194,6 @@ struct - (* Add a plural / defined domain string *) - {< t = add_translation t loc singular (Some plural) (Some domain) >} - -- | <:expr@loc<$str:str$>> when -- string_not_translated t str -> -- {< t = add_untranslated t loc str >} -- - | e -> super#expr e - - end --- -2.22.0 - diff --git a/0002-pr_gettext-stop-printing-extracted-strings.patch b/0002-pr_gettext-stop-printing-extracted-strings.patch deleted file mode 100644 index bcc5d8f..0000000 --- a/0002-pr_gettext-stop-printing-extracted-strings.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3f4fc73c2a0315c2da16dee7db0fcb2766f55d3c Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Tue, 29 Aug 2017 18:36:10 +0200 -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). ---- - libgettext-ocaml/pr_gettext.ml | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml -index d78cf21..47d93e5 100644 ---- a/libgettext-ocaml/pr_gettext.ml -+++ b/libgettext-ocaml/pr_gettext.ml -@@ -78,7 +78,6 @@ struct - } - - let string_of_ocaml_string str = -- prerr_endline str; - Scanf.sscanf - (Printf.sprintf "\"%s\"" str) - "%S" --- -2.22.0 - diff --git a/0003-add-more-generated-files-to-.gitignore.patch b/0003-add-more-generated-files-to-.gitignore.patch deleted file mode 100644 index 1fcf3a8..0000000 --- a/0003-add-more-generated-files-to-.gitignore.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 202bf1e00eaa533e133c29b509d77cdfb7c13f5e Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Tue, 29 Aug 2017 18:55:37 +0200 -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. ---- - .gitignore | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/.gitignore b/.gitignore -index d853d40..87821c3 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -1,3 +1,12 @@ -+*.a -+*.cma -+*.cmi -+*.cmo -+*.cmx -+*.cmxa -+*.o -+*.so -+*_parser.output - /_build/ - /setup.data - /setup.log -@@ -7,6 +16,12 @@ - /configure - /libgettext-ocaml/META - /libgettext-ocaml/gettextConfig.ml -+/libgettext-ocaml/gettextPo_parser.mli - /config.log - /config.status -+/po/*.mo - /po/fr.po.bak -+/doc/*.1 -+/doc/*.5 -+/ocaml-gettext/ocaml-gettext -+/ocaml-gettext/ocaml-xgettext --- -2.22.0 - diff --git a/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch b/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch deleted file mode 100644 index 4765db2..0000000 --- a/0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch +++ /dev/null @@ -1,53 +0,0 @@ -From b1d775dd3b59f844a89603cfcc154dd18aea6202 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 12 Jul 2019 16:12:14 +0100 -Subject: [PATCH 04/11] .gitignore: Add a few more ignored files and - directories. - ---- - .gitignore | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) - -diff --git a/.gitignore b/.gitignore -index 87821c3..59dfc69 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -7,21 +7,24 @@ - *.o - *.so - *_parser.output --/_build/ --/setup.data --/setup.log --/dist/ --/test.byte -+ - /ConfMakefile --/configure --/libgettext-ocaml/META --/libgettext-ocaml/gettextConfig.ml --/libgettext-ocaml/gettextPo_parser.mli -+/_build/ -+/autom4te.cache/ - /config.log - /config.status --/po/*.mo --/po/fr.po.bak -+/configure -+/dist/ - /doc/*.1 - /doc/*.5 -+/libgettext-ocaml/META -+/libgettext-ocaml/gettextConfig.ml -+/libgettext-ocaml/gettextMo_parser.ml -+/libgettext-ocaml/gettextPo_parser.mli - /ocaml-gettext/ocaml-gettext - /ocaml-gettext/ocaml-xgettext -+/po/*.mo -+/po/fr.po.bak -+/setup.data -+/setup.log -+/test.byte --- -2.22.0 - diff --git a/0005-Miscellaneous-changes-to-remove-deprecated-features.patch b/0005-Miscellaneous-changes-to-remove-deprecated-features.patch deleted file mode 100644 index 904448b..0000000 --- a/0005-Miscellaneous-changes-to-remove-deprecated-features.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 685abfdad5f66b8df3ddf0713f7d3ba733b56b60 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 12 Jul 2019 13:50:31 +0100 -Subject: [PATCH 05/11] Miscellaneous changes to remove deprecated features. - - - Use Bytes instead of mutable strings. - - Use String.uppercase_ascii instead of String.uppercase. ---- - libgettext-ocaml/gettextMo.ml | 4 ++-- - libgettext-ocaml/gettextMo_int32.ml | 2 +- - libgettext-ocaml/gettextMo_parser.mly | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libgettext-ocaml/gettextMo.ml b/libgettext-ocaml/gettextMo.ml -index fb395e8..246a115 100644 ---- a/libgettext-ocaml/gettextMo.ml -+++ b/libgettext-ocaml/gettextMo.ml -@@ -164,7 +164,7 @@ let input_mo_untranslated failsafe chn mo_header number = - with End_of_file -> - raise (MoInvalidStringOutOfBound(in_channel_length chn,offset_pair)) - in -- split_plural str -+ split_plural (Bytes.to_string str) - else - raise (MoInvalidStringOutOfBound(Int32.to_int mo_header.number_of_strings, number)) - ;; -@@ -183,7 +183,7 @@ let input_mo_translated failsafe chn mo_header number = - raise (MoInvalidTranslationOutOfBound - (in_channel_length chn,offset_pair)) - in -- split_plural str -+ split_plural (Bytes.to_string str) - ) - else - ( -diff --git a/libgettext-ocaml/gettextMo_int32.ml b/libgettext-ocaml/gettextMo_int32.ml -index 7490a3e..4816d83 100644 ---- a/libgettext-ocaml/gettextMo_int32.ml -+++ b/libgettext-ocaml/gettextMo_int32.ml -@@ -104,7 +104,7 @@ let input_int32_pair_string chn endian = - (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; -diff --git a/libgettext-ocaml/gettextMo_parser.mly b/libgettext-ocaml/gettextMo_parser.mly -index 95d50e3..b2e55ca 100644 ---- a/libgettext-ocaml/gettextMo_parser.mly -+++ b/libgettext-ocaml/gettextMo_parser.mly -@@ -99,7 +99,7 @@ plural_forms: - ; - - content_type: -- STRING SEMICOLON CHARSET EQUAL STRING { ($1,String.uppercase $5) } -+ STRING SEMICOLON CHARSET EQUAL STRING { ($1,String.uppercase_ascii $5) } - ; - - expr: --- -2.22.0 - diff --git a/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch b/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch deleted file mode 100644 index 97235e4..0000000 --- a/0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 2894761bcccf8d51c87f8f0470ed7514a94dca9e Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 12 Jul 2019 16:03:04 +0100 -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 -pass through cpp without error or warning. ---- - ocaml-gettext/Makefile | 4 ++-- - ocaml-gettext/OCamlGettext.ml | 33 +++++++++++++++++---------------- - 2 files changed, 19 insertions(+), 18 deletions(-) - -diff --git a/ocaml-gettext/Makefile b/ocaml-gettext/Makefile -index 3858ea8..d5f37fa 100644 ---- a/ocaml-gettext/Makefile -+++ b/ocaml-gettext/Makefile -@@ -41,12 +41,12 @@ REQUIRES = gettext.extension fileutils - - ifeq ($(GETTEXT_MODULES),CAMOMILE) - REQUIRES += gettext-camomile --INCLUDES += -pp 'camlp4o -I +camlp4 pa_macro.cmo -DCAMOMILE' -+INCLUDES += -pp 'cpp -DCAMOMILE' - endif - - ifeq ($(GETTEXT_MODULES),STUB) - REQUIRES += gettext-stub --INCLUDES += -pp 'camlp4o -I +camlp4 pa_macro.cmo -DSTUB' -+INCLUDES += -pp 'cpp -DSTUB' - endif - - include ../TopMakefile -diff --git a/ocaml-gettext/OCamlGettext.ml b/ocaml-gettext/OCamlGettext.ml -index 6e72971..837057e 100644 ---- a/ocaml-gettext/OCamlGettext.ml -+++ b/ocaml-gettext/OCamlGettext.ml -@@ -36,14 +36,15 @@ open GettextCategory;; - open GettextUtils;; - open FilePath.DefaultPath;; - --IFDEF CAMOMILE THEN -+#ifdef CAMOMILE - module OcamlGettextRealize = GettextCamomile.Open --ELSE IFDEF STUB THEN -+#else -+#ifdef STUB - module OcamlGettextRealize = GettextStub.Native --ELSE -+#else - module OcamlGettextRealize = GettextDummy.Dummy --ENDIF --ENDIF -+#endif -+#endif - ;; - - module OcamlGettext = Gettext.Program -@@ -104,12 +105,12 @@ let string_of_exception exc = - (s_ "You must specify one action.") - | InstallUninstallTooManyFilename -> - (s_ --"You cannot specify at the same time a language, a textdomain --and provide more than one file to install/uninstall : all files -+"You cannot specify at the same time a language, a textdomain\n\ -+and provide more than one file to install/uninstall : all files\n\ - will have the same destination filename.") - | CompileTooManyFilename -> - (s_ --"You cannot specify a output filename and more than one -+"You cannot specify a output filename and more than one\n\ - filename : all the compiled file will have the same output filename") - | _ -> - Gettext.string_of_exception exc -@@ -197,8 +198,8 @@ let guess_language_textdomain (language_option,textdomain_option) lst = - in - * (((chop_extension str_reduce), (get_extension str_reduce)),fl_mo)*) - raise (Failure --"FilePath suffers from a default with the handling of --chop/get_extension. This bug should disappears with -+"FilePath suffers from a default with the handling of\n\ -+chop/get_extension. This bug should disappears with\n\ - newer version of ocaml-fileutils") - ) lst - ;; -@@ -526,12 +527,12 @@ let () = - t := { !t with input_files = str :: !t.input_files } - ) - ( -- spf (f_ "%s -- --Command: ocaml-gettext -action (%s) [options] --When trying to guess language and textdomain from a --MO file, the rules applied are: language.textdomain.mo -- -+ spf (f_ "%s\n\ -+\n\ -+Command: ocaml-gettext -action (%s) [options]\n\ -+When trying to guess language and textdomain from a\n\ -+MO file, the rules applied are: language.textdomain.mo\n\ -+\n\ - Options:") - gettext_copyright - (String.concat "|" (List.map fst actions)) --- -2.22.0 - diff --git a/0007-Fix-warnings-in-newer-OCaml.patch b/0007-Fix-warnings-in-newer-OCaml.patch deleted file mode 100644 index c4cf09f..0000000 --- a/0007-Fix-warnings-in-newer-OCaml.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 399cf541e2abde8053b7ce39650f745c8bab8c44 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 18 Jul 2019 13:18:35 +0100 -Subject: [PATCH 07/11] Fix warnings in newer OCaml. - -File "../libgettext-ocaml/gettextMo.ml", line 259, characters 13-36: -259 | | Failure("lexing: empty token") -> - ^^^^^^^^^^^^^^^^^^^^^^^ -Warning 52: Code should not depend on the actual values of -this constructor's arguments. They are only for information -and may change in future versions. (See manual section 9.5) -File "../libgettext-ocaml/gettextMo.ml", line 275, characters 15-38: -275 | | Failure("lexing: empty token") -> - ^^^^^^^^^^^^^^^^^^^^^^^ -Warning 52: Code should not depend on the actual values of -this constructor's arguments. They are only for information -and may change in future versions. (See manual section 9.5) -File "../libgettext-ocaml/gettextMo.ml", line 296, characters 15-38: -296 | | Failure("lexing: empty token") -> - ^^^^^^^^^^^^^^^^^^^^^^^ -Warning 52: Code should not depend on the actual values of -this constructor's arguments. They are only for information -and may change in future versions. (See manual section 9.5) - -File "gettextStub.ml", line 101, characters 28-63: -101 | with Failure("setlocale(invalid localization)") as exc -> - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Warning 52: Code should not depend on the actual values of -this constructor's arguments. They are only for information -and may change in future versions. (See manual section 9.5) ---- - libgettext-ocaml/gettextMo.ml | 6 +++--- - libgettext-stub-ocaml/gettextStub.ml | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libgettext-ocaml/gettextMo.ml b/libgettext-ocaml/gettextMo.ml -index 246a115..22630d4 100644 ---- a/libgettext-ocaml/gettextMo.ml -+++ b/libgettext-ocaml/gettextMo.ml -@@ -256,7 +256,7 @@ let input_mo_informations failsafe chn mo_header = - GettextMo_parser.main GettextMo_lexer.token_field_name lexbuf - with - Parsing.Parse_error -- | Failure("lexing: empty token") -> -+ | Failure _ -> - fail_or_continue failsafe - (MoInvalidOptions (lexbuf,empty_translation)) - [] -@@ -272,7 +272,7 @@ let input_mo_informations failsafe chn mo_header = - GettextMo_lexer.token_field_plural_value lexbuf - with - Parsing.Parse_error -- | Failure("lexing: empty token") -> -+ | Failure _ -> - fail_or_continue - failsafe - (MoInvalidPlurals(lexbuf,field_plural_forms)) -@@ -293,7 +293,7 @@ let input_mo_informations failsafe chn mo_header = - GettextMo_lexer.token_field_content_type lexbuf - with - Parsing.Parse_error -- | Failure("lexing: empty token") -> -+ | Failure _ -> - fail_or_continue failsafe - (MoInvalidContentType(lexbuf,field_content_type)) - gettext_content -diff --git a/libgettext-stub-ocaml/gettextStub.ml b/libgettext-stub-ocaml/gettextStub.ml -index 03ac2a5..dc798a2 100644 ---- a/libgettext-stub-ocaml/gettextStub.ml -+++ b/libgettext-stub-ocaml/gettextStub.ml -@@ -98,7 +98,7 @@ module Native : GettextTypes.REALIZE_TYPE = - ( - try - GettextStubCompat.setlocale GettextStubCompat.LC_ALL language -- with Failure("setlocale(invalid localization)") as exc -> -+ with Failure _ as exc -> - let () = - fail_or_continue t.failsafe exc () - in --- -2.22.0 - diff --git a/0008-Fix-probable-incorrect-definition-of-unit-type.patch b/0008-Fix-probable-incorrect-definition-of-unit-type.patch deleted file mode 100644 index aa598be..0000000 --- a/0008-Fix-probable-incorrect-definition-of-unit-type.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 1ac10b2d4ee97e490880dbf8e70842f771c4e02e Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 18 Jul 2019 13:20:50 +0100 -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 = () - ^^^^^^^^^^^ -Warning 65: This type declaration is defining a new '()' constructor -which shadows the existing one. -Hint: Did you mean 'type u = unit'? ---- - libgettext-ocaml/gettextCharset.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libgettext-ocaml/gettextCharset.ml b/libgettext-ocaml/gettextCharset.ml -index 54cd75d..1963708 100644 ---- a/libgettext-ocaml/gettextCharset.ml -+++ b/libgettext-ocaml/gettextCharset.ml -@@ -45,7 +45,7 @@ module type CHARSET_TYPE = - module Dummy : CHARSET_TYPE = - struct - type encoding = string -- type u = () -+ type u = unit - - let create t in_enc out_enc = () - --- -2.22.0 - diff --git a/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch b/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch deleted file mode 100644 index 3699302..0000000 --- a/0009-Convert-from-camlp4-to-ppx-for-translatable-string-e.patch +++ /dev/null @@ -1,597 +0,0 @@ -From 739e3a900993299e7e8b90af3da565417eb84412 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 12 Jul 2019 16:02:16 +0100 -Subject: [PATCH 09/11] Convert from camlp4 to ppx for translatable string - extraction. - ---- - aclocal.m4 | 6 +- - configure.in | 3 - - libgettext-ocaml/Makefile | 17 --- - libgettext-ocaml/pr_gettext.ml | 218 ------------------------------- - ocaml-gettext/Makefile | 11 +- - ocaml-gettext/OCamlGettext.ml | 2 +- - ocaml-gettext/xgettext.ml | 228 +++++++++++++++++++++++++++++++++ - test/test.ml | 4 +- - 8 files changed, 234 insertions(+), 255 deletions(-) - delete mode 100644 libgettext-ocaml/pr_gettext.ml - create mode 100644 ocaml-gettext/xgettext.ml - -diff --git a/aclocal.m4 b/aclocal.m4 -index 72a27da..2a1110f 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -204,7 +204,7 @@ else - fi - ]) - --# AC_CHECK_[CAMLP4,CAMLIDL,OCAMLMKLIB,MKCAMLP4] ([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -+# AC_CHECK_[CAMLIDL,OCAMLMKLIB] ([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) - #--------------------------------------------------------- - # Subst the corresponding var - AC_DEFUN([AC_CHECK_STAR], -@@ -219,12 +219,8 @@ else - fi - AC_SUBST($1) - ]) --AC_DEFUN([AC_CHECK_CAMLP4], [AC_CHECK_STAR(CAMLP4,camlp4,$1,$2)]) --AC_DEFUN([AC_CHECK_CAMLP4OF], [AC_CHECK_STAR(CAMLP4OF,camlp4of,$1,$2)]) --AC_DEFUN([AC_CHECK_CAMLP4O], [AC_CHECK_STAR(CAMLP4O,camlp4o,$1,$2)]) - AC_DEFUN([AC_CHECK_CAMLIDL], [AC_CHECK_STAR(CAMLIDL,camlidl,$1,$2)]) - AC_DEFUN([AC_CHECK_OCAMLMKLIB], [AC_CHECK_STAR(OCAMLMKLIB,ocamlmklib,$1,$2)]) --AC_DEFUN([AC_CHECK_MKCAMLP4], [AC_CHECK_STAR(MKCAMLP4,mkcamlp4,$1,$2)]) - AC_DEFUN([AC_CHECK_OCAMLDOC], [AC_CHECK_STAR(OCAMLDOC,ocamldoc,$1,$2)]) - AC_DEFUN([AC_CHECK_XSLTPROC], [AC_CHECK_STAR(XSLTPROC,xsltproc,$1,$2)]) - AC_DEFUN([AC_CHECK_XMLLINT], [AC_CHECK_STAR(XMLLINT,xmllint,$1,$2)]) -diff --git a/configure.in b/configure.in -index 9840d2b..3ef4c8d 100644 ---- a/configure.in -+++ b/configure.in -@@ -85,9 +85,6 @@ AC_CHECK_OCAMLOPT([],[AC_MSG_WARN(Cannot find ocamlopt, byte compilation only)]) - AC_CHECK_OCAMLLEX([],[AC_MSG_ERROR(Cannot find ocamllex.)]) - AC_CHECK_OCAMLYACC([],[AC_MSG_ERROR(Cannot find ocamlyacc.)]) - AC_CHECK_OCAMLFIND([],[AC_MSG_ERROR(Cannot find ocamlfind.)]) --AC_CHECK_CAMLP4([],[AC_MSG_ERROR(Cannot find camlp4.)]) --AC_CHECK_CAMLP4O([],[AC_MSG_ERROR(Cannot find camlp4o.)]) --AC_CHECK_CAMLP4OF([],[AC_MSG_ERROR(Cannot find camlp4of.)]) - AC_CHECK_OCAMLMKLIB([],[AC_MSG_ERROR(Cannot find ocamlmklib.)]) - - if test "x$BUILD_DOC" = "xyes"; then -diff --git a/libgettext-ocaml/Makefile b/libgettext-ocaml/Makefile -index 1a155c1..e64e0a1 100644 ---- a/libgettext-ocaml/Makefile -+++ b/libgettext-ocaml/Makefile -@@ -161,22 +161,5 @@ clean:: - -$(RM) gettextCompile.mli - -$(RM) gettextMo.mli - --######################## --# Pa_gettext extension # --######################## -- --INSTALLIB += \ -- pr_gettext.cmo -- --pr_gettext.cmo: pr_gettext.ml -- ocamlc \ -- -I +camlp4 \ -- -I $(shell ocamlc -where)/camlp4/Camlp4Parsers \ -- -pp camlp4of \ -- camlp4lib.cma \ -- gettextBase.cma \ -- gettextExtension.cma \ -- -c $< -o $@ -- - include ../ConfMakefile - include ../TopMakefile -diff --git a/libgettext-ocaml/pr_gettext.ml b/libgettext-ocaml/pr_gettext.ml -deleted file mode 100644 -index 47d93e5..0000000 ---- a/libgettext-ocaml/pr_gettext.ml -+++ /dev/null -@@ -1,218 +0,0 @@ --(**************************************************************************) --(* ocaml-gettext: a library to translate messages *) --(* *) --(* Copyright (C) 2003-2008 Sylvain Le Gall *) --(* *) --(* This library is free software; you can redistribute it and/or *) --(* modify it under the terms of the GNU Lesser General Public *) --(* License as published by the Free Software Foundation; either *) --(* version 2.1 of the License, or (at your option) any later version; *) --(* with the OCaml static compilation exception. *) --(* *) --(* This library is distributed in the hope that it will be useful, *) --(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) --(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *) --(* Lesser General Public License for more details. *) --(* *) --(* You should have received a copy of the GNU Lesser General Public *) --(* License along with this library; if not, write to the Free Software *) --(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *) --(* USA *) --(**************************************************************************) -- --(** Camlp4 dumper to extract strings. -- @author Sylvain Le Gall -- @author Richard W.M. Jones (translation to OCaml 3.10.X new camlp4) -- *) -- --(* Extract the string which should be used for a gettext translation. Output a -- po_content list through the function Marshal.to_channel -- Functions that are looked for : --Functions Arg 1 Arg 2 Arg 3 Arg 4 Arg 5 Arg 6 ... --s_ singular --f_ singular --sn_ singular plural _ --fn_ singular plural _ --gettext _ singular --fgettext _ singular --dgettext _ domain singular --fdgettext _ domain singular --dcgettext _ domain singular _ --fdcgettext _ domain singular _ --ngettext _ singular plural _ --fngettext _ singular plural _ --dngettext _ domain singular plural _ --fdngettext _ domain singular plural _ --dcngettext _ domain singular plural _ _ --fdcngettext _ domain singular plural _ _ -- -- --All this function name should also be matched when they are called using a --module. -- --*) -- --open Format --open GettextTypes --open GettextPo -- --let default_textdomain = ref None -- --module Id = struct -- (* name is printed with the -loaded-modules switch *) -- let name = "pr_gettext" -- (* cvs id's seem to be the preferred version string *) -- let version = "$Id$" --end -- --module Make (Syntax : Camlp4.Sig.Camlp4Syntax) -- : Camlp4.Sig.Printer(Syntax.Ast).S = --struct -- module Loc = Syntax.Loc -- module Ast = Syntax.Ast -- -- type t = -- { -- po_content: po_content; -- translated: SetString.t; -- } -- -- let string_of_ocaml_string str = -- Scanf.sscanf -- (Printf.sprintf "\"%s\"" str) -- "%S" -- (fun s -> s) -- -- -- let add_translation t loc ocaml_singular plural_opt domain = -- let filepos = -- Loc.file_name loc, Loc.start_line loc -- in -- let singular = -- string_of_ocaml_string ocaml_singular -- in -- let translated = -- SetString.add ocaml_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, -- { -- po_comment_special = []; -- po_comment_filepos = [filepos]; -- po_comment_translation = PoPlural([singular],[plural],[[""];[""]]); -- } -- | None -> -- translated, -- { -- po_comment_special = []; -- po_comment_filepos = [filepos]; -- po_comment_translation = PoSingular([singular],[""]); -- } -- in -- let po_content = -- match domain, !default_textdomain with -- | Some domain, _ -> -- add_po_translation_domain domain t.po_content translation -- | None, Some domain -> -- add_po_translation_domain domain t.po_content translation -- | None, None -> -- add_po_translation_no_domain t.po_content translation -- in -- {t with -- po_content = po_content; -- translated = translated} -- -- let output_translations ?output_file t = -- let fd = -- match output_file with -- | Some f -> open_out f -- | None -> stdout -- in -- Marshal.to_channel fd t.po_content [] -- -- (* Check if the given node belong to the given functions *) -- let is_like e functions = -- let rec function_name e = -- match e with -- | <:ident<$_$.$id:e$>> -> -- function_name e -- | <:ident<$lid:s$>> -> -- s -- | _ -> -- raise Not_found -- in -- try -- List.mem (function_name e) functions -- with Not_found -> -- false -- -- class visitor = object -- inherit Ast.fold as super -- -- val t = -- { -- po_content = empty_po; -- translated = SetString.empty; -- } -- -- method t = t -- -- method expr = function -- | <:expr@loc< $id:e$ $str:singular$ >> when -- is_like e ["s_"; "f_"] -> -- (* Add a singular / default domain string *) -- {< t = add_translation t loc singular None None >} -- -- | <:expr@loc< $id:e$ $str:singular$ $str:plural$ >> when -- is_like e ["sn_"; "fn_"] -> -- (* Add a plural / default domain string *) -- {< t = add_translation t loc singular (Some plural) None >} -- -- | <:expr@loc< $id:e$ $expr$ $str:singular$ >> when -- is_like e ["gettext"; "fgettext"] -> -- (* Add a singular / default domain string *) -- {< t = add_translation t loc singular None None >} -- -- | <:expr@loc< $id:e$ $expr$ $str:domain$ $str:singular$ >> when -- is_like e ["dgettext"; "fdgettext"; "dcgettext"; "fdcgettext"] -> -- (* Add a singular / defined domain string *) -- {< t = add_translation t loc singular None (Some domain) >} -- -- | <:expr@loc< $id:e$ $expr$ $str:singular$ $str:plural$ >> when -- is_like e ["ngettext"; "fngettext"] -> -- (* Add a plural / default domain string *) -- {< t = add_translation t loc singular (Some plural) None >} -- -- | <:expr@loc< $id:e$ $expr$ $str:domain$ $str:singular$ $str:plural$ >> when -- is_like e ["dngettext"; "fdngettext"; "dcngettext"; "fdcngettext"] -> -- (* Add a plural / defined domain string *) -- {< t = add_translation t loc singular (Some plural) (Some domain) >} -- -- | e -> super#expr e -- -- end -- -- (* Called on *.mli files, but cannot contain translateable strings. *) -- let print_interf ?input_file ?output_file _ = () -- -- (* Called on *.ml files. *) -- let print_implem ?input_file ?output_file ast = -- let visitor = (new visitor)#str_item in -- let t = (visitor ast)#t in -- output_translations ?output_file t --end -- --(* Register the new printer. *) --module M = Camlp4.Register.OCamlPrinter(Id)(Make) ;; -- --(* XXX How to do this? --Pcaml.add_option "-default-textdomain" -- (Arg.String ( fun textdomain -> default_textdomain := Some textdomain ) ) -- " Defines the default textdomain" --;; --*) -diff --git a/ocaml-gettext/Makefile b/ocaml-gettext/Makefile -index d5f37fa..0c1199e 100644 ---- a/ocaml-gettext/Makefile -+++ b/ocaml-gettext/Makefile -@@ -61,14 +61,9 @@ install: ocaml-xgettext-install - - uninstall: ocaml-xgettext-uninstall - --ocaml-xgettext: $(BUILDBIN) -- $(OCAMLC) \ -- -I +camlp4 dynlink.cma camlp4lib.cma \ -- `$(OCAMLFIND) query -r -predicates byte gettext.extract -i-format` \ -- `$(OCAMLFIND) query -r -predicates byte gettext.extract -a-format` \ -- `$(OCAMLFIND) query -r -predicates byte gettext.extract -o-format` \ -- Camlp4Bin.cmo \ -- -o $@ -+ocaml-xgettext: xgettext.ml -+ $(OCAMLC) -I ../libgettext-ocaml -I +compiler-libs \ -+ ocamlcommon.cma gettextBase.cma gettextExtension.cma $< -o $@ - $(INSTALL_SCRIPT) -t $(BUILDBIN) $@ - - ocaml-xgettext-install: -diff --git a/ocaml-gettext/OCamlGettext.ml b/ocaml-gettext/OCamlGettext.ml -index 837057e..d643a9b 100644 ---- a/ocaml-gettext/OCamlGettext.ml -+++ b/ocaml-gettext/OCamlGettext.ml -@@ -283,7 +283,7 @@ let () = - { - action_option = None; - extract_command = "ocaml-xgettext"; -- extract_default_option = "-I +camlp4 pa_o.cmo"; -+ extract_default_option = ""; - extract_filename_options = []; - extract_pot = "messages.pot"; - compile_output_file_option = None; -diff --git a/ocaml-gettext/xgettext.ml b/ocaml-gettext/xgettext.ml -new file mode 100644 -index 0000000..76232d8 ---- /dev/null -+++ b/ocaml-gettext/xgettext.ml -@@ -0,0 +1,228 @@ -+(**************************************************************************) -+(* ocaml-gettext: a library to translate messages *) -+(* *) -+(* Copyright (C) 2003-2008 Sylvain Le Gall *) -+(* *) -+(* This library is free software; you can redistribute it and/or *) -+(* modify it under the terms of the GNU Lesser General Public *) -+(* License as published by the Free Software Foundation; either *) -+(* version 2.1 of the License, or (at your option) any later version; *) -+(* with the OCaml static compilation exception. *) -+(* *) -+(* This library is distributed in the hope that it will be useful, *) -+(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -+(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *) -+(* Lesser General Public License for more details. *) -+(* *) -+(* You should have received a copy of the GNU Lesser General Public *) -+(* License along with this library; if not, write to the Free Software *) -+(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *) -+(* USA *) -+(**************************************************************************) -+ -+(** PPX dumper to extract strings. -+ @author Richard W.M. Jones -+ @author Sylvain Le Gall -+ *) -+ -+(* Extract the string which should be used for a gettext translation. Output a -+ po_content list through the function Marshal.to_channel -+ Functions that are looked for : -+ -+Functions Arg 1 Arg 2 Arg 3 Arg 4 Arg 5 Arg 6 ... -+s_ singular -+f_ singular -+sn_ singular plural _ -+fn_ singular plural _ -+gettext _ singular -+fgettext _ singular -+dgettext _ domain singular -+fdgettext _ domain singular -+dcgettext _ domain singular _ -+fdcgettext _ domain singular _ -+ngettext _ singular plural _ -+fngettext _ singular plural _ -+dngettext _ domain singular plural _ -+fdngettext _ domain singular plural _ -+dcngettext _ domain singular plural _ _ -+fdcngettext _ domain singular plural _ _ -+ -+All this function name should also be matched when they are called using a -+module. -+ -+*) -+ -+open GettextTypes -+open GettextPo -+open Parsetree -+open Longident -+open Location -+ -+type t = { -+ po_content: po_content; -+ 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 t = !translations in -+ -+ let filepos = -+ let start = loc.Location.loc_start in -+ let fname = -+ match start.Lexing.pos_fname with "" -> !current_file -+ | 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 -+ 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, -+ { -+ po_comment_special = []; -+ po_comment_filepos = [filepos]; -+ po_comment_translation = PoPlural([singular],[plural],[[""];[""]]); -+ } -+ | None -> -+ translated, -+ { -+ po_comment_special = []; -+ po_comment_filepos = [filepos]; -+ po_comment_translation = PoSingular([singular],[""]); -+ } -+ in -+ let po_content = -+ match domain, !default_textdomain with -+ | Some domain, _ -> -+ add_po_translation_domain domain t.po_content translation -+ | None, Some domain -> -+ add_po_translation_domain domain t.po_content translation -+ | None, None -> -+ add_po_translation_no_domain t.po_content translation -+ in -+ -+ translations := { po_content; translated } -+ -+let output_translations ?output_file t = -+ let fd = -+ match output_file with -+ | Some f -> open_out f -+ | None -> stdout -+ in -+ Marshal.to_channel fd t.po_content [] -+ -+let rec is_like lid = function -+ | [] -> false -+ | func :: functions -> -+ match lid with -+ | Lident f -+ | Ldot (_, f) when f = func -> true -+ | _ -> is_like lid functions -+ -+let visit_expr (iterator : Ast_iterator.iterator) expr = -+ let loc = expr.pexp_loc in -+ match expr.pexp_desc with -+ | Pexp_apply ( -+ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: -+ _) -+ when is_like lid ["s_"; "f_"] -> -+ (* Add a singular / default domain string *) -+ add_translation loc singular None None -+ -+ | Pexp_apply ( -+ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (plural, _)) }) :: -+ _) -+ when is_like lid ["sn_"; "fn_"] -> -+ (* Add a plural / default domain string *) -+ add_translation loc singular (Some plural) None -+ -+ | Pexp_apply ( -+ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, -+ (_ :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: -+ _)) -+ when is_like lid ["gettext"; "fgettext"] -> -+ (* Add a singular / default domain string *) -+ add_translation loc singular None None -+ -+ | Pexp_apply ( -+ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, -+ (_ :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (domain, _)) }) :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: -+ _)) -+ when is_like lid ["dgettext"; "fdgettext"; "dcgettext"; "fdcgettext"] -> -+ (* Add a singular / defined domain string *) -+ add_translation loc singular None (Some domain) -+ -+ | Pexp_apply ( -+ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, -+ (_ :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (plural, _)) }) :: -+ _)) -+ when is_like lid ["ngettext"; "fngettext"] -> -+ (* Add a plural / default domain string *) -+ add_translation loc singular (Some plural) None -+ -+ | Pexp_apply ( -+ { pexp_desc = Pexp_ident ({ Asttypes.txt = lid })}, -+ (_ :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (domain, _)) }) :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _)) }) :: -+ (Asttypes.Nolabel, -+ { pexp_desc = Pexp_constant (Pconst_string (plural, _)) }) :: -+ _)) -+ when is_like lid ["dngettext"; "fdngettext"; "dcngettext"; "fdcngettext"] -> -+ (* Add a plural / defined domain string *) -+ add_translation loc singular (Some plural) (Some domain) -+ -+ | _ -> -+ Ast_iterator.default_iterator.expr iterator expr -+ -+let ast_iterator = -+ { Ast_iterator.default_iterator with expr = visit_expr } -+ -+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 -+ -+let () = -+ (* XXX Add -default-textdomain option which sets default_textdomain. *) -+ Arg.parse [] go ""; -+ output_translations !translations -diff --git a/test/test.ml b/test/test.ml -index bf59889..331c677 100644 ---- a/test/test.ml -+++ b/test/test.ml -@@ -353,9 +353,7 @@ let compatibility_test tests = - (*******************************************) - - let extract_test tests = -- let default_options = -- "-I +camlp4 pa_o.cmo" -- in -+ let default_options = "" in - let filename_options = - MapString.empty - in --- -2.22.0 - diff --git a/0010-xgettext-Print-filename-when-exceptions-are-thrown.patch b/0010-xgettext-Print-filename-when-exceptions-are-thrown.patch deleted file mode 100644 index 3bde6c1..0000000 --- a/0010-xgettext-Print-filename-when-exceptions-are-thrown.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5030d465a8b7b8232b3559d48cf9aba592efefab Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -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 - diff --git a/0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch b/0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch deleted file mode 100644 index 43395cf..0000000 --- a/0011-xgettext-Remove-attempt-to-convert-strings-from-OCam.patch +++ /dev/null @@ -1,61 +0,0 @@ -From e15ca7b11c6da676097c1458df8306355044e817 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -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 - diff --git a/ocaml-gettext-0.3.4-use-ocamlopt-g.patch b/ocaml-gettext-0.3.4-use-ocamlopt-g.patch deleted file mode 100644 index f8f05b5..0000000 --- a/ocaml-gettext-0.3.4-use-ocamlopt-g.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- ocaml-gettext-0.3.4/TopMakefile.old 2013-09-14 08:54:04.713986462 +0100 -+++ ocaml-gettext-0.3.4/TopMakefile 2013-09-14 08:54:18.319006115 +0100 -@@ -102,7 +102,7 @@ - %.cmxa %.a %.so: - $(if $(STUBSOBJS), \ - $(OCAMLMKLIB) -o $* $^ $(OCAMLMKLIB_FLAGS), \ -- $(OCAMLOPT) -a -o $*.cmxa $^ \ -+ $(OCAMLOPT) -g -a -o $*.cmxa $^ \ - ) - - %.cma %.a %.so: -@@ -161,7 +161,7 @@ - OLIBS = $(addsuffix .cmxa,$(LIBS)) - - install-buildprog-opt: $(CMX) -- $(OCAMLOPT) -o $(NAME) $(INCLUDES) -package "$(REQUIRES)" -linkpkg \ -+ $(OCAMLOPT) -g -o $(NAME) $(INCLUDES) -package "$(REQUIRES)" -linkpkg \ - -predicates "$(PREDICATES)" $(OLIBS) $(CMX) - $(INSTALL) -d $(BUILDBIN) - $(INSTALL_SCRIPT) -t $(BUILDBIN) $(NAME) -@@ -300,10 +300,10 @@ - $(OCAMLC) $(INCLUDES) $(CLI_OCAMLFIND) -c $< - - .ml.o: -- $(OCAMLOPT) $(INCLUDES) $(CLI_OCAMLFIND) -c $< -+ $(OCAMLOPT) -g $(INCLUDES) $(CLI_OCAMLFIND) -c $< - - .ml.cmx: -- $(OCAMLOPT) $(INCLUDES) $(CLI_OCAMLFIND) -c $< -+ $(OCAMLOPT) -g $(INCLUDES) $(CLI_OCAMLFIND) -c $< - - .mll.ml: - $(OCAMLLEX) $< diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index fbae20f..38bde42 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,39 +1,24 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) Name: ocaml-gettext -Version: 0.3.7 -Release: 13%{?dist} +Version: 0.3.8 +Release: 0.1.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions URL: https://github.com/gildor478/ocaml-gettext -Source0: https://github.com/gildor478/%{name}/archive/%{version}.tar.gz - -Patch0: ocaml-gettext-0.3.4-use-ocamlopt-g.patch - -# All patches from upstream since 0.3.7 was released. In particular -# these fix immutable strings and remove the dependency on camlp4, as -# well as fixing some warnings and other minor issues. -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 -Patch0004: 0004-.gitignore-Add-a-few-more-ignored-files-and-director.patch -Patch0005: 0005-Miscellaneous-changes-to-remove-deprecated-features.patch -Patch0006: 0006-ocaml-gettext-Use-cpp-instead-of-camlp4-for-ifdef-ma.patch -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 +#Source0: https://github.com/gildor478/%{name}/archive/%{version}.tar.gz +# Temporarily using a preview of 0.3.8 built from git: +# git archive --format=tar --prefix=ocaml-gettext-0.3.8/ 3aecf8e5350f | gzip > ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz +Source0: ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 BuildRequires: ocaml-compiler-libs BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 +BuildRequires: ocaml-dune-devel BuildRequires: docbook-style-xsl BuildRequires: libxslt BuildRequires: libxml2 @@ -106,59 +91,29 @@ signature files for developing applications that use %prep %setup -q -%autopatch -p1 +#autopatch -p1 -autoreconf -i +# Remove dependency on batteries. +sed -i -e 's/batteries//' test/dune +sed -i -e 's/batteries//' test/test-stub/dune %build -# Parallel builds don't work. -unset MAKEFLAGS -CFLAGS="$RPM_OPT_FLAGS" \ -./configure \ - --libdir=%{_libdir} \ -%if 0%{?rhel} - --disable-camomile \ -%else - --enable-test \ -%endif - --with-docbook-stylesheet=/usr/share/sgml/docbook/xsl-stylesheets -make all +make build -%check -# Some of these tests fail, and unfortunately the test program doesn't -# exit with a failure code. However I have examined the test failures -# together with upstream to check that there is nothing important. -%if %opt -%if !0%{?rhel} -pushd test -../_build/bin/test -popd -%endif -%endif +#check +# Tests require batteries, so they are disabled at present. +# Under discussion with upstream. %install -# make install in the package is screwed up completely. Install -# by hand instead. -export DESTDIR=$RPM_BUILD_ROOT -export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml -mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs +mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml mkdir -p $RPM_BUILD_ROOT%{_bindir} +dune install --destdir=$RPM_BUILD_ROOT -# Remove *.o files - these shouldn't be distributed. -find _build -name '*.o' -exec rm {} \; - -ocamlfind install gettext _build/lib/gettext/* -ocamlfind install gettext-stub _build/lib/gettext-stub/* -%if !0%{?rhel} -ocamlfind install gettext-camomile _build/lib/gettext-camomile/* -%endif -install -m 0755 _build/bin/ocaml-gettext $RPM_BUILD_ROOT%{_bindir}/ -install -m 0755 _build/bin/ocaml-xgettext $RPM_BUILD_ROOT%{_bindir}/ - -chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so +# Remove this, we will use our own rules for documentation. +rm -rf $RPM_BUILD_ROOT/usr/doc %files @@ -168,31 +123,34 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %if %opt %exclude %{_libdir}/ocaml/gettext/*.a %exclude %{_libdir}/ocaml/gettext/*.cmxa -%exclude %{_libdir}/ocaml/gettext/*.cmx +%exclude %{_libdir}/ocaml/gettext/*/*.a +%exclude %{_libdir}/ocaml/gettext/*/*.cmxa +%exclude %{_libdir}/ocaml/gettext/*/*.cmx %exclude %{_libdir}/ocaml/gettext-stub/*.a %exclude %{_libdir}/ocaml/gettext-stub/*.cmxa %exclude %{_libdir}/ocaml/gettext-stub/*.cmx %endif -%exclude %{_libdir}/ocaml/gettext/*.ml -%exclude %{_libdir}/ocaml/gettext/*.mli +%exclude %{_libdir}/ocaml/gettext/*/*.ml +%exclude %{_libdir}/ocaml/gettext/*/*.mli %exclude %{_libdir}/ocaml/gettext-stub/*.ml %{_libdir}/ocaml/stublibs/*.so -%{_libdir}/ocaml/stublibs/*.so.owner %files devel -%doc README CHANGELOG TODO +%doc README.md CHANGELOG THANKS TODO.md # %doc build/share/doc/html/* %if %opt %{_libdir}/ocaml/gettext/*.a %{_libdir}/ocaml/gettext/*.cmxa -%{_libdir}/ocaml/gettext/*.cmx +%{_libdir}/ocaml/gettext/*/*.a +%{_libdir}/ocaml/gettext/*/*.cmxa +%{_libdir}/ocaml/gettext/*/*.cmx %{_libdir}/ocaml/gettext-stub/*.a %{_libdir}/ocaml/gettext-stub/*.cmxa %{_libdir}/ocaml/gettext-stub/*.cmx %endif -%{_libdir}/ocaml/gettext/*.ml -%{_libdir}/ocaml/gettext/*.mli +%{_libdir}/ocaml/gettext/*/*.ml +%{_libdir}/ocaml/gettext/*/*.mli %{_libdir}/ocaml/gettext-stub/*.ml %{_bindir}/ocaml-gettext %{_bindir}/ocaml-xgettext @@ -211,7 +169,7 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %files camomile-devel -%doc README +%doc README.md %if %opt %{_libdir}/ocaml/gettext-camomile/*.a %{_libdir}/ocaml/gettext-camomile/*.cmxa @@ -222,6 +180,10 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %changelog +* Tue Oct 1 2019 Richard W.M. Jones - 0.3.8-0.1 +- Move to pre-release of 0.3.8. +- Requires dune. + * Fri Aug 16 2019 Richard W.M. Jones - 0.3.7-13 - Bump release and rebuild. diff --git a/sources b/sources index 9645c1e..f8bad04 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (0.3.7.tar.gz) = 1358320359b9d2f3fd97a47d69b2a619942a65605c1e5cbf25e33ef42a10273167b526bca15e6c9523b87d8ea9dfd3215334050ad8eb84a8c41d4feef880a27a +SHA512 (ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz) = f35f6e7a1cef84eb24f3c5ec03c8d0646dcc1151cd1182f5448b181aa765d653042eebcef148fef59643dbb38f3349b393a17d824ee74f106f537f1314fc9550 From 444987857af280f5ed83d8b8d852b95444131c2a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 6 Dec 2019 13:15:11 +0000 Subject: [PATCH 27/85] OCaml 4.09.0 (final) rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 38bde42..ca563ac 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.8 -Release: 0.1.git3aecf8e5350f%{?dist} +Release: 0.2.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -180,6 +180,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Fri Dec 06 2019 Richard W.M. Jones - 0.3.8-0.2.git3aecf8e5350f +- OCaml 4.09.0 (final) rebuild. + * Tue Oct 1 2019 Richard W.M. Jones - 0.3.8-0.1 - Move to pre-release of 0.3.8. - Requires dune. From adc12ba962dc9b57abc72fe4b52e5d3afe3eb6a0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 19 Jan 2020 16:14:28 +0000 Subject: [PATCH 28/85] OCaml 4.10.0+beta1 rebuild. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index ca563ac..0c331fe 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.8 -Release: 0.2.git3aecf8e5350f%{?dist} +Release: 0.3.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -180,6 +180,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Sun Jan 19 2020 Richard W.M. Jones - 0.3.8-0.3.git3aecf8e5350f +- OCaml 4.10.0+beta1 rebuild. + * Fri Dec 06 2019 Richard W.M. Jones - 0.3.8-0.2.git3aecf8e5350f - OCaml 4.09.0 (final) rebuild. From 315b85f79d425a228f3299ba49e29a84d7b2e3ce Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jan 2020 19:36:05 +0000 Subject: [PATCH 29/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 0c331fe..b432220 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.8 -Release: 0.3.git3aecf8e5350f%{?dist} +Release: 0.4.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -180,6 +180,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Wed Jan 29 2020 Fedora Release Engineering - 0.3.8-0.4.git3aecf8e5350f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Sun Jan 19 2020 Richard W.M. Jones - 0.3.8-0.3.git3aecf8e5350f - OCaml 4.10.0+beta1 rebuild. From 1585f8ab3f2265e9775b6b395894536a9226537c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 27 Feb 2020 09:09:16 +0000 Subject: [PATCH 30/85] OCaml 4.10.0 final. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index b432220..35cffd9 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.8 -Release: 0.4.git3aecf8e5350f%{?dist} +Release: 0.5.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -180,6 +180,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Thu Feb 27 2020 Richard W.M. Jones - 0.3.8-0.5.git3aecf8e5350f +- OCaml 4.10.0 final. + * Wed Jan 29 2020 Fedora Release Engineering - 0.3.8-0.4.git3aecf8e5350f - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 5cdc437ef65ec8c853614d525e9502617df2149e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 4 Apr 2020 12:38:37 +0100 Subject: [PATCH 31/85] Update all OCaml dependencies for RPM 4.16. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 35cffd9..f3bdf9c 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.8 -Release: 0.5.git3aecf8e5350f%{?dist} +Release: 0.6.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -180,6 +180,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Sat Apr 04 2020 Richard W.M. Jones - 0.3.8-0.6.git3aecf8e5350f +- Update all OCaml dependencies for RPM 4.16. + * Thu Feb 27 2020 Richard W.M. Jones - 0.3.8-0.5.git3aecf8e5350f - OCaml 4.10.0 final. From 342bdb083fc0b44bf39b3642e969fa10264cd410 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 21 Apr 2020 23:00:20 +0100 Subject: [PATCH 32/85] OCaml 4.11.0 pre-release attempt 2 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index f3bdf9c..4b4d12e 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.3.8 -Release: 0.6.git3aecf8e5350f%{?dist} +Release: 0.7.git3aecf8e5350f%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -180,6 +180,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Tue Apr 21 2020 Richard W.M. Jones - 0.3.8-0.7.git3aecf8e5350f +- OCaml 4.11.0 pre-release attempt 2 + * Sat Apr 04 2020 Richard W.M. Jones - 0.3.8-0.6.git3aecf8e5350f - Update all OCaml dependencies for RPM 4.16. From 983af037225d176e8d87734b36609496d22c9199 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 22 Apr 2020 10:20:06 +0100 Subject: [PATCH 33/85] New upstream version 0.4.1. Add small fix for OCaml 4.11. --- .gitignore | 1 + ...extra-Loc.t-parameter-of-Pconst_stri.patch | 86 +++++++++++++++++++ ocaml-gettext.spec | 31 ++++--- sources | 2 +- 4 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch diff --git a/.gitignore b/.gitignore index 4bf0b04..0c74f98 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ ocaml-gettext-0.3.3.tar.gz /ocaml-gettext-0.3.5.tar.gz /0.3.7.tar.gz /ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz +/v0.4.1.tar.gz diff --git a/0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch b/0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch new file mode 100644 index 0000000..54e7579 --- /dev/null +++ b/0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch @@ -0,0 +1,86 @@ +From 4bd5f21dd6b033bf8c0f1f9549255629325b86eb Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 22 Apr 2020 10:17:03 +0100 +Subject: [PATCH] xgettext: Ignore extra Loc.t parameter of Pconst_string. + +--- + src/bin/ocaml-xgettext/xgettext.ml | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/bin/ocaml-xgettext/xgettext.ml b/src/bin/ocaml-xgettext/xgettext.ml +index 3b42ac1..92ab016 100644 +--- a/src/bin/ocaml-xgettext/xgettext.ml ++++ b/src/bin/ocaml-xgettext/xgettext.ml +@@ -121,7 +121,7 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = + | Pexp_apply + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + :: _ ) + when is_like lid [ "s_"; "f_" ] -> + (* Add a singular / default domain string *) +@@ -129,9 +129,9 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = + | Pexp_apply + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) + :: _ ) + when is_like lid [ "sn_"; "fn_" ] -> + (* Add a plural / default domain string *) +@@ -140,7 +140,7 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + :: _ ) + when is_like lid [ "gettext"; "fgettext" ] -> + (* Add a singular / default domain string *) +@@ -149,9 +149,9 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } + ) + :: _ ) + when is_like lid [ "dgettext"; "fdgettext"; "dcgettext"; "fdcgettext" ] -> +@@ -161,9 +161,9 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) + :: _ ) + when is_like lid [ "ngettext"; "fngettext" ] -> + (* Add a plural / default domain string *) +@@ -172,12 +172,12 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) ++ { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ++ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } + ) + :: ( Asttypes.Nolabel, +- { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ++ { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } + ) + :: _ ) + when is_like lid [ "dngettext"; "fdngettext"; "dcngettext"; "fdcngettext" ] +-- +2.24.1 + diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 4b4d12e..6766782 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,17 +1,18 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) Name: ocaml-gettext -Version: 0.3.8 -Release: 0.7.git3aecf8e5350f%{?dist} +Version: 0.4.1 +Release: 1%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions URL: https://github.com/gildor478/ocaml-gettext -#Source0: https://github.com/gildor478/%{name}/archive/%{version}.tar.gz -# Temporarily using a preview of 0.3.8 built from git: -# git archive --format=tar --prefix=ocaml-gettext-0.3.8/ 3aecf8e5350f | gzip > ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz -Source0: ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz +Source0: https://github.com/gildor478/%{name}/archive/v%{version}.tar.gz + +# https://github.com/gildor478/ocaml-gettext/issues/8 +# Pconst_string added extra Loc.t parameter which we must ignore. +Patch1: 0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 @@ -90,8 +91,8 @@ signature files for developing applications that use %prep -%setup -q -#autopatch -p1 +%setup -q -n %{name}-%{version} +%autopatch -p1 # Remove dependency on batteries. sed -i -e 's/batteries//' test/dune @@ -117,7 +118,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %files -%doc COPYING +%doc LICENSE.txt %{_libdir}/ocaml/gettext %{_libdir}/ocaml/gettext-stub %if %opt @@ -137,7 +138,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %files devel -%doc README.md CHANGELOG THANKS TODO.md +%doc README.md CHANGES.md THANKS TODO.md # %doc build/share/doc/html/* %if %opt %{_libdir}/ocaml/gettext/*.a @@ -154,11 +155,14 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %{_libdir}/ocaml/gettext-stub/*.ml %{_bindir}/ocaml-gettext %{_bindir}/ocaml-xgettext +%{_mandir}/man1/ocaml-gettext.1* +%{_mandir}/man1/ocaml-xgettext.1* +%{_mandir}/man5/ocaml-gettext.5* %if !0%{?rhel} %files camomile -%doc COPYING +%doc LICENSE.txt %{_libdir}/ocaml/gettext-camomile %if %opt %exclude %{_libdir}/ocaml/gettext-camomile/*.a @@ -180,6 +184,11 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Wed Apr 22 2020 Richard W.M. Jones - 0.4.1-1 +- New upstream version 0.4.1. +- Add small fix for OCaml 4.11. +- Package the man pages. + * Tue Apr 21 2020 Richard W.M. Jones - 0.3.8-0.7.git3aecf8e5350f - OCaml 4.11.0 pre-release attempt 2 diff --git a/sources b/sources index f8bad04..eea02c8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz) = f35f6e7a1cef84eb24f3c5ec03c8d0646dcc1151cd1182f5448b181aa765d653042eebcef148fef59643dbb38f3349b393a17d824ee74f106f537f1314fc9550 +SHA512 (v0.4.1.tar.gz) = 52a48cdd00e16dcf3c191d400930e88c144c119eb730bfa825ad269f9a6785d5833f13cb32da3de544a12bfff104da78adec27a8172425f4b8fce6d05821ec31 From abfbcaba98e587bf65c471084981e0ef52a423a7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 5 May 2020 19:28:36 +0100 Subject: [PATCH 34/85] OCaml 4.11.0+dev2-2020-04-22 rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 6766782..a43c42a 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -184,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Tue May 05 2020 Richard W.M. Jones - 0.4.1-2 +- OCaml 4.11.0+dev2-2020-04-22 rebuild + * Wed Apr 22 2020 Richard W.M. Jones - 0.4.1-1 - New upstream version 0.4.1. - Add small fix for OCaml 4.11. From 4c6ebb0d2c1ab8f929855d1444f5c3d1b6885409 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Tue, 14 Jul 2020 13:38:48 +0000 Subject: [PATCH 35/85] Minor conditional tweak for ELN This minor conditional change allows the package to build in both Fedora Rawhide and ELN. Signed-off-by: Troy Dawson tdawson@redhat.com --- ocaml-gettext.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index a43c42a..eaa5d4a 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -25,14 +25,14 @@ BuildRequires: libxslt BuildRequires: libxml2 BuildRequires: chrpath BuildRequires: autoconf -%if !0%{?rhel} +%if !0%{?rhel} || 0%{?rhel} >= 9 BuildRequires: ocaml-ounit-devel BuildRequires: ocaml-camomile-devel >= 0.8.6-3 BuildRequires: ocaml-camomile-data %endif BuildRequires: autoconf, automake -%if !0%{?rhel} +%if !0%{?rhel} || 0%{?rhel} >= 9 # ocaml-gettext program needs camomile data files Requires: ocaml-camomile-data %endif @@ -66,7 +66,7 @@ The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. -%if !0%{?rhel} +%if !0%{?rhel} || 0%{?rhel} >= 9 %package camomile Summary: Parts of %{name} which depend on Camomile Requires: %{name} = %{version}-%{release} @@ -160,7 +160,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %{_mandir}/man5/ocaml-gettext.5* -%if !0%{?rhel} +%if !0%{?rhel} || 0%{?rhel} >= 9 %files camomile %doc LICENSE.txt %{_libdir}/ocaml/gettext-camomile From 63e8f0ee23ad7a594ff46ffe542d476aeb5e8dfe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 12:10:22 +0000 Subject: [PATCH 36/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index eaa5d4a..1cb7568 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -184,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 0.4.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue May 05 2020 Richard W.M. Jones - 0.4.1-2 - OCaml 4.11.0+dev2-2020-04-22 rebuild From a5d8503b6cd6388f53e00cc753234532835e5ea5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 21 Aug 2020 19:25:17 +0100 Subject: [PATCH 37/85] OCaml 4.11.0 rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 1cb7568..9f30e3b 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -184,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Fri Aug 21 2020 Richard W.M. Jones - 0.4.1-4 +- OCaml 4.11.0 rebuild + * Tue Jul 28 2020 Fedora Release Engineering - 0.4.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 37a45eb371bfc8d4e482820fba21dcce524f30e8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 1 Sep 2020 21:44:35 +0100 Subject: [PATCH 38/85] OCaml 4.11.1 rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 9f30e3b..762fa54 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -184,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Tue Sep 01 2020 Richard W.M. Jones - 0.4.1-5 +- OCaml 4.11.1 rebuild + * Fri Aug 21 2020 Richard W.M. Jones - 0.4.1-4 - OCaml 4.11.0 rebuild From 760c114fb65b1091905ad58fb132f49f142eb568 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 7 Jan 2021 06:14:07 +0000 Subject: [PATCH 39/85] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- ocaml-gettext.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 762fa54..f17eb5c 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -14,6 +14,7 @@ Source0: https://github.com/gildor478/%{name}/archive/v%{version}.tar.gz # Pconst_string added extra Loc.t parameter which we must ignore. Patch1: 0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch +BuildRequires: make BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 BuildRequires: ocaml-compiler-libs From 5a7f369f0592b3b50645fb5fb39c7b8fd222583e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 21:58:04 +0000 Subject: [PATCH 40/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index f17eb5c..52ca07b 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -185,6 +185,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 0.4.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Sep 01 2020 Richard W.M. Jones - 0.4.1-5 - OCaml 4.11.1 rebuild From 62f14e30bbffd82e68dd7f70d3ae8751536bfaa9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Feb 2021 11:52:05 +0000 Subject: [PATCH 41/85] Bump and rebuild for updated ocaml-camomile. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 52ca07b..de1f3c0 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -185,6 +185,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Mon Feb 1 2021 Richard W.M. Jones - 0.4.1-7 +- Bump and rebuild for updated ocaml-camomile. + * Tue Jan 26 2021 Fedora Release Engineering - 0.4.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 886cd64b70c386aa44cb92b1c8a5806643846aa8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 24 Feb 2021 17:10:14 +0000 Subject: [PATCH 42/85] Revert "Minor conditional tweak for ELN" Don't pull in camomile on RHEL 9. This reverts commit 4c6ebb0d2c1ab8f929855d1444f5c3d1b6885409. --- ocaml-gettext.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index de1f3c0..cebdc98 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -26,14 +26,14 @@ BuildRequires: libxslt BuildRequires: libxml2 BuildRequires: chrpath BuildRequires: autoconf -%if !0%{?rhel} || 0%{?rhel} >= 9 +%if !0%{?rhel} BuildRequires: ocaml-ounit-devel BuildRequires: ocaml-camomile-devel >= 0.8.6-3 BuildRequires: ocaml-camomile-data %endif BuildRequires: autoconf, automake -%if !0%{?rhel} || 0%{?rhel} >= 9 +%if !0%{?rhel} # ocaml-gettext program needs camomile data files Requires: ocaml-camomile-data %endif @@ -67,7 +67,7 @@ The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. -%if !0%{?rhel} || 0%{?rhel} >= 9 +%if !0%{?rhel} %package camomile Summary: Parts of %{name} which depend on Camomile Requires: %{name} = %{version}-%{release} @@ -161,7 +161,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %{_mandir}/man5/ocaml-gettext.5* -%if !0%{?rhel} || 0%{?rhel} >= 9 +%if !0%{?rhel} %files camomile %doc LICENSE.txt %{_libdir}/ocaml/gettext-camomile From bdcd1e64d0a8d2a6188c6140b513dec99cef1e4e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 24 Feb 2021 17:10:54 +0000 Subject: [PATCH 43/85] Remove ocaml-camomile dep on RHEL 9. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index cebdc98..7a95991 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -185,6 +185,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Wed Feb 24 2021 Richard W.M. Jones - 0.4.1-8 +- Remove ocaml-camomile dep on RHEL 9. + * Mon Feb 1 2021 Richard W.M. Jones - 0.4.1-7 - Bump and rebuild for updated ocaml-camomile. From de9a5f05d2ebe73887426bbb6781d9b3fd43d4ad Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Mar 2021 23:22:36 +0000 Subject: [PATCH 44/85] OCaml 4.12.0 build --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 7a95991..adaae10 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -2,7 +2,7 @@ Name: ocaml-gettext Version: 0.4.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -185,6 +185,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Mon Mar 1 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.1-9 +- OCaml 4.12.0 build + * Wed Feb 24 2021 Richard W.M. Jones - 0.4.1-8 - Remove ocaml-camomile dep on RHEL 9. From f897bfaf0f2708a414a7849e1e15eeedd625920c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 2 Mar 2021 09:23:41 +0000 Subject: [PATCH 45/85] Remove *.a from %files, no longer built. --- ocaml-gettext.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index adaae10..4dbf22e 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -123,7 +123,6 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %{_libdir}/ocaml/gettext %{_libdir}/ocaml/gettext-stub %if %opt -%exclude %{_libdir}/ocaml/gettext/*.a %exclude %{_libdir}/ocaml/gettext/*.cmxa %exclude %{_libdir}/ocaml/gettext/*/*.a %exclude %{_libdir}/ocaml/gettext/*/*.cmxa @@ -142,7 +141,6 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %doc README.md CHANGES.md THANKS TODO.md # %doc build/share/doc/html/* %if %opt -%{_libdir}/ocaml/gettext/*.a %{_libdir}/ocaml/gettext/*.cmxa %{_libdir}/ocaml/gettext/*/*.a %{_libdir}/ocaml/gettext/*/*.cmxa From bbab508ca26e737b3b3678e91f8f69350970db2e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 2 Mar 2021 09:25:07 +0000 Subject: [PATCH 46/85] New upstream version 4.2 Remove patch now upstream. --- .gitignore | 1 + ...extra-Loc.t-parameter-of-Pconst_stri.patch | 86 ------------------- ocaml-gettext.spec | 14 +-- sources | 2 +- 4 files changed, 9 insertions(+), 94 deletions(-) delete mode 100644 0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch diff --git a/.gitignore b/.gitignore index 0c74f98..9bcf330 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ ocaml-gettext-0.3.3.tar.gz /0.3.7.tar.gz /ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz /v0.4.1.tar.gz +/v0.4.2.tar.gz diff --git a/0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch b/0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch deleted file mode 100644 index 54e7579..0000000 --- a/0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 4bd5f21dd6b033bf8c0f1f9549255629325b86eb Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 22 Apr 2020 10:17:03 +0100 -Subject: [PATCH] xgettext: Ignore extra Loc.t parameter of Pconst_string. - ---- - src/bin/ocaml-xgettext/xgettext.ml | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/bin/ocaml-xgettext/xgettext.ml b/src/bin/ocaml-xgettext/xgettext.ml -index 3b42ac1..92ab016 100644 ---- a/src/bin/ocaml-xgettext/xgettext.ml -+++ b/src/bin/ocaml-xgettext/xgettext.ml -@@ -121,7 +121,7 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = - | Pexp_apply - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - :: _ ) - when is_like lid [ "s_"; "f_" ] -> - (* Add a singular / default domain string *) -@@ -129,9 +129,9 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = - | Pexp_apply - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) - :: _ ) - when is_like lid [ "sn_"; "fn_" ] -> - (* Add a plural / default domain string *) -@@ -140,7 +140,7 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - :: _ ) - when is_like lid [ "gettext"; "fgettext" ] -> - (* Add a singular / default domain string *) -@@ -149,9 +149,9 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } - ) - :: _ ) - when is_like lid [ "dgettext"; "fdgettext"; "dcgettext"; "fdcgettext" ] -> -@@ -161,9 +161,9 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) - :: _ ) - when is_like lid [ "ngettext"; "fngettext" ] -> - (* Add a plural / default domain string *) -@@ -172,12 +172,12 @@ let visit_expr (iterator : Ast_iterator.iterator) expr = - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) -+ { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } -+ { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } - ) - :: ( Asttypes.Nolabel, -- { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } -+ { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } - ) - :: _ ) - when is_like lid [ "dngettext"; "fdngettext"; "dcngettext"; "fdcngettext" ] --- -2.24.1 - diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 4dbf22e..123c2b9 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,8 +1,8 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) Name: ocaml-gettext -Version: 0.4.1 -Release: 9%{?dist} +Version: 0.4.2 +Release: 1%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -10,11 +10,7 @@ URL: https://github.com/gildor478/ocaml-gettext Source0: https://github.com/gildor478/%{name}/archive/v%{version}.tar.gz -# https://github.com/gildor478/ocaml-gettext/issues/8 -# Pconst_string added extra Loc.t parameter which we must ignore. -Patch1: 0001-xgettext-Ignore-extra-Loc.t-parameter-of-Pconst_stri.patch - -BuildRequires: make +BuildRequires: make BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 BuildRequires: ocaml-compiler-libs @@ -183,6 +179,10 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Tue Mar 2 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-1 +- New upstream version 4.2 +- Remove patch now upstream. + * Mon Mar 1 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.1-9 - OCaml 4.12.0 build diff --git a/sources b/sources index eea02c8..7317e8d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.4.1.tar.gz) = 52a48cdd00e16dcf3c191d400930e88c144c119eb730bfa825ad269f9a6785d5833f13cb32da3de544a12bfff104da78adec27a8172425f4b8fce6d05821ec31 +SHA512 (v0.4.2.tar.gz) = fb89be8d8d9e0ed9327b81a0c81c884ff3f1a97e46b475ef8084abded5c84a256de05d5aa0f42be94f43ab438276a4506af726b6950e4161359a9616fb5832ec From 88f69932ac2c0b2ff2bdd8c71f0d2d6dddd98ef3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 2 Mar 2021 09:41:38 +0000 Subject: [PATCH 47/85] Add BR cppo --- ocaml-gettext.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 123c2b9..41c6f98 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -17,6 +17,7 @@ BuildRequires: ocaml-compiler-libs BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 BuildRequires: ocaml-dune-devel +BuildRequires: ocaml-cppo BuildRequires: docbook-style-xsl BuildRequires: libxslt BuildRequires: libxml2 @@ -182,6 +183,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc * Tue Mar 2 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-1 - New upstream version 4.2 - Remove patch now upstream. +- BR ocaml-cppo * Mon Mar 1 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.1-9 - OCaml 4.12.0 build From ab4b47dc0def66aa6635af2ad70cc7dc3d8e827e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 8 Mar 2021 11:56:27 +0000 Subject: [PATCH 48/85] Better handling of optional camomile subpackage. Remove camomile from dune files on RHEL. Fixes: commit bdcd1e64d0a8d2a6188c6140b513dec99cef1e4e --- ocaml-gettext.spec | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 41c6f98..3de4398 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,8 +1,15 @@ %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) +# Optionally disable camomile dep on RHEL. +%if !0%{?rhel} +%bcond_without camomile +%else +%bcond_with camomile +%endif + Name: ocaml-gettext Version: 0.4.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -25,12 +32,14 @@ BuildRequires: chrpath BuildRequires: autoconf %if !0%{?rhel} BuildRequires: ocaml-ounit-devel +%endif +%if %{with camomile} BuildRequires: ocaml-camomile-devel >= 0.8.6-3 BuildRequires: ocaml-camomile-data %endif BuildRequires: autoconf, automake -%if !0%{?rhel} +%if %{with camomile} # ocaml-gettext program needs camomile data files Requires: ocaml-camomile-data %endif @@ -64,7 +73,7 @@ The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. -%if !0%{?rhel} +%if %{with camomile} %package camomile Summary: Parts of %{name} which depend on Camomile Requires: %{name} = %{version}-%{release} @@ -96,6 +105,13 @@ signature files for developing applications that use sed -i -e 's/batteries//' test/dune sed -i -e 's/batteries//' test/test-stub/dune +%if %{without camomile} +# Remove dependency on camomile. +rm -r src/lib/gettext-camomile +rm -r test/test-camomile +sed -i -e 's/camomile//' `find -name dune` +%endif + %build make build @@ -114,6 +130,12 @@ dune install --destdir=$RPM_BUILD_ROOT # Remove this, we will use our own rules for documentation. rm -rf $RPM_BUILD_ROOT/usr/doc +%if %{without camomile} +# If you use --without camomile but happen to have the camomile +# packages installed then it will still build them. +rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile +%endif + %files %doc LICENSE.txt @@ -156,7 +178,7 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %{_mandir}/man5/ocaml-gettext.5* -%if !0%{?rhel} +%if %{with camomile} %files camomile %doc LICENSE.txt %{_libdir}/ocaml/gettext-camomile @@ -180,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT/usr/doc %changelog +* Mon Mar 8 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-2 +- Better handling of optional camomile subpackage. + * Tue Mar 2 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-1 - New upstream version 4.2 - Remove patch now upstream. From e1fc634549ecc91031038a1f272eab22ed54b839 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 30 Mar 2021 16:18:37 +0100 Subject: [PATCH 49/85] Bump and rebuild for ELN. --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 3de4398..8896873 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -9,7 +9,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Tue Mar 30 2021 Richard W.M. Jones - 0.4.2-3 +- Bump and rebuild for ELN. + * Mon Mar 8 23:22:35 GMT 2021 Richard W.M. Jones - 0.4.2-2 - Better handling of optional camomile subpackage. From e5a78c182a467d4858ab2f0fe67909d4c86dc179 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 16:38:20 +0000 Subject: [PATCH 50/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 8896873..a1131af 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -9,7 +9,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 0.4.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Mar 30 2021 Richard W.M. Jones - 0.4.2-3 - Bump and rebuild for ELN. From f4dba8412f9fddf1dc1967b4347903eae9ca805b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 5 Oct 2021 10:43:15 +0100 Subject: [PATCH 51/85] OCaml 4.13.1 build --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index a1131af..8bf470d 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -9,7 +9,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Tue Oct 05 2021 Richard W.M. Jones - 0.4.2-5 +- OCaml 4.13.1 build + * Thu Jul 22 2021 Fedora Release Engineering - 0.4.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From f1a555e8965b4f2f63788005e7860d923607a88d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 21:44:42 +0000 Subject: [PATCH 52/85] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 8bf470d..31b25dd 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -9,7 +9,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 0.4.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Oct 05 2021 Richard W.M. Jones - 0.4.2-5 - OCaml 4.13.1 build From 6e7db6b36141ebfadbbf314c2f2e93d3c19969e7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Feb 2022 16:27:00 +0000 Subject: [PATCH 53/85] OCaml 4.13.1 rebuild to remove package notes --- ocaml-gettext.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 31b25dd..373a713 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,3 +1,4 @@ +%undefine _package_note_flags %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) # Optionally disable camomile dep on RHEL. @@ -9,7 +10,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -202,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Fri Feb 04 2022 Richard W.M. Jones - 0.4.2-7 +- OCaml 4.13.1 rebuild to remove package notes + * Thu Jan 20 2022 Fedora Release Engineering - 0.4.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 888ea3b3e4d23bdcd031786cdf7b957a47b0f31a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 19 Jun 2022 11:41:09 +0100 Subject: [PATCH 54/85] OCaml 4.14.0 rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 373a713..f4839aa 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -10,7 +10,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Sun Jun 19 2022 Richard W.M. Jones - 0.4.2-8 +- OCaml 4.14.0 rebuild + * Fri Feb 04 2022 Richard W.M. Jones - 0.4.2-7 - OCaml 4.13.1 rebuild to remove package notes From dcad2f9406cae0aa3e26a587c9b3604b6137c83c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 01:14:42 +0000 Subject: [PATCH 55/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index f4839aa..8b0f0e6 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -10,7 +10,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 8%{?dist} +Release: 9%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 0.4.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sun Jun 19 2022 Richard W.M. Jones - 0.4.2-8 - OCaml 4.14.0 rebuild From 0644491c2fd837f949f8f84b060bd322ed07b446 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 22:08:50 +0000 Subject: [PATCH 56/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 8b0f0e6..f254a12 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -10,7 +10,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 0.4.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Fri Jul 22 2022 Fedora Release Engineering - 0.4.2-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From dbaf614c0e98be32e884bbf032925cb15a8e41c7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jan 2023 17:53:58 +0000 Subject: [PATCH 57/85] Rebuild OCaml packages for F38 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index f254a12..595810d 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -10,7 +10,7 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 10%{?dist} +Release: 11%{?dist} Summary: OCaml library for i18n License: LGPLv2+ with exceptions @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %changelog +* Tue Jan 24 2023 Richard W.M. Jones - 0.4.2-11 +- Rebuild OCaml packages for F38 + * Thu Jan 19 2023 Fedora Release Engineering - 0.4.2-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 6e43115a41efe6e039ce4b6064edbdc8300b433d Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 10 Jul 2023 22:27:54 -0600 Subject: [PATCH 58/85] OCaml 5.0.0 rebuild Other changes: - Convert License tag to SPDX - Enable tests - Use new dune macros --- ocaml-gettext-camomile2.patch | 11 +++ ocaml-gettext-ocaml5.patch | 152 ++++++++++++++++++++++++++++++++++ ocaml-gettext.spec | 132 +++++++++-------------------- 3 files changed, 202 insertions(+), 93 deletions(-) create mode 100644 ocaml-gettext-camomile2.patch create mode 100644 ocaml-gettext-ocaml5.patch diff --git a/ocaml-gettext-camomile2.patch b/ocaml-gettext-camomile2.patch new file mode 100644 index 0000000..a5ffd39 --- /dev/null +++ b/ocaml-gettext-camomile2.patch @@ -0,0 +1,11 @@ +--- ocaml-gettext-0.4.2/src/lib/gettext-camomile/gettextCamomile.ml.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/src/lib/gettext-camomile/gettextCamomile.ml 2023-06-22 13:41:46.930127479 -0600 +@@ -20,7 +20,7 @@ + (* USA *) + (**************************************************************************) + +-open CamomileLibraryDefault.Camomile ++open Camomile + open GettextTypes + + (** Error reported when something goes wrong during Camomile initialization. diff --git a/ocaml-gettext-ocaml5.patch b/ocaml-gettext-ocaml5.patch new file mode 100644 index 0000000..cbdf21b --- /dev/null +++ b/ocaml-gettext-ocaml5.patch @@ -0,0 +1,152 @@ +--- ocaml-gettext-0.4.2/gettext-camomile.opam.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/gettext-camomile.opam 2023-06-22 13:31:24.299464751 -0600 +@@ -19,9 +19,8 @@ depends: [ + "ocaml" {>= "4.03.0"} + "dune" {>= "1.11.0"} + "camomile" +- "base-bytes" + "gettext" {= version} +- "ounit" {with-test & > "2.0.8"} ++ "ounit2" {with-test & > "2.2.6"} + "fileutils" {with-test} + ] + synopsis: "Internationalization library using camomile (i18n)" +--- ocaml-gettext-0.4.2/gettext.opam.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/gettext.opam 2023-06-22 13:30:52.810938219 -0600 +@@ -20,8 +20,7 @@ depends: [ + "dune" {>= "1.11.0"} + "cppo" {build} + "fileutils" +- "base-bytes" +- "ounit" {with-test & > "2.0.8"} ++ "ounit2" {with-test & > "2.2.6"} + ] + synopsis: "Internationalization library (i18n)" + description:""" +--- ocaml-gettext-0.4.2/gettext-stub.opam.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/gettext-stub.opam 2023-06-22 13:32:14.938703327 -0600 +@@ -19,9 +19,8 @@ depends: [ + "ocaml" {>= "4.03.0"} + "dune" {>= "1.11.0"} + "dune-configurator" +- "base-bytes" + "gettext" {= version} +- "ounit" {with-test & > "2.0.8"} ++ "ounit2" {with-test & > "2.2.6"} + "fileutils" {with-test} + ] + depexts: [ +--- ocaml-gettext-0.4.2/src/lib/gettext-stub/gettextStubCompat_stubs.c.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/src/lib/gettext-stub/gettextStubCompat_stubs.c 2023-06-22 13:33:17.080769220 -0600 +@@ -76,7 +76,7 @@ CAMLprim value gettextStubCompat_gettext + value v_msgid) + { + CAMLparam1(v_msgid); +- CAMLreturn(copy_string(gettext(String_val(v_msgid)))); ++ CAMLreturn(caml_copy_string(gettext(String_val(v_msgid)))); + } + + CAMLprim value gettextStubCompat_dgettext( +@@ -85,7 +85,7 @@ CAMLprim value gettextStubCompat_dgettex + { + CAMLparam2(v_domainname, v_msgid); + CAMLreturn( +- copy_string( ++ caml_copy_string( + dgettext( + String_val(v_domainname), + String_val(v_msgid)))); +@@ -98,7 +98,7 @@ CAMLprim value gettextStubCompat_dcgette + { + CAMLparam3(v_domainname, v_msgid, v_category); + CAMLreturn( +- copy_string( ++ caml_copy_string( + dcgettext( + String_val(v_domainname), + String_val(v_msgid), +@@ -112,7 +112,7 @@ CAMLprim value gettextStubCompat_ngettex + { + CAMLparam3(v_msgid1, v_msgid2, v_n); + CAMLreturn( +- copy_string( ++ caml_copy_string( + ngettext( + String_val(v_msgid1), + String_val(v_msgid2), +@@ -127,7 +127,7 @@ CAMLprim value gettextStubCompat_dngette + { + CAMLparam4(v_domainname, v_msgid1, v_msgid2, v_n); + CAMLreturn( +- copy_string( ++ caml_copy_string( + dngettext( + String_val(v_domainname), + String_val(v_msgid1), +@@ -158,7 +158,7 @@ CAMLprim value gettextStubCompat_dcngett + "NULL string not expected at "STRINGIFY(__LINE__)" in "__FILE__); + }; + +- CAMLreturn(copy_string(res)); ++ CAMLreturn(caml_copy_string(res)); + } + + CAMLprim value gettextStubCompat_textdomain( +--- ocaml-gettext-0.4.2/test/common/dune.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/test/common/dune 2023-06-22 13:33:50.049275086 -0600 +@@ -1,3 +1,3 @@ + (library + (name common) +- (libraries gettext.base oUnit)) ++ (libraries gettext.base ounit2)) +--- ocaml-gettext-0.4.2/test/dune.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/test/dune 2023-06-22 13:34:09.487983748 -0600 +@@ -6,7 +6,7 @@ + ../src/bin/ocaml-xgettext/xgettext.exe + (glob_files testdata/*) + (glob_files testdata/fr_FR/LC_MESSAGES/*)) +- (libraries oUnit str fileutils gettext.extension common) ++ (libraries ounit2 str fileutils gettext.extension common) + (action + (run %{test} + -runner sequential +--- ocaml-gettext-0.4.2/test/test-camomile/dune.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/test/test-camomile/dune 2023-06-22 13:34:24.840753623 -0600 +@@ -4,6 +4,6 @@ + (deps + (glob_files testdata/*) + (glob_files ../testdata/fr_FR/LC_MESSAGES/*)) +- (libraries common gettext-camomile oUnit fileutils) ++ (libraries common gettext-camomile ounit2 fileutils) + (action + (run %{test} -test-dir ../testdata))) +--- ocaml-gettext-0.4.2/test/test.ml.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/test/test.ml 2023-06-22 13:35:08.719095972 -0600 +@@ -221,7 +221,7 @@ let install_test = + Printf.sprintf "%s warning" fl_mo >:: fun ctxt -> + let tests = make_tests ctxt in + let out = Buffer.create 13 in +- let capture_out strm = Stream.iter (Buffer.add_char out) strm in ++ let capture_out strm = Seq.iter (Buffer.add_char out) strm in + let fl_mo = concat tests.test_dir fl_mo in + let fl_dst = make_filename (tests.install_dir :: fl_dsts) in + assert_command +@@ -392,7 +392,7 @@ let compile_ocaml = + [] + in + let out = Buffer.create 13 in +- let capture_out strm = Stream.iter (Buffer.add_char out) strm in ++ let capture_out strm = Seq.iter (Buffer.add_char out) strm in + let match_exp_err = Str.regexp (".*"^(Str.quote exp_err)^".*") in + assert_command + ~exit_code:(Unix.WEXITED exp_return_code) +--- ocaml-gettext-0.4.2/test/test-stub/dune.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/test/test-stub/dune 2023-06-22 13:34:43.239477852 -0600 +@@ -4,6 +4,6 @@ + (deps + (glob_files ../testdata/*) + (glob_files ../testdata/fr_FR/LC_MESSAGES/*)) +- (libraries common gettext-stub oUnit) ++ (libraries common gettext-stub ounit2) + (action + (run %{test} -test-dir ../testdata))) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 595810d..79be2a3 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,6 +1,3 @@ -%undefine _package_note_flags -%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) - # Optionally disable camomile dep on RHEL. %if !0%{?rhel} %bcond_without camomile @@ -10,27 +7,28 @@ Name: ocaml-gettext Version: 0.4.2 -Release: 11%{?dist} +Release: 12%{?dist} Summary: OCaml library for i18n -License: LGPLv2+ with exceptions +License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception URL: https://github.com/gildor478/ocaml-gettext Source0: https://github.com/gildor478/%{name}/archive/v%{version}.tar.gz -BuildRequires: make -BuildRequires: ocaml >= 4.00.1 -BuildRequires: ocaml-findlib-devel >= 1.3.3-3 -BuildRequires: ocaml-compiler-libs -BuildRequires: ocaml-ocamldoc +# Updates for OCaml 5. Based in part on +# https://github.com/gildor478/ocaml-gettext/pull/24 +Patch0: %{name}-ocaml5.patch +# Adapt to changes in camomile 2.0 +Patch1: %{name}-camomile2.patch + +BuildRequires: ocaml >= 4.03.0 BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 -BuildRequires: ocaml-dune-devel +BuildRequires: ocaml-dune >= 1.11.0 +BuildRequires: ocaml-dune-configurator-devel BuildRequires: ocaml-cppo BuildRequires: docbook-style-xsl BuildRequires: libxslt BuildRequires: libxml2 -BuildRequires: chrpath -BuildRequires: autoconf %if !0%{?rhel} BuildRequires: ocaml-ounit-devel %endif @@ -38,16 +36,12 @@ BuildRequires: ocaml-ounit-devel BuildRequires: ocaml-camomile-devel >= 0.8.6-3 BuildRequires: ocaml-camomile-data %endif -BuildRequires: autoconf, automake %if %{with camomile} # ocaml-gettext program needs camomile data files Requires: ocaml-camomile-data %endif -%global __ocaml_requires_opts -i Asttypes -i Parsetree -%global __ocaml_provides_opts -i Pr_gettext - %description Ocaml-gettext provides support for internationalization of Ocaml @@ -63,10 +57,10 @@ Constraints : %package devel Summary: Development files for %{name} -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} # BZ 446919. -Requires: ocaml-fileutils-devel >= 0.4.0 +Requires: ocaml-fileutils-devel%{?_isa} >= 0.4.0 %description devel @@ -77,7 +71,7 @@ developing applications that use %{name}. %if %{with camomile} %package camomile Summary: Parts of %{name} which depend on Camomile -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} %description camomile @@ -87,8 +81,9 @@ depend on Camomile. %package camomile-devel Summary: Development files for %{name}-camomile -Requires: %{name}-devel = %{version}-%{release} -Requires: %{name}-camomile = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Requires: %{name}-camomile%{?_isa} = %{version}-%{release} +Requires: ocaml-camomile-devel%{?_isa} %description camomile-devel @@ -99,12 +94,7 @@ signature files for developing applications that use %prep -%setup -q -n %{name}-%{version} -%autopatch -p1 - -# Remove dependency on batteries. -sed -i -e 's/batteries//' test/dune -sed -i -e 's/batteries//' test/test-stub/dune +%autosetup -p1 %if %{without camomile} # Remove dependency on camomile. @@ -115,63 +105,26 @@ sed -i -e 's/camomile//' `find -name dune` %build -make build - - -#check -# Tests require batteries, so they are disabled at present. -# Under discussion with upstream. +%dune_build %install -mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml -mkdir -p $RPM_BUILD_ROOT%{_bindir} -dune install --destdir=$RPM_BUILD_ROOT - -# Remove this, we will use our own rules for documentation. -rm -rf $RPM_BUILD_ROOT/usr/doc - -%if %{without camomile} -# If you use --without camomile but happen to have the camomile -# packages installed then it will still build them. -rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile -%endif +%dune_install -s +sed -i '\@%{_bindir}@d;\@%{_mandir}@d' .ofiles-gettext +cat .ofiles-gettext-stub >> .ofiles-gettext +cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel -%files -%doc LICENSE.txt -%{_libdir}/ocaml/gettext -%{_libdir}/ocaml/gettext-stub -%if %opt -%exclude %{_libdir}/ocaml/gettext/*.cmxa -%exclude %{_libdir}/ocaml/gettext/*/*.a -%exclude %{_libdir}/ocaml/gettext/*/*.cmxa -%exclude %{_libdir}/ocaml/gettext/*/*.cmx -%exclude %{_libdir}/ocaml/gettext-stub/*.a -%exclude %{_libdir}/ocaml/gettext-stub/*.cmxa -%exclude %{_libdir}/ocaml/gettext-stub/*.cmx -%endif -%exclude %{_libdir}/ocaml/gettext/*/*.ml -%exclude %{_libdir}/ocaml/gettext/*/*.mli -%exclude %{_libdir}/ocaml/gettext-stub/*.ml -%{_libdir}/ocaml/stublibs/*.so +%check +%dune_check -%files devel +%files -f .ofiles-gettext +%license LICENSE.txt + + +%files devel -f .ofiles-gettext-devel %doc README.md CHANGES.md THANKS TODO.md -# %doc build/share/doc/html/* -%if %opt -%{_libdir}/ocaml/gettext/*.cmxa -%{_libdir}/ocaml/gettext/*/*.a -%{_libdir}/ocaml/gettext/*/*.cmxa -%{_libdir}/ocaml/gettext/*/*.cmx -%{_libdir}/ocaml/gettext-stub/*.a -%{_libdir}/ocaml/gettext-stub/*.cmxa -%{_libdir}/ocaml/gettext-stub/*.cmx -%endif -%{_libdir}/ocaml/gettext/*/*.ml -%{_libdir}/ocaml/gettext/*/*.mli -%{_libdir}/ocaml/gettext-stub/*.ml %{_bindir}/ocaml-gettext %{_bindir}/ocaml-xgettext %{_mandir}/man1/ocaml-gettext.1* @@ -180,29 +133,22 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/ocaml/gettext-camomile %if %{with camomile} -%files camomile -%doc LICENSE.txt -%{_libdir}/ocaml/gettext-camomile -%if %opt -%exclude %{_libdir}/ocaml/gettext-camomile/*.a -%exclude %{_libdir}/ocaml/gettext-camomile/*.cmxa -%exclude %{_libdir}/ocaml/gettext-camomile/*.cmx -%endif -%exclude %{_libdir}/ocaml/gettext-camomile/*.mli +%files camomile -f .ofiles-gettext-camomile +%license LICENSE.txt -%files camomile-devel +%files camomile-devel -f .ofiles-gettext-camomile-devel %doc README.md -%if %opt -%{_libdir}/ocaml/gettext-camomile/*.a -%{_libdir}/ocaml/gettext-camomile/*.cmxa -%{_libdir}/ocaml/gettext-camomile/*.cmx -%endif -%{_libdir}/ocaml/gettext-camomile/*.mli %endif %changelog +* Mon Jul 10 2023 Jerry James - 0.4.2-12 +- OCaml 5.0.0 rebuild +- Convert License tag to SPDX +- Enable tests +- Use new dune macros + * Tue Jan 24 2023 Richard W.M. Jones - 0.4.2-11 - Rebuild OCaml packages for F38 From ae0d99908986442c9514b27a9edbb2b8c06b2bac Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 11 Jul 2023 11:36:23 +0100 Subject: [PATCH 59/85] ExcludeArch i686 (https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SPML7CUBSZNI36NLXGVHEG7DNHU3EWOJ/) --- ocaml-gettext.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 79be2a3..5bcee86 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -1,3 +1,6 @@ +# OCaml packages not built on i686 since OCaml 5 / Fedora 39. +ExcludeArch: %{ix86} + # Optionally disable camomile dep on RHEL. %if !0%{?rhel} %bcond_without camomile From 03b60fb0d3f74dd5cd4566b99cbf51fa14330b4f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 00:27:15 +0100 Subject: [PATCH 60/85] OCaml 5.0 rebuild for Fedora 39 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 5bcee86..555ebb7 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -10,7 +10,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 12%{?dist} +Release: 13%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -146,6 +146,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Tue Jul 11 2023 Richard W.M. Jones - 0.4.2-13 +- OCaml 5.0 rebuild for Fedora 39 + * Mon Jul 10 2023 Jerry James - 0.4.2-12 - OCaml 5.0.0 rebuild - Convert License tag to SPDX From 99c808b007577741baddf807d35cdbd61fa468ca Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 13 Jul 2023 23:26:11 -0400 Subject: [PATCH 61/85] Fix ELN build * When ounit2 is not present, %check must be skipped. Use a bcond to keep these in sync. * Remove the camomile OPAM file to prevent findlib from creating gettext-camomile META files (even though the package is not built). --- ocaml-gettext.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 555ebb7..8740fa1 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -4,8 +4,10 @@ ExcludeArch: %{ix86} # Optionally disable camomile dep on RHEL. %if !0%{?rhel} %bcond_without camomile +%bcond_without tests %else %bcond_with camomile +%bcond_with tests %endif Name: ocaml-gettext @@ -32,7 +34,7 @@ BuildRequires: ocaml-cppo BuildRequires: docbook-style-xsl BuildRequires: libxslt BuildRequires: libxml2 -%if !0%{?rhel} +%if %{with tests} BuildRequires: ocaml-ounit-devel %endif %if %{with camomile} @@ -101,6 +103,7 @@ signature files for developing applications that use %if %{without camomile} # Remove dependency on camomile. +rm -f gettext-camomile.opam rm -r src/lib/gettext-camomile rm -r test/test-camomile sed -i -e 's/camomile//' `find -name dune` @@ -118,8 +121,10 @@ cat .ofiles-gettext-stub >> .ofiles-gettext cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel +%if %{with tests} %check %dune_check +%endif %files -f .ofiles-gettext From c95600ebb20323c74250379b6f950474e3393336 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 17:18:13 +0000 Subject: [PATCH 62/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 8740fa1..d8b5b60 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 13%{?dist} +Release: 14%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -151,6 +151,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 0.4.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jul 11 2023 Richard W.M. Jones - 0.4.2-13 - OCaml 5.0 rebuild for Fedora 39 From 48d8469dad67b582f3a180c204d357efafa17813 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 4 Oct 2023 23:09:07 -0600 Subject: [PATCH 63/85] Add PR URL for Patch1 --- ocaml-gettext.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index d8b5b60..d13ac48 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -24,6 +24,7 @@ Source0: https://github.com/gildor478/%{name}/archive/v%{version}.tar.gz # https://github.com/gildor478/ocaml-gettext/pull/24 Patch0: %{name}-ocaml5.patch # Adapt to changes in camomile 2.0 +# https://github.com/gildor478/ocaml-gettext/pull/27 Patch1: %{name}-camomile2.patch BuildRequires: ocaml >= 4.03.0 From cd788feb5b1f11b27e8fdcd12d8bf83e583b5426 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 5 Oct 2023 16:13:04 +0100 Subject: [PATCH 64/85] OCaml 5.1 rebuild for Fedora 40 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index d13ac48..d3aaaad 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 14%{?dist} +Release: 15%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -152,6 +152,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Oct 05 2023 Richard W.M. Jones - 0.4.2-15 +- OCaml 5.1 rebuild for Fedora 40 + * Thu Jul 20 2023 Fedora Release Engineering - 0.4.2-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 3dac2eccaa78848306249c4e1511e08200460719 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 12 Dec 2023 15:00:38 +0000 Subject: [PATCH 65/85] OCaml 5.1.1 rebuild for Fedora 40 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index d3aaaad..7519ef1 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 15%{?dist} +Release: 16%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -152,6 +152,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Tue Dec 12 2023 Richard W.M. Jones - 0.4.2-16 +- OCaml 5.1.1 rebuild for Fedora 40 + * Thu Oct 05 2023 Richard W.M. Jones - 0.4.2-15 - OCaml 5.1 rebuild for Fedora 40 From c1c705234975a171a50a7ed9782e106cbb80add9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 18 Dec 2023 15:20:07 +0000 Subject: [PATCH 66/85] OCaml 5.1.1 + s390x code gen fix for Fedora 40 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 7519ef1..ea9eec0 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 16%{?dist} +Release: 17%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -152,6 +152,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Mon Dec 18 2023 Richard W.M. Jones - 0.4.2-17 +- OCaml 5.1.1 + s390x code gen fix for Fedora 40 + * Tue Dec 12 2023 Richard W.M. Jones - 0.4.2-16 - OCaml 5.1.1 rebuild for Fedora 40 From 90824c17cb6450c5997f2792648f818b230158f1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 10:16:52 +0000 Subject: [PATCH 67/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index ea9eec0..f933ba2 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 17%{?dist} +Release: 18%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -152,6 +152,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 0.4.2-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Dec 18 2023 Richard W.M. Jones - 0.4.2-17 - OCaml 5.1.1 + s390x code gen fix for Fedora 40 From 9090b3d6bd38b7a592fc8f72976d6277c878148b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 10:00:32 +0000 Subject: [PATCH 68/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index f933ba2..10db8ef 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 18%{?dist} +Release: 19%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -152,6 +152,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 0.4.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 0.4.2-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 3ab8c86605bbc6b845ab0f9de465c455649beaab Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 23 May 2024 12:05:28 -0600 Subject: [PATCH 69/85] Add patch to fix tests with OCaml 5.2.0 --- ocaml-gettext-ocaml5.2.patch | 13 +++++++++++++ ocaml-gettext.spec | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 ocaml-gettext-ocaml5.2.patch diff --git a/ocaml-gettext-ocaml5.2.patch b/ocaml-gettext-ocaml5.2.patch new file mode 100644 index 0000000..4695709 --- /dev/null +++ b/ocaml-gettext-ocaml5.2.patch @@ -0,0 +1,13 @@ +--- ocaml-gettext-0.4.2/test/test.ml.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/test/test.ml 2024-05-07 19:56:55.742155830 -0600 +@@ -278,8 +278,8 @@ let install_test = + ( "test7.mo", + MoInvalidHeaderTableTranslationOutOfBound + ((28l, 2626l), (-49l, 111l)) ); +- ("test8.mo", MoInvalidStringOutOfBound (2626, 36)); +- ("test9.mo", MoInvalidTranslationOutOfBound (2626, 196)); ++ ("test8.mo", MoCannotOpenFile ("testdata/test8.mo")); ++ ("test9.mo", MoCannotOpenFile ("testdata/test9.mo")); + ] + @ List.map install_warning_test_one + [ diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 10db8ef..3689b29 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -26,6 +26,8 @@ Patch0: %{name}-ocaml5.patch # Adapt to changes in camomile 2.0 # https://github.com/gildor478/ocaml-gettext/pull/27 Patch1: %{name}-camomile2.patch +# Two tests that are supposed to fail raise different errors under OCaml 5.2.0 +Patch2: %{name}-ocaml5.2.patch BuildRequires: ocaml >= 4.03.0 BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 @@ -152,6 +154,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Wed May 8 2024 Jerry James - 0.4.2-19 +- Add patch to fix tests with OCaml 5.2.0 + * Thu Jan 25 2024 Fedora Release Engineering - 0.4.2-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 82503be5b6d3280f51753333207793c4ca788c18 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 29 May 2024 22:20:26 +0100 Subject: [PATCH 70/85] OCaml 5.2.0 for Fedora 41 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 3689b29..8e19fa2 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 19%{?dist} +Release: 20%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -154,6 +154,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Wed May 29 2024 Richard W.M. Jones - 0.4.2-20 +- OCaml 5.2.0 for Fedora 41 + * Wed May 8 2024 Jerry James - 0.4.2-19 - Add patch to fix tests with OCaml 5.2.0 From be0afda1af6deb925bc96105c79bd1d4f9ee38f5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 19 Jun 2024 09:26:45 +0100 Subject: [PATCH 71/85] Add RHEL gating test --- gating.yaml | 6 ++++++ tests/basic-test.sh | 19 +++++++++++++++++++ tests/tests.yml | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100755 gating.yaml create mode 100755 tests/basic-test.sh create mode 100755 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100755 index 0000000..2c7ed80 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/basic-test.sh b/tests/basic-test.sh new file mode 100755 index 0000000..8fdac2a --- /dev/null +++ b/tests/basic-test.sh @@ -0,0 +1,19 @@ +#!/bin/bash - +set -e +set -x + +# Compile trivial gettext program. +cat < gettexttest.ml +module Gettext = Gettext.Program ( + struct + let textdomain = "test" + let codeset = None + let dir = None + let dependencies = [] + end +) (GettextStub.Native) ;; +open Gettext ;; +print_endline (s_ "Hello world") +EOF +ocamlfind ocamlopt -package gettext,gettext-stub gettexttest.ml -linkpkg -o gettexttest +./gettexttest diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100755 index 0000000..eea186d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - ocaml + - ocaml-findlib + - ocaml-gettext-devel + tests: + - simple: + dir: . + run: ./basic-test.sh From b27432ddc92f7c977ea06a7f00b6f2843dff1a2c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 19 Jun 2024 16:46:34 +0100 Subject: [PATCH 72/85] OCaml 5.2.0 ppc64le fix --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 8e19fa2..673593d 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 20%{?dist} +Release: 21%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -154,6 +154,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Wed Jun 19 2024 Richard W.M. Jones - 0.4.2-21 +- OCaml 5.2.0 ppc64le fix + * Wed May 29 2024 Richard W.M. Jones - 0.4.2-20 - OCaml 5.2.0 for Fedora 41 From 33098a872fe441406c86eced28d598d69eecd036 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 20:07:37 +0000 Subject: [PATCH 73/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 673593d..21dafa7 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 21%{?dist} +Release: 22%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -154,6 +154,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 0.4.2-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jun 19 2024 Richard W.M. Jones - 0.4.2-21 - OCaml 5.2.0 ppc64le fix From b21859a1f1dd0c3544113c1c65df77056c5bf3d4 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 10 Jan 2025 09:06:43 -0700 Subject: [PATCH 74/85] OCaml 5.3.0 rebuild for Fedora 42 - Add patch for OCaml 5.3 support --- ocaml-gettext-ocaml5.3.patch | 114 +++++++++++++++++++++++++++++++++++ ocaml-gettext.spec | 11 +++- 2 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 ocaml-gettext-ocaml5.3.patch diff --git a/ocaml-gettext-ocaml5.3.patch b/ocaml-gettext-ocaml5.3.patch new file mode 100644 index 0000000..bf39466 --- /dev/null +++ b/ocaml-gettext-ocaml5.3.patch @@ -0,0 +1,114 @@ +--- ocaml-gettext-0.4.2/src/bin/ocaml-xgettext/xgettext.ml.orig 2020-06-11 14:40:42.000000000 -0600 ++++ ocaml-gettext-0.4.2/src/bin/ocaml-xgettext/xgettext.ml 2024-12-14 14:41:51.238374359 -0700 +@@ -121,7 +121,9 @@ let visit_expr (iterator : Ast_iterator. + | Pexp_apply + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) +@@ -133,13 +135,17 @@ let visit_expr (iterator : Ast_iterator. + | Pexp_apply + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) + #endif + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (plural, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) +@@ -152,7 +158,9 @@ let visit_expr (iterator : Ast_iterator. + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) +@@ -165,13 +173,17 @@ let visit_expr (iterator : Ast_iterator. + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (domain, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) + #endif + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } + #else + { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } +@@ -185,13 +197,17 @@ let visit_expr (iterator : Ast_iterator. + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) + #endif + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (plural, _, _)); _ }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) +@@ -204,20 +220,26 @@ let visit_expr (iterator : Ast_iterator. + ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, + _ + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (domain, _, _)) }; _ } ) ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) + #else + { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) + #endif + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } + #else + { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } + #endif + ) + :: ( Asttypes.Nolabel, +-#if OCAML_VERSION >= (4, 11, 0) ++#if OCAML_VERSION >= (5, 3, 0) ++ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (plural, _, _)); _ }; _ } ++#elif OCAML_VERSION >= (4, 11, 0) + { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } + #else + { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 21dafa7..026c0da 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,13 +12,14 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 22%{?dist} +Release: 23%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception URL: https://github.com/gildor478/ocaml-gettext +VCS: git:%{url}.git -Source0: https://github.com/gildor478/%{name}/archive/v%{version}.tar.gz +Source0: %{url}/archive/v%{version}.tar.gz # Updates for OCaml 5. Based in part on # https://github.com/gildor478/ocaml-gettext/pull/24 @@ -28,6 +29,9 @@ Patch0: %{name}-ocaml5.patch Patch1: %{name}-camomile2.patch # Two tests that are supposed to fail raise different errors under OCaml 5.2.0 Patch2: %{name}-ocaml5.2.patch +# Updates for OCaml 5.3 +# https://github.com/gildor478/ocaml-gettext/pull/29 +Patch3: %{name}-ocaml5.3.patch BuildRequires: ocaml >= 4.03.0 BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 @@ -154,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Fri Jan 10 2025 Jerry James - 0.4.2-23 +- OCaml 5.3.0 rebuild for Fedora 42 + * Thu Jul 18 2024 Fedora Release Engineering - 0.4.2-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 96d8727610b3c589cef1f16a5c83080a7b811398 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 20:50:27 +0000 Subject: [PATCH 75/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 026c0da..add99d3 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.4.2 -Release: 23%{?dist} +Release: 24%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -158,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 0.4.2-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Fri Jan 10 2025 Jerry James - 0.4.2-23 - OCaml 5.3.0 rebuild for Fedora 42 From d38306b47872aa99ef1e1652330ddeb962368a1b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 26 Feb 2025 13:57:08 +0000 Subject: [PATCH 76/85] New version 0.5.0 --- .gitignore | 1 + ocaml-gettext-camomile2.patch | 11 --- ocaml-gettext-ocaml5.2.patch | 13 --- ocaml-gettext-ocaml5.3.patch | 114 ------------------------- ocaml-gettext-ocaml5.patch | 152 ---------------------------------- ocaml-gettext.spec | 35 ++++---- sources | 2 +- 7 files changed, 19 insertions(+), 309 deletions(-) delete mode 100644 ocaml-gettext-camomile2.patch delete mode 100644 ocaml-gettext-ocaml5.2.patch delete mode 100644 ocaml-gettext-ocaml5.3.patch delete mode 100644 ocaml-gettext-ocaml5.patch diff --git a/.gitignore b/.gitignore index 9bcf330..8fe92f1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ocaml-gettext-0.3.3.tar.gz /ocaml-gettext-0.3.8-3aecf8e5350f.tar.gz /v0.4.1.tar.gz /v0.4.2.tar.gz +/v0.5.0.tar.gz diff --git a/ocaml-gettext-camomile2.patch b/ocaml-gettext-camomile2.patch deleted file mode 100644 index a5ffd39..0000000 --- a/ocaml-gettext-camomile2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ocaml-gettext-0.4.2/src/lib/gettext-camomile/gettextCamomile.ml.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/src/lib/gettext-camomile/gettextCamomile.ml 2023-06-22 13:41:46.930127479 -0600 -@@ -20,7 +20,7 @@ - (* USA *) - (**************************************************************************) - --open CamomileLibraryDefault.Camomile -+open Camomile - open GettextTypes - - (** Error reported when something goes wrong during Camomile initialization. diff --git a/ocaml-gettext-ocaml5.2.patch b/ocaml-gettext-ocaml5.2.patch deleted file mode 100644 index 4695709..0000000 --- a/ocaml-gettext-ocaml5.2.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ocaml-gettext-0.4.2/test/test.ml.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/test/test.ml 2024-05-07 19:56:55.742155830 -0600 -@@ -278,8 +278,8 @@ let install_test = - ( "test7.mo", - MoInvalidHeaderTableTranslationOutOfBound - ((28l, 2626l), (-49l, 111l)) ); -- ("test8.mo", MoInvalidStringOutOfBound (2626, 36)); -- ("test9.mo", MoInvalidTranslationOutOfBound (2626, 196)); -+ ("test8.mo", MoCannotOpenFile ("testdata/test8.mo")); -+ ("test9.mo", MoCannotOpenFile ("testdata/test9.mo")); - ] - @ List.map install_warning_test_one - [ diff --git a/ocaml-gettext-ocaml5.3.patch b/ocaml-gettext-ocaml5.3.patch deleted file mode 100644 index bf39466..0000000 --- a/ocaml-gettext-ocaml5.3.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- ocaml-gettext-0.4.2/src/bin/ocaml-xgettext/xgettext.ml.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/src/bin/ocaml-xgettext/xgettext.ml 2024-12-14 14:41:51.238374359 -0700 -@@ -121,7 +121,9 @@ let visit_expr (iterator : Ast_iterator. - | Pexp_apply - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) -@@ -133,13 +135,17 @@ let visit_expr (iterator : Ast_iterator. - | Pexp_apply - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) - #endif - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (plural, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) -@@ -152,7 +158,9 @@ let visit_expr (iterator : Ast_iterator. - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) -@@ -165,13 +173,17 @@ let visit_expr (iterator : Ast_iterator. - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (domain, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) - #endif - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } - #else - { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } -@@ -185,13 +197,17 @@ let visit_expr (iterator : Ast_iterator. - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } ) - #endif - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (plural, _, _)); _ }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } ) -@@ -204,20 +220,26 @@ let visit_expr (iterator : Ast_iterator. - ( { pexp_desc = Pexp_ident { Asttypes.txt = lid; _ }; _ }, - _ - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (domain, _, _)) }; _ } ) -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (domain, _, _)); _ } ) - #else - { pexp_desc = Pexp_constant (Pconst_string (domain, _)); _ } ) - #endif - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (singular, _, _)); _ }; _ } -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (singular, _, _)); _ } - #else - { pexp_desc = Pexp_constant (Pconst_string (singular, _)); _ } - #endif - ) - :: ( Asttypes.Nolabel, --#if OCAML_VERSION >= (4, 11, 0) -+#if OCAML_VERSION >= (5, 3, 0) -+ { pexp_desc = Pexp_constant { pconst_desc = (Pconst_string (plural, _, _)); _ }; _ } -+#elif OCAML_VERSION >= (4, 11, 0) - { pexp_desc = Pexp_constant (Pconst_string (plural, _, _)); _ } - #else - { pexp_desc = Pexp_constant (Pconst_string (plural, _)); _ } diff --git a/ocaml-gettext-ocaml5.patch b/ocaml-gettext-ocaml5.patch deleted file mode 100644 index cbdf21b..0000000 --- a/ocaml-gettext-ocaml5.patch +++ /dev/null @@ -1,152 +0,0 @@ ---- ocaml-gettext-0.4.2/gettext-camomile.opam.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/gettext-camomile.opam 2023-06-22 13:31:24.299464751 -0600 -@@ -19,9 +19,8 @@ depends: [ - "ocaml" {>= "4.03.0"} - "dune" {>= "1.11.0"} - "camomile" -- "base-bytes" - "gettext" {= version} -- "ounit" {with-test & > "2.0.8"} -+ "ounit2" {with-test & > "2.2.6"} - "fileutils" {with-test} - ] - synopsis: "Internationalization library using camomile (i18n)" ---- ocaml-gettext-0.4.2/gettext.opam.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/gettext.opam 2023-06-22 13:30:52.810938219 -0600 -@@ -20,8 +20,7 @@ depends: [ - "dune" {>= "1.11.0"} - "cppo" {build} - "fileutils" -- "base-bytes" -- "ounit" {with-test & > "2.0.8"} -+ "ounit2" {with-test & > "2.2.6"} - ] - synopsis: "Internationalization library (i18n)" - description:""" ---- ocaml-gettext-0.4.2/gettext-stub.opam.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/gettext-stub.opam 2023-06-22 13:32:14.938703327 -0600 -@@ -19,9 +19,8 @@ depends: [ - "ocaml" {>= "4.03.0"} - "dune" {>= "1.11.0"} - "dune-configurator" -- "base-bytes" - "gettext" {= version} -- "ounit" {with-test & > "2.0.8"} -+ "ounit2" {with-test & > "2.2.6"} - "fileutils" {with-test} - ] - depexts: [ ---- ocaml-gettext-0.4.2/src/lib/gettext-stub/gettextStubCompat_stubs.c.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/src/lib/gettext-stub/gettextStubCompat_stubs.c 2023-06-22 13:33:17.080769220 -0600 -@@ -76,7 +76,7 @@ CAMLprim value gettextStubCompat_gettext - value v_msgid) - { - CAMLparam1(v_msgid); -- CAMLreturn(copy_string(gettext(String_val(v_msgid)))); -+ CAMLreturn(caml_copy_string(gettext(String_val(v_msgid)))); - } - - CAMLprim value gettextStubCompat_dgettext( -@@ -85,7 +85,7 @@ CAMLprim value gettextStubCompat_dgettex - { - CAMLparam2(v_domainname, v_msgid); - CAMLreturn( -- copy_string( -+ caml_copy_string( - dgettext( - String_val(v_domainname), - String_val(v_msgid)))); -@@ -98,7 +98,7 @@ CAMLprim value gettextStubCompat_dcgette - { - CAMLparam3(v_domainname, v_msgid, v_category); - CAMLreturn( -- copy_string( -+ caml_copy_string( - dcgettext( - String_val(v_domainname), - String_val(v_msgid), -@@ -112,7 +112,7 @@ CAMLprim value gettextStubCompat_ngettex - { - CAMLparam3(v_msgid1, v_msgid2, v_n); - CAMLreturn( -- copy_string( -+ caml_copy_string( - ngettext( - String_val(v_msgid1), - String_val(v_msgid2), -@@ -127,7 +127,7 @@ CAMLprim value gettextStubCompat_dngette - { - CAMLparam4(v_domainname, v_msgid1, v_msgid2, v_n); - CAMLreturn( -- copy_string( -+ caml_copy_string( - dngettext( - String_val(v_domainname), - String_val(v_msgid1), -@@ -158,7 +158,7 @@ CAMLprim value gettextStubCompat_dcngett - "NULL string not expected at "STRINGIFY(__LINE__)" in "__FILE__); - }; - -- CAMLreturn(copy_string(res)); -+ CAMLreturn(caml_copy_string(res)); - } - - CAMLprim value gettextStubCompat_textdomain( ---- ocaml-gettext-0.4.2/test/common/dune.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/test/common/dune 2023-06-22 13:33:50.049275086 -0600 -@@ -1,3 +1,3 @@ - (library - (name common) -- (libraries gettext.base oUnit)) -+ (libraries gettext.base ounit2)) ---- ocaml-gettext-0.4.2/test/dune.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/test/dune 2023-06-22 13:34:09.487983748 -0600 -@@ -6,7 +6,7 @@ - ../src/bin/ocaml-xgettext/xgettext.exe - (glob_files testdata/*) - (glob_files testdata/fr_FR/LC_MESSAGES/*)) -- (libraries oUnit str fileutils gettext.extension common) -+ (libraries ounit2 str fileutils gettext.extension common) - (action - (run %{test} - -runner sequential ---- ocaml-gettext-0.4.2/test/test-camomile/dune.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/test/test-camomile/dune 2023-06-22 13:34:24.840753623 -0600 -@@ -4,6 +4,6 @@ - (deps - (glob_files testdata/*) - (glob_files ../testdata/fr_FR/LC_MESSAGES/*)) -- (libraries common gettext-camomile oUnit fileutils) -+ (libraries common gettext-camomile ounit2 fileutils) - (action - (run %{test} -test-dir ../testdata))) ---- ocaml-gettext-0.4.2/test/test.ml.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/test/test.ml 2023-06-22 13:35:08.719095972 -0600 -@@ -221,7 +221,7 @@ let install_test = - Printf.sprintf "%s warning" fl_mo >:: fun ctxt -> - let tests = make_tests ctxt in - let out = Buffer.create 13 in -- let capture_out strm = Stream.iter (Buffer.add_char out) strm in -+ let capture_out strm = Seq.iter (Buffer.add_char out) strm in - let fl_mo = concat tests.test_dir fl_mo in - let fl_dst = make_filename (tests.install_dir :: fl_dsts) in - assert_command -@@ -392,7 +392,7 @@ let compile_ocaml = - [] - in - let out = Buffer.create 13 in -- let capture_out strm = Stream.iter (Buffer.add_char out) strm in -+ let capture_out strm = Seq.iter (Buffer.add_char out) strm in - let match_exp_err = Str.regexp (".*"^(Str.quote exp_err)^".*") in - assert_command - ~exit_code:(Unix.WEXITED exp_return_code) ---- ocaml-gettext-0.4.2/test/test-stub/dune.orig 2020-06-11 14:40:42.000000000 -0600 -+++ ocaml-gettext-0.4.2/test/test-stub/dune 2023-06-22 13:34:43.239477852 -0600 -@@ -4,6 +4,6 @@ - (deps - (glob_files ../testdata/*) - (glob_files ../testdata/fr_FR/LC_MESSAGES/*)) -- (libraries common gettext-stub oUnit) -+ (libraries common gettext-stub ounit2) - (action - (run %{test} -test-dir ../testdata))) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index add99d3..5a3279c 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -11,8 +11,8 @@ ExcludeArch: %{ix86} %endif Name: ocaml-gettext -Version: 0.4.2 -Release: 24%{?dist} +Version: 0.5.0 +Release: 1%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -21,23 +21,16 @@ VCS: git:%{url}.git Source0: %{url}/archive/v%{version}.tar.gz -# Updates for OCaml 5. Based in part on -# https://github.com/gildor478/ocaml-gettext/pull/24 -Patch0: %{name}-ocaml5.patch -# Adapt to changes in camomile 2.0 -# https://github.com/gildor478/ocaml-gettext/pull/27 -Patch1: %{name}-camomile2.patch -# Two tests that are supposed to fail raise different errors under OCaml 5.2.0 -Patch2: %{name}-ocaml5.2.patch -# Updates for OCaml 5.3 -# https://github.com/gildor478/ocaml-gettext/pull/29 -Patch3: %{name}-ocaml5.3.patch - BuildRequires: ocaml >= 4.03.0 -BuildRequires: ocaml-fileutils-devel >= 0.4.4-4 +BuildRequires: ocaml-fileutils-devel >= 0.6.6-1 BuildRequires: ocaml-dune >= 1.11.0 BuildRequires: ocaml-dune-configurator-devel +BuildRequires: ocaml-dune-site-devel BuildRequires: ocaml-cppo +# This was orphaned and dropped from Fedora back in 2023, but may be +# needed to run the tests. +# https://github.com/gildor478/ocaml-gettext/issues/35 +#BuildRequires: ocaml-seq-devel BuildRequires: docbook-style-xsl BuildRequires: libxslt BuildRequires: libxml2 @@ -70,9 +63,7 @@ Constraints : %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} - -# BZ 446919. -Requires: ocaml-fileutils-devel%{?_isa} >= 0.4.0 +Requires: ocaml-fileutils-devel%{?_isa} >= 0.6.6 %description devel @@ -108,6 +99,9 @@ signature files for developing applications that use %prep %autosetup -p1 +# Remove ocaml-seq dependency. See note above. +sed -i 's/ seq / /' test/dune + %if %{without camomile} # Remove dependency on camomile. rm -f gettext-camomile.opam @@ -158,6 +152,11 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Wed Feb 26 2025 Richard W.M. Jones - 0.5.0-1 +- New version 0.5.0 +- New dependency ocaml-dune-site-devel (copied from opam). +- Remove upstream patches. + * Fri Jan 17 2025 Fedora Release Engineering - 0.4.2-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/sources b/sources index 7317e8d..85cd65b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.4.2.tar.gz) = fb89be8d8d9e0ed9327b81a0c81c884ff3f1a97e46b475ef8084abded5c84a256de05d5aa0f42be94f43ab438276a4506af726b6950e4161359a9616fb5832ec +SHA512 (v0.5.0.tar.gz) = f55505bbe0da2a06053d94ee895a3e610a8d4ab5a2283ccff6a5a0c6a8ec011f5f286ab93e117cc340f55f056c7cdcb5752cc798e9d8e18fb5ab17f27f4a64c2 From a25aade80732fa7bf3c9aeccd25cad7dc65cd9a7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 27 Feb 2025 10:33:16 +0000 Subject: [PATCH 77/85] Add dependency from devel to ocaml-dune-site-devel. https://src.fedoraproject.org/rpms/ocaml-gettext/pull-request/3#comment-249424 --- ocaml-gettext.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 5a3279c..6c22be7 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -64,6 +64,7 @@ Constraints : Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: ocaml-fileutils-devel%{?_isa} >= 0.6.6 +Requires: ocaml-dune-site-devel%{?_isa} %description devel @@ -152,6 +153,10 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Feb 27 2025 Richard W.M. Jones - 0.5.0-2 +- Add dependency from devel to ocaml-dune-site-devel. + https://src.fedoraproject.org/rpms/ocaml-gettext/pull-request/3#comment-249424 + * Wed Feb 26 2025 Richard W.M. Jones - 0.5.0-1 - New version 0.5.0 - New dependency ocaml-dune-site-devel (copied from opam). From dcbab4a42077edefba9c5ecd358b3d267d02cb02 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 3 Mar 2025 23:01:05 -0500 Subject: [PATCH 78/85] Fix build without camomile The top-level dune-project file now contains package-specific information, requiring camomile to be removed there as well. --- ocaml-gettext.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 6c22be7..776b239 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -109,6 +109,8 @@ rm -f gettext-camomile.opam rm -r src/lib/gettext-camomile rm -r test/test-camomile sed -i -e 's/camomile//' `find -name dune` +awk -i inplace -v RS='^\\(package' -v ORS= \ + '{while(sub(/\(package\n *\(name gettext-camomile\).*\)\)\)\)/,""));} {print}' dune-project %endif From b608fbccc457b0721fc267804db287e645cd81ac Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Apr 2025 09:31:45 +0100 Subject: [PATCH 79/85] Remove use of dune-site --- 37.patch | 160 +++++++++++++++++++++++++++++++++++++++++++++ ocaml-gettext.spec | 12 +++- 2 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 37.patch diff --git a/37.patch b/37.patch new file mode 100644 index 0000000..2616f40 --- /dev/null +++ b/37.patch @@ -0,0 +1,160 @@ +From 5462396bee53cb13d8d6fde4c6d430412a17b64d Mon Sep 17 00:00:00 2001 +From: Stephane Glondu +Date: Thu, 3 Apr 2025 09:52:20 +0200 +Subject: [PATCH] Do not use dune sites + +Using dune-site forces use of dune in all reverse-dependencies: + + https://github.com/gildor478/ocaml-gettext/issues/36 + +The use here is to add an ocaml-gettext-specific directory to the +default MO search path. Remove this directory altogether. (This may +break reverse dependencies.) +--- + dune-project | 2 -- + gettext-camomile.opam | 2 -- + gettext-stub.opam | 2 -- + gettext.opam | 3 --- + src/lib/gettext/base/.keep-directory | 1 - + src/lib/gettext/base/dune | 13 +------------ + src/lib/gettext/base/gettextConfig.ml | 9 +-------- + 7 files changed, 2 insertions(+), 30 deletions(-) + delete mode 100644 src/lib/gettext/base/.keep-directory + +diff --git a/dune-project b/dune-project +index 2ee85d7..ef2b58e 100644 +--- a/dune-project ++++ b/dune-project +@@ -2,7 +2,6 @@ + (name gettext) + + (explicit_js_mode) +-(using dune_site 0.1) + (generate_opam_files) + + (source (github gildor478/ocaml-gettext)) +@@ -25,7 +24,6 @@ + "\| + ) + (depends +- dune-site + (ocaml (>= "4.14.0")) + (cppo (and (>= 1.8.0) :build)) + (seq (and (>= "base") :with-test)) +diff --git a/gettext-camomile.opam b/gettext-camomile.opam +index 1fde721..05c96d1 100644 +--- a/gettext-camomile.opam ++++ b/gettext-camomile.opam +@@ -25,11 +25,9 @@ build: [ + name + "-j" + jobs +- "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +- ["dune" "install" "-p" name "--create-install-files" name] + ] + dev-repo: "git+https://github.com/gildor478/ocaml-gettext.git" +diff --git a/gettext-stub.opam b/gettext-stub.opam +index 2463a70..980a584 100644 +--- a/gettext-stub.opam ++++ b/gettext-stub.opam +@@ -24,12 +24,10 @@ build: [ + name + "-j" + jobs +- "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +- ["dune" "install" "-p" name "--create-install-files" name] + ] + dev-repo: "git+https://github.com/gildor478/ocaml-gettext.git" + depexts: [ +diff --git a/gettext.opam b/gettext.opam +index 50a0933..d2f6490 100644 +--- a/gettext.opam ++++ b/gettext.opam +@@ -19,7 +19,6 @@ doc: "https://gildor478.github.io/ocaml-gettext/" + bug-reports: "https://github.com/gildor478/ocaml-gettext/issues" + depends: [ + "dune" {>= "3.17"} +- "dune-site" + "ocaml" {>= "4.14.0"} + "cppo" {>= "1.8.0" & build} + "seq" {>= "base" & with-test} +@@ -36,11 +35,9 @@ build: [ + name + "-j" + jobs +- "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +- ["dune" "install" "-p" name "--create-install-files" name] + ] + dev-repo: "git+https://github.com/gildor478/ocaml-gettext.git" +diff --git a/src/lib/gettext/base/.keep-directory b/src/lib/gettext/base/.keep-directory +deleted file mode 100644 +index f1eab5f..0000000 +--- a/src/lib/gettext/base/.keep-directory ++++ /dev/null +@@ -1 +0,0 @@ +-# This directory contains MO files. +diff --git a/src/lib/gettext/base/dune b/src/lib/gettext/base/dune +index 2eae0c5..7b98bb7 100644 +--- a/src/lib/gettext/base/dune ++++ b/src/lib/gettext/base/dune +@@ -4,17 +4,6 @@ + (ocamlyacc + (modules gettextFormat_parser gettextMo_parser)) + +-(generate_sites_module +- (module gettextConfigDune) +- (sites gettext)) +- +-(install +- (package gettext) +- (section +- (site +- (gettext locale))) +- (files .keep-directory)) +- + (rule + (target gettextConfigGen.ml) + (action +@@ -33,4 +22,4 @@ + GettextMo_int32 + GettextMo_lexer + GettextMo_parser) +- (libraries dune-site fileutils)) ++ (libraries fileutils)) +diff --git a/src/lib/gettext/base/gettextConfig.ml b/src/lib/gettext/base/gettextConfig.ml +index 9d5d986..fe8963b 100644 +--- a/src/lib/gettext/base/gettextConfig.ml ++++ b/src/lib/gettext/base/gettextConfig.ml +@@ -23,19 +23,12 @@ + let default_dir = GettextConfigGen.default_localedir + + let default_path () = +- let dunepath = +- match GettextConfigDune.Sites.locale with +- | [ path ] -> [ path ] +- | [] -> [] +- | _ -> assert false +- in + let envpath = + match Sys.getenv "OCAML_LOCALEPATH" with + | s -> String.split_on_char ':' s + | exception Not_found -> [] + in +- envpath @ dunepath +- @ [ GettextConfigGen.localedir; GettextConfigGen.default_localedir ] ++ envpath @ [ GettextConfigGen.localedir; GettextConfigGen.default_localedir ] + + let default_codeset = "" + diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 776b239..a1ff51e 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.5.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -21,11 +21,15 @@ VCS: git:%{url}.git Source0: %{url}/archive/v%{version}.tar.gz +# Fix to stop using dune-site +# https://github.com/gildor478/ocaml-gettext/issues/36 +# https://github.com/gildor478/ocaml-gettext/pull/37 +Patch: https://github.com/gildor478/ocaml-gettext/pull/37.patch + BuildRequires: ocaml >= 4.03.0 BuildRequires: ocaml-fileutils-devel >= 0.6.6-1 BuildRequires: ocaml-dune >= 1.11.0 BuildRequires: ocaml-dune-configurator-devel -BuildRequires: ocaml-dune-site-devel BuildRequires: ocaml-cppo # This was orphaned and dropped from Fedora back in 2023, but may be # needed to run the tests. @@ -64,7 +68,6 @@ Constraints : Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: ocaml-fileutils-devel%{?_isa} >= 0.6.6 -Requires: ocaml-dune-site-devel%{?_isa} %description devel @@ -155,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Apr 03 2025 Richard W.M. Jones - 0.5.0-3 +- Remove use of dune-site + * Thu Feb 27 2025 Richard W.M. Jones - 0.5.0-2 - Add dependency from devel to ocaml-dune-site-devel. https://src.fedoraproject.org/rpms/ocaml-gettext/pull-request/3#comment-249424 From 49fc534cfa6f1611b60ce325e4577a60bb1d2201 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Sat, 12 Jul 2025 14:33:40 -0600 Subject: [PATCH 80/85] Rebuild to fix OCaml dependencies --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index a1ff51e..99fa400 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.5.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -158,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Sat Jul 12 2025 Jerry James - 0.5.0-4 +- Rebuild to fix OCaml dependencies + * Thu Apr 03 2025 Richard W.M. Jones - 0.5.0-3 - Remove use of dune-site From 62dce5fde305043504ae54a3025dfd3189f98418 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 23:11:16 +0000 Subject: [PATCH 81/85] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 99fa400..75edf18 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.5.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -158,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 0.5.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sat Jul 12 2025 Jerry James - 0.5.0-4 - Rebuild to fix OCaml dependencies From bb2c1fb3b9657fe4ae80607a010b280fe9490705 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 22 Aug 2025 10:25:10 -0600 Subject: [PATCH 82/85] Rebuild for ocaml-dune 3.20.0 --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 75edf18..8ed0878 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.5.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -158,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Fri Aug 22 2025 Jerry James - 0.5.0-6 +- Rebuild for ocaml-dune 3.20.0 + * Thu Jul 24 2025 Fedora Release Engineering - 0.5.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 638fbe8df7e542277bb2af936084492dbf549843 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 14 Oct 2025 09:34:32 +0100 Subject: [PATCH 83/85] OCaml 5.4.0 rebuild --- ocaml-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index 8ed0878..abea8c2 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -12,7 +12,7 @@ ExcludeArch: %{ix86} Name: ocaml-gettext Version: 0.5.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: OCaml library for i18n License: LGPL-2.1-or-later with OCaml-LGPL-linking-exception @@ -158,6 +158,9 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel %changelog +* Tue Oct 14 2025 Richard W.M. Jones - 0.5.0-7 +- OCaml 5.4.0 rebuild + * Fri Aug 22 2025 Jerry James - 0.5.0-6 - Rebuild for ocaml-dune 3.20.0 From ae93d1cd1a57ccf8e9b1d96c49d698d8656132f4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 15 Oct 2025 09:27:18 +0100 Subject: [PATCH 84/85] Add downstream patch to fix build for OCaml 5.4 --- 0001-xgettext-Fix-type-for-OCaml-5.4.patch | 27 ++++++++++++++++++++++ ocaml-gettext.spec | 5 ++++ 2 files changed, 32 insertions(+) create mode 100644 0001-xgettext-Fix-type-for-OCaml-5.4.patch diff --git a/0001-xgettext-Fix-type-for-OCaml-5.4.patch b/0001-xgettext-Fix-type-for-OCaml-5.4.patch new file mode 100644 index 0000000..dd3f5ee --- /dev/null +++ b/0001-xgettext-Fix-type-for-OCaml-5.4.patch @@ -0,0 +1,27 @@ +From 5d521981e39dcaeada6bbe7b15c5432d6de5d33c Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 15 Oct 2025 09:24:18 +0100 +Subject: [PATCH] xgettext: Fix type for OCaml 5.4 + +Fixes: https://github.com/gildor478/ocaml-gettext/issues/40 +Signed-off-by: Richard W.M. Jones +--- + src/bin/ocaml-xgettext/xgettext.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bin/ocaml-xgettext/xgettext.ml b/src/bin/ocaml-xgettext/xgettext.ml +index 8f54efc..aa12aed 100644 +--- a/src/bin/ocaml-xgettext/xgettext.ml ++++ b/src/bin/ocaml-xgettext/xgettext.ml +@@ -112,7 +112,7 @@ let rec is_like lid = function + | [] -> false + | func :: functions -> ( + match lid with +- | (Lident f | Ldot (_, f)) when f = func -> true ++ | (Lident f | Ldot (_, {txt = f; _})) when f = func -> true + | _ -> is_like lid functions ) + + let visit_expr (iterator : Ast_iterator.iterator) expr = +-- +2.50.1 + diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index abea8c2..eb49ebf 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -26,6 +26,11 @@ Source0: %{url}/archive/v%{version}.tar.gz # https://github.com/gildor478/ocaml-gettext/pull/37 Patch: https://github.com/gildor478/ocaml-gettext/pull/37.patch +# Fix for OCaml >= 5.4 +# https://github.com/gildor478/ocaml-gettext/issues/40 +# https://github.com/gildor478/ocaml-gettext/pull/41 +Patch: 0001-xgettext-Fix-type-for-OCaml-5.4.patch + BuildRequires: ocaml >= 4.03.0 BuildRequires: ocaml-fileutils-devel >= 0.6.6-1 BuildRequires: ocaml-dune >= 1.11.0 From 9d4fef37f2e4e6a2a2d3a98a4f47124c1cce0c37 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 13 Jan 2026 17:00:39 -0700 Subject: [PATCH 85/85] Fix a changelog entry --- ocaml-gettext.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml-gettext.spec b/ocaml-gettext.spec index eb49ebf..5a2eca2 100644 --- a/ocaml-gettext.spec +++ b/ocaml-gettext.spec @@ -172,7 +172,7 @@ cat .ofiles-gettext-stub-devel >> .ofiles-gettext-devel * Thu Jul 24 2025 Fedora Release Engineering - 0.5.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild -* Sat Jul 12 2025 Jerry James - 0.5.0-4 +* Sat Jul 12 2025 Jerry James - 0.5.0-4 - Rebuild to fix OCaml dependencies * Thu Apr 03 2025 Richard W.M. Jones - 0.5.0-3