[bug#63854] gnu: po4a: Fix SGML tests.

Message ID 787df376b4ca9aaf15b8eda7c04ee7ae984d78e9.1685728331.git.gemmaro.dev@gmail.com
State New
Headers
Series [bug#63854] gnu: po4a: Fix SGML tests. |

Commit Message

gemmaro June 2, 2023, 5:52 p.m. UTC
* gnu/packages/gettext.scm (po4a): Fix SGML tests.
---
 gnu/packages/gettext.scm | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)


base-commit: a7d9cd742c3149bb014db95f88d1158d590bc124
  

Comments

Bruno Victal June 3, 2023, 10:12 p.m. UTC | #1
Hi gemmaro,

I think this is the wrong place to set the SGML_CATALOG_FILES,
based on the information in the manpage for xmllint (libxml2),
it seems that the libxml2 package should be setting this variable
through the native-search-paths instead.
  
gemmaro June 4, 2023, 12:28 p.m. UTC | #2
Hello Bruno,

> I think this is the wrong place to set the SGML_CATALOG_FILES,
> based on the information in the manpage for xmllint (libxml2),
> it seems that the libxml2 package should be setting this variable
> through the native-search-paths instead.

Thank you for the review.  I moved SGML_CATALOG_FILES from opensp to libxml2
and checked that libxml2, opensp and po4a build pass.

As with the patch series for DocBook [1], this should be core-updates since it
also triggers mass rebuilds.

[1] https://issues.guix.gnu.org/63081

Thank you again,
gemmaro.

gemmaro (2):
  gnu: libxml2: Add SGML_CATALOG_FILES to native-search-path.
  gnu: po4a: Fix SGML tests.

 gnu/packages/gettext.scm | 12 +++++-------
 gnu/packages/xml.scm     | 37 ++++++++++++++++++++-----------------
 2 files changed, 25 insertions(+), 24 deletions(-)


base-commit: b3492964c2573993b65c20f6e7d16c29cfd6f4f5
  
gemmaro June 19, 2023, 11:47 p.m. UTC | #3
Hello Bruno,

Bruno Victal <mirai@makinata.eu> writes:
>> @@ -1781,14 +1792,6 @@ (define-public opensp
>>                  (("^\tOSGMLNORM=`echo osgmlnorm\\|sed '\\$\\(transform\\)'`\\\\")
>>                   "\tOSGMLNORM=`echo osgmlnorm|sed '$(transform)'`")
>>                  (("^\t\\$\\(SHELL\\)\n") "")))))))
>> -    ;; $SGML_CATALOG_FILES lists 'catalog' or 'CATALOG' or '*.cat' files found
>> -    ;; under the 'sgml' sub-directory of any given package.
>> -    (native-search-paths (list (search-path-specification
>> -                                (variable "SGML_CATALOG_FILES")
>> -                                (separator ":")
>> -                                (files '("sgml"))
>> -                                (file-pattern "^catalog$|^CATALOG$|^.*\\.cat$")
>> -                                (file-type 'regular))))
>
> Interesting, looking at opensp it seems that it also makes use of the
> SGML_CATALOG_FILES environment variable so I don't think it shouldn't
> be removed though I don't know if it's valid for more than one package
> to share the same native-search-path.

You are right.  Looking at other packages, there are some
native-search-paths defined with the same name, such as
C_INCLUDE_PATH.  One solution to avoid duplication is to define it
globally, like $SSL_CERT_DIR in guix/search-paths.scm, but maybe not
go that far this time.  I stopped changing opensp.

Best,
gemmaro.

gemmaro (2):
  gnu: libxml2: Add SGML_CATALOG_FILES to native-search-path.
  gnu: po4a: Fix SGML tests.

 gnu/packages/gettext.scm | 12 +++++-------
 gnu/packages/xml.scm     | 27 +++++++++++++++++++--------
 2 files changed, 24 insertions(+), 15 deletions(-)


base-commit: d884fc9e2efecfba09af4694f5a13ad7fc6f704f
  

Patch

diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index 9387f4fb8a5..0d66d492d40 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -11,7 +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>
+;;; Copyright © 2022, 2023 gemmaro <gemmaro.dev@gmail.com>
 ;;; Copyright © 2023 Maxim Cournoyer maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -280,10 +280,11 @@  (define-public po4a
                             (wrap-program file
                               `("PERL5LIB" ":" prefix (,path))))
                           (find-files bin "\\.*$")))))
-          (add-before 'check 'disable-failing-tests
-            (lambda _
-              ;; FIXME: fails despite of importing SGMLS
-              (delete-file "t/fmt-sgml.t"))))))
+          (add-before 'check 'set-SGML-catalog-file
+            (lambda* (#:key inputs #:allow-other-keys)
+              (setenv "SGML_CATALOG_FILES"
+                      (string-append (assoc-ref inputs "docbook-sgml")
+                                     "/sgml/dtd/docbook/docbook.cat")))))))
     (native-inputs
      (list gettext-minimal
            perl-module-build
@@ -291,11 +292,13 @@  (define-public po4a
            libxml2
            libxslt
            ;; For tests.
+           docbook-sgml-4.1
            docbook-xml-4.1.2
            perl-test-pod
            texlive-tiny))
     (inputs
      (list bash-minimal
+           opensp
            perl-gettext
            perl-pod-parser
            perl-sgmls