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