[PATCH 0/6] gnu: po4a: Update to 0.68

  • Done
  • quality assurance status badge
Details
2 participants
  • gemmaro
  • Julien Lepiller
Owner
unassigned
Submitted by
gemmaro
Severity
normal
G
G
gemmaro wrote on 31 Dec 2022 06:56
(address . guix-patches@gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
cover.1672465269.git.gemmaro.dev@gmail.com
Hello Guix,

This patch updates po4a to 0.68. It also includes additional dependencies
required with the update.

I have tried running "make as-derivation" with the following suggestion. Then
I observed warnings that po4a should be used instead of po4a-translate. I
don't think there were any other errors related to po4a.

Another side effect that comes to mind is that if the po4a parser has changed,
it is possible that some of the entries in the translations will be fuzzy.

I wrote this patch for my personal Markdown translation needs. And it appears
to be working well for this format.

Regards,
gemmaro

gemmaro (6):
gnu: Add perl-text-charwidth
gnu: Add perl-xs-parse-keyword
gnu: Add perl-text-wrapi18n
gnu: Add perl-syntax-keyword-try
gnu: po4a: Update to 0.68
Update copyright

gnu/packages/gettext.scm | 49 +++++++++++---------
gnu/packages/perl.scm | 96 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+), 20 deletions(-)


base-commit: 8e883dc8210d4a7c3f09961994685ed54942fd73
--
2.38.1
G
G
gemmaro wrote on 31 Dec 2022 15:04
[PATCH 1/6] gnu: Add perl-text-charwidth
(address . 60448@debbugs.gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
c098a2df25a1a675ea876cb521477c25cbfe03db.1672465269.git.gemmaro.dev@gmail.com
---
gnu/packages/perl.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index f80d84eaa5..e6ba0ff736 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -10471,6 +10471,27 @@ (define-public perl-text-balanced
text sequences from strings.")
(license (package-license perl))))
+(define-public perl-text-charwidth
+ (package
+ (name "perl-text-charwidth")
+ (version "0.04")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/K/KU/KUBOTA/Text-CharWidth-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1y040wiqx78pnr0wxbjhpzjxm2a9qiqq479gzn4qwcyrzpsdbpmb"))))
+ (build-system perl-build-system)
+ (home-page "https://metacpan.org/dist/Text-CharWidth")
+ (synopsis "Get number of occupied columns of a string on terminal")
+ (description
+ "With this module, you can calculate terminal character
+widths that vary by locale. This module supplies features similar as
+wcwidth(3) and wcswidth(3) in C language.")
+ (license (package-license perl))))
+
(define-public perl-text-csv
(package
(name "perl-text-csv")
--
2.38.1
G
G
gemmaro wrote on 31 Dec 2022 15:04
[PATCH 2/6] gnu: Add perl-xs-parse-keyword
(address . 60448@debbugs.gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
4978966488b043ee5b7df046b220dbb53fd21033.1672465269.git.gemmaro.dev@gmail.com
perl-xs-parse-keyword v0.06 is required by perl-syntax-keyword-try.
Note that the latest version of this package is 0.27.
---
gnu/packages/perl.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index e6ba0ff736..09f5d9e69d 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -11580,6 +11580,28 @@ (define-public perl-xs-object-magic
neither visible nor modifiable from Perl space).")
(license (package-license perl))))
+(define-public perl-xs-parse-keyword
+ (package
+ (name "perl-xs-parse-keyword")
+ (version "0.06")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/P/PE/PEVANS/XS-Parse-Keyword-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0nnr8akkxb2h2y3d5r51pr84vvxkq89ynmi9azkbnn79jmbcbgvq"))))
+ (build-system perl-build-system)
+ (native-inputs (list perl-module-build perl-test-simple))
+ (home-page "https://metacpan.org/dist/XS-Parse-Keyword")
+ (synopsis "XS functions to assist in parsing keyword syntax")
+ (description
+ "This module provides some XS functions to assist in writing
+syntax modules that provide new perl-visible syntax, primarily for authors of
+keyword plugins using the @code{PL_keyword_plugin} hook mechanism.")
+ (license (package-license perl))))
+
(define-public perl-yaml
(package
(name "perl-yaml")
--
2.38.1
G
G
gemmaro wrote on 31 Dec 2022 15:04
[PATCH 3/6] gnu: Add perl-text-wrapi18n
(address . 60448@debbugs.gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
6af2cbcef0af7c8920350a5aff2da8054c093fa5.1672465269.git.gemmaro.dev@gmail.com
---
gnu/packages/perl.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (41 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 09f5d9e69d..1c21f30133 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -12255,6 +12255,34 @@ (define-public perl-text-soundex
the National Archives and Records Administration (NARA).")
(license license:perl-license)))
+(define-public perl-text-wrapi18n
+ (package
+ (name "perl-text-wrapi18n")
+ (version "0.06")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/K/KU/KUBOTA/Text-WrapI18N-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "12548qc99ms12yp5j26076p0zazjfv1b618h5k8r5iy2y0brmljb"))))
+ (build-system perl-build-system)
+ (inputs (list perl-text-charwidth))
+ (home-page "https://metacpan.org/pod/Text::WrapI18N")
+ (synopsis "Line wrapping for multibyte, fullwidth, and combining
+characters and so on")
+ (description
+ "This module intends to be a better Text::Wrap module. This
+module is needed to support multibyte character encodings such as UTF-8,
+EUC-JP, EUC-KR, GB2312, and Big5. This module also supports characters with
+irregular widths, such as combining characters (which occupy zero columns on
+terminal, like diacritical marks in UTF-8) and fullwidth characters (which
+occupy two columns on terminal, like most of east Asian characters). Also,
+minimal handling of languages which doesn't use whitespaces between
+words (like Chinese and Japanese) is supported.")
+ (license (package-license perl))))
+
(define-public perl-regexp-pattern
(package
(name "perl-regexp-pattern")
--
2.38.1
G
G
gemmaro wrote on 31 Dec 2022 15:04
[PATCH 4/6] gnu: Add perl-syntax-keyword-try
(address . 60448@debbugs.gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
74d03d1618fd7e917cfa635a8001628fa584522a.1672465269.git.gemmaro.dev@gmail.com
This is required by po4a since v0.67.
---
gnu/packages/perl.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 1c21f30133..437c02c195 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -9996,6 +9996,30 @@ (define-public perl-switch
statements: @code{switch} and @code{case}.")
(license (package-license perl))))
+(define-public perl-syntax-keyword-try
+ (package
+ (name "perl-syntax-keyword-try")
+ (version "0.27")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/P/PE/PEVANS/Syntax-Keyword-Try-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "08yyfhavmddix35kb7dvvj646symw2vd8l058bajzwiz7q1invi4"))))
+ (build-system perl-build-system)
+ (native-inputs (list perl-module-build))
+ (inputs (list perl-xs-parse-keyword))
+ (home-page "https://metacpan.org/pod/Syntax::Keyword::Try")
+ (synopsis "Try/catch/finally syntax for perl")
+ (description
+ "This module provides a syntax plugin that implements
+exception-handling semantics in a form familiar to users of other
+languages, being built on a block labeled with the @code{try} keyword,
+followed by at least one of a @code{catch} or @code{finally} block.")
+ (license (package-license perl))))
+
(define-public perl-sys-cpu
(package
(name "perl-sys-cpu")
--
2.38.1
G
G
gemmaro wrote on 31 Dec 2022 15:05
[PATCH 5/6] gnu: po4a: Update to 0.68
(address . 60448@debbugs.gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
dd1dd4c965c4c50a99af269d35b03055fe91ffe7.1672465269.git.gemmaro.dev@gmail.com
The phase do-not-override-PERL5LIB is removed since it was fixed in po4a v0.63.

bash-minimal is added to inputs since the wrap-program function is used.

The only regrettable thing is that only the SGML test failed, but I could not
find the cause... Nevertheless, some previously failed tests are now passing.
---
gnu/packages/gettext.scm | 48 +++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 20 deletions(-)

Toggle diff (101 lines)
diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index 5df30c4be3..04fc20e7bf 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -36,6 +36,7 @@ (define-module (gnu packages gettext)
#:use-module (guix build-system gnu)
#:use-module (guix build-system perl)
#:use-module (guix build-system python)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages check)
#:use-module (gnu packages docbook)
#:use-module (gnu packages emacs)
@@ -239,14 +240,14 @@ (define-public mdpo
(define-public po4a
(package
(name "po4a")
- (version "0.63")
+ (version "0.68")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/mquinson/po4a/releases/download/v"
version "/po4a-" version ".tar.gz"))
(sha256
(base32
- "1kmlfpdl1i1wrcdn0k1frh44fq10sfwswi3azvibli2lakpf66z2"))))
+ "045i8izp2dqmkdzvnxyy5sy27ffrwl85dk8n6cmg1804ikk28qdg"))))
(build-system perl-build-system)
(arguments
`(#:phases
@@ -257,9 +258,21 @@ (define-public po4a
;; required by this package at runtime.
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin/"))
- (Pod::Parser (assoc-ref inputs "perl-pod-parser"))
(path (string-append out "/lib/perl5/site_perl:"
- Pod::Parser "/lib/perl5/site_perl")))
+ (string-join
+ (map (lambda (name)
+ (string-append (assoc-ref inputs name)
+ "/lib/perl5/site_perl"))
+ (list "perl-gettext"
+ "perl-pod-parser"
+ "perl-sgmls"
+ "perl-syntax-keyword-try"
+ "perl-xs-parse-keyword"
+ "perl-term-readkey"
+ "perl-text-wrapi18n"
+ "perl-unicode-linebreak"
+ "perl-yaml-tiny"))
+ ":"))))
(for-each (lambda (file)
(wrap-program file
`("PERL5LIB" ":" prefix (,path))))
@@ -272,23 +285,10 @@ (define-public po4a
(string-append (assoc-ref inputs "docbook-xml")
"/xml/dtd/docbook/")))
#t))
- (add-before 'build 'do-not-override-PERL5LIB
- (lambda _
- ;; Don't hard-code PERL5LIB to include just the build directory
- ;; so that the build script finds modules from inputs.
- (substitute* "Po4aBuilder.pm"
- (("PERL5LIB=lib") ""))
- (setenv "PERL5LIB" (string-append (getenv "PERL5LIB") ":lib"))))
(add-before 'check 'disable-failing-tests
(lambda _
- ;; FIXME: these tests require SGMLS.pm.
- (delete-file "t/01-classes.t")
-
- (delete-file "t/add.t")
- (delete-file "t/core-porefs.t")
- (delete-file "t/fmt-asciidoc.t")
+ ;; FIXME: fails despite of importing SGMLS
(delete-file "t/fmt-sgml.t")
-
#t)))))
(native-inputs
`(("gettext" ,gettext-minimal)
@@ -300,10 +300,18 @@ (define-public po4a
;; For tests.
("docbook-xml" ,docbook-xml-4.1.2)
("perl-test-pod" ,perl-test-pod)
- ("perl-yaml-tiny" ,perl-yaml-tiny)
("texlive" ,texlive-tiny)))
(inputs
- (list perl-pod-parser))
+ (list bash-minimal
+ perl-gettext
+ perl-pod-parser
+ perl-sgmls
+ perl-syntax-keyword-try
+ perl-xs-parse-keyword
+ perl-term-readkey
+ perl-text-wrapi18n
+ perl-unicode-linebreak
+ perl-yaml-tiny))
(home-page "https://po4a.org/")
(synopsis "Scripts to ease maintenance of translations")
(description
--
2.38.1
G
G
gemmaro wrote on 31 Dec 2022 15:05
[PATCH 6/6] Update copyright
(address . 60448@debbugs.gnu.org)(name . gemmaro)(address . gemmaro.dev@gmail.com)
d8fbd7ab5c9e98cd6d6ca32957a66f243bc3a8bc.1672465269.git.gemmaro.dev@gmail.com
---
gnu/packages/gettext.scm | 1 +
gnu/packages/perl.scm | 1 +
2 files changed, 2 insertions(+)

Toggle diff (26 lines)
diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index 04fc20e7bf..c66e1f58d1 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2019 Miguel <rosen644835@gmail.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 EuAndreh <eu@euandre.org>
+;;; Copyright © 2022 gemmaro <gemmaro.dev@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 437c02c195..9edde39d49 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -33,6 +33,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 Evgeny Pisemsky <evgeny@pisemsky.com>
+;;; Copyright © 2022 gemmaro <gemmaro.dev@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
--
2.38.1
J
J
Julien Lepiller wrote on 3 Jan 2023 21:27
Re: [bug#60448] [PATCH 0/6] gnu: po4a: Update to 0.68
(name . gemmaro)(address . gemmaro.dev@gmail.com)(address . 60448-done@debbugs.gnu.org)
20230103212731.38a43d03@sybil.lepiller.eu
Pushed to master as 62ee1c4b47c6e1e62314223d62a5d54162a23fa8 -
a1f9eba892784069e34338e01237a74b8a3bd8a2, thank you!

I made some changes, but the series was really good overall! The main
change is that I integrated your copyright to the first patch that
modified the file.

I've left updating the process to later. We'll want to do it though,
the new interface looks really cool for our use-case, especially
because it supports using a single pot for multiple files (think
guix.texi and contributing.texi that currently raise a warning).

I'm happy to help if you want to try, otherwise I'll probably do it
sometime :)

Le Sat, 31 Dec 2022 14:56:13 +0900,
gemmaro <gemmaro.dev@gmail.com> a écrit :

Toggle quote (36 lines)
> Hello Guix,
>
> This patch updates po4a to 0.68. It also includes additional
> dependencies required with the update.
>
> I have tried running "make as-derivation" with the following
> suggestion. Then I observed warnings that po4a should be used
> instead of po4a-translate. I don't think there were any other errors
> related to po4a.
> https://lists.gnu.org/archive/html/guix-patches/2021-07/msg00030.html
>
> Another side effect that comes to mind is that if the po4a parser has
> changed, it is possible that some of the entries in the translations
> will be fuzzy.
>
> I wrote this patch for my personal Markdown translation needs. And
> it appears to be working well for this format.
>
> Regards,
> gemmaro
>
> gemmaro (6):
> gnu: Add perl-text-charwidth
> gnu: Add perl-xs-parse-keyword
> gnu: Add perl-text-wrapi18n
> gnu: Add perl-syntax-keyword-try
> gnu: po4a: Update to 0.68
> Update copyright
>
> gnu/packages/gettext.scm | 49 +++++++++++---------
> gnu/packages/perl.scm | 96
> ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125
> insertions(+), 20 deletions(-)
>
>
> base-commit: 8e883dc8210d4a7c3f09961994685ed54942fd73
Closed
G
G
gemmaro wrote on 8 Jan 2023 04:30
(address . 60448@debbugs.gnu.org)
87y1qd7lf7.fsf@mac.gemmaro.name
(Sorry, I had the wrong address and will resend.)

Hello,

Julien Lepiller <julien@lepiller.eu> writes:

Toggle quote (15 lines)
> Pushed to master as 62ee1c4b47c6e1e62314223d62a5d54162a23fa8 -
> a1f9eba892784069e34338e01237a74b8a3bd8a2, thank you!
>
> I made some changes, but the series was really good overall! The main
> change is that I integrated your copyright to the first patch that
> modified the file.
>
> I've left updating the process to later. We'll want to do it though,
> the new interface looks really cool for our use-case, especially
> because it supports using a single pot for multiple files (think
> guix.texi and contributing.texi that currently raise a warning).
>
> I'm happy to help if you want to try, otherwise I'll probably do it
> sometime :)

Thank you very much! Actually, I am new to both Guix and Guile Scheme,
but if I can be of any help, I would be happy to try to contribute.

Two points of concern at this time are as follows:

* My current understanding of Guix's internationalization process is
that translations are updated on Weblate and that translated documents
are generated with po4a. It seems that the current file structure and
options should not be changed significantly after the change.

* A configuration file must be given to the integrated po4a command. In
the long run, there might be a room to consider how this configuration
file should be managed, i.e., whether it should be automatically
generated by Guile or updated manually. (At this point, the file
structure is simple enough that the latter might be enough.)

Anyway, I will try to think about how to update the process.

Sincerely,
gemmaro
?