Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

8 changed files with 153 additions and 294 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/0.3.7.tar.gz
SOURCES/v0.4.2.tar.gz

View File

@ -1 +1 @@
e2aa5ef88ed77491fcae849e25ebcf6eca7cde6f SOURCES/0.3.7.tar.gz
889c9865e323b68abcdadd40da0589557b4390ca SOURCES/v0.4.2.tar.gz

View File

@ -1,109 +0,0 @@
From 35d2d7381c7101bb73d0b7f00fea06442c7b2ab8 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 29 Aug 2017 18:29:34 +0200
Subject: [PATCH 1/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

View File

@ -1,26 +0,0 @@
From 3f4fc73c2a0315c2da16dee7db0fcb2766f55d3c Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 29 Aug 2017 18:36:10 +0200
Subject: [PATCH 2/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

View File

@ -1,44 +0,0 @@
From 202bf1e00eaa533e133c29b509d77cdfb7c13f5e Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 29 Aug 2017 18:55:37 +0200
Subject: [PATCH 3/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

View File

@ -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) $<

View File

@ -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 *)

View File

@ -1,27 +1,30 @@
%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.3.7
Version: 0.4.2
Release: 6%{?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
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
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
BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-fileutils-devel >= 0.4.4-4
BuildRequires: ocaml-dune-devel
BuildRequires: ocaml-cppo
BuildRequires: docbook-style-xsl
BuildRequires: libxslt
BuildRequires: libxml2
@ -29,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
@ -68,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}
@ -93,99 +98,89 @@ signature files for developing applications that use
%prep
%setup -q
%setup -q -n %{name}-%{version}
%autopatch -p1
autoreconf -i
# Remove dependency on batteries.
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
# 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
%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 {} \;
# Remove this, we will use our own rules for documentation.
rm -rf $RPM_BUILD_ROOT/usr/doc
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/*
%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
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
%files
%doc COPYING
%doc LICENSE.txt
%{_libdir}/ocaml/gettext
%{_libdir}/ocaml/gettext-stub
%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 CHANGES.md 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
%{_mandir}/man1/ocaml-gettext.1*
%{_mandir}/man1/ocaml-xgettext.1*
%{_mandir}/man5/ocaml-gettext.5*
%if !0%{?rhel}
%if %{with camomile}
%files camomile
%doc COPYING
%doc LICENSE.txt
%{_libdir}/ocaml/gettext-camomile
%if %opt
%exclude %{_libdir}/ocaml/gettext-camomile/*.a
@ -196,7 +191,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
@ -207,6 +202,99 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
%changelog
* Fri Mar 11 2022 Richard W.M. Jones <rjones@redhat.com> - 0.4.2-6
- Rebuild for EPEL
resolves: rhbz#2060850
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.4.2-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed Jun 23 2021 Richard W.M. Jones <rjones@redhat.com> - 0.4.2-4
- Bump and rebuild
resolves: rhbz#1975309
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.4.2-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Mar 8 23:22:35 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.4.2-2
- Better handling of optional camomile subpackage.
* Tue Mar 2 23:22:35 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 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 <rjones@redhat.com> - 0.4.1-9
- OCaml 4.12.0 build
* Wed Feb 24 2021 Richard W.M. Jones <rjones@redhat.com> - 0.4.1-8
- Remove ocaml-camomile dep on RHEL 9.
* Mon Feb 1 2021 Richard W.M. Jones <rjones@redhat.com> - 0.4.1-7
- Bump and rebuild for updated ocaml-camomile.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Sep 01 2020 Richard W.M. Jones <rjones@redhat.com> - 0.4.1-5
- OCaml 4.11.1 rebuild
* Fri Aug 21 2020 Richard W.M. Jones <rjones@redhat.com> - 0.4.1-4
- OCaml 4.11.0 rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 05 2020 Richard W.M. Jones <rjones@redhat.com> - 0.4.1-2
- OCaml 4.11.0+dev2-2020-04-22 rebuild
* Wed Apr 22 2020 Richard W.M. Jones <rjones@redhat.com> - 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 <rjones@redhat.com> - 0.3.8-0.7.git3aecf8e5350f
- OCaml 4.11.0 pre-release attempt 2
* Sat Apr 04 2020 Richard W.M. Jones <rjones@redhat.com> - 0.3.8-0.6.git3aecf8e5350f
- Update all OCaml dependencies for RPM 4.16.
* Thu Feb 27 2020 Richard W.M. Jones <rjones@redhat.com> - 0.3.8-0.5.git3aecf8e5350f
- OCaml 4.10.0 final.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.8-0.4.git3aecf8e5350f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 0.3.8-0.3.git3aecf8e5350f
- OCaml 4.10.0+beta1 rebuild.
* Fri Dec 06 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.8-0.2.git3aecf8e5350f
- OCaml 4.09.0 (final) rebuild.
* Tue Oct 1 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.8-0.1
- Move to pre-release of 0.3.8.
- Requires dune.
* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.7-13
- Bump release and rebuild.
* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.7-12
- OCaml 4.08.1 (final) rebuild.
* Wed Jul 31 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.7-11
- OCaml 4.08.1 (rc2) rebuild.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.7-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Jul 19 2019 Richard W.M. Jones <rjones@redhat.com> - 0.3.7-9
- Remove camlp4 dependency.
- Add all upstream patches since 0.3.7.
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild