diff mbox series

[bug#65479,core-updates,14/61] gnu: libxslt: Set search-paths for XML and SGML catalogs.

Message ID 9b7c69b6933edffbc1125c81d3a2e8b58dc9e17b.1692830149.git.mirai@makinata.eu
State New
Headers show
Series The Draining of the XML & DocBook Swamp. | expand

Commit Message

Bruno Victal Aug. 23, 2023, 10:35 p.m. UTC
According to xsltproc manpage it supports both XML_CATALOG_FILES and
SGML_CATALOG_FILES for catalog lookup.

* gnu/packages/xml.scm (libxslt)[native-search-paths]: Add SGML_CATALOG_FILES
and XML_CATALOG_FILES.
[search-paths]: Likewise.
* gnu/packages/perl.scm (perl-app-xml-docbook-builder)[native-search-paths]:
Refer to libxslt native-search-paths.
---
 gnu/packages/perl.scm | 2 +-
 gnu/packages/xml.scm  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Maxim Cournoyer Oct. 5, 2023, 11:59 p.m. UTC | #1
Hi,

Bruno Victal <mirai@makinata.eu> writes:

> According to xsltproc manpage it supports both XML_CATALOG_FILES and
> SGML_CATALOG_FILES for catalog lookup.
>
> * gnu/packages/xml.scm (libxslt)[native-search-paths]: Add SGML_CATALOG_FILES
> and XML_CATALOG_FILES.
> [search-paths]: Likewise.
> * gnu/packages/perl.scm (perl-app-xml-docbook-builder)[native-search-paths]:
> Refer to libxslt native-search-paths.
> ---
>  gnu/packages/perl.scm | 2 +-
>  gnu/packages/xml.scm  | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
> index 7f9b19b6ee..5995aa0346 100644
> --- a/gnu/packages/perl.scm
> +++ b/gnu/packages/perl.scm
> @@ -602,7 +602,7 @@ (define-public perl-app-xml-docbook-builder
>       (list perl-class-xsaccessor perl-test-trap))
>      (native-search-paths
>       ;; xsltproc's search paths, to avoid propagating libxslt.
> -     (list $XML_CATALOG_FILES))
> +     (package-native-search-paths libxslt))

Because search path fields are not delayed, this is susceptible to
introduce circular dependencies between modules (see: "info (guix)
Cyclic Modules Dependencies").  It' be better to either repeat it, or
define some %libxslt-search-paths variable among the (guix search-paths)
module to be reused elsewhere.
Bruno Victal Oct. 6, 2023, 2:18 p.m. UTC | #2
Hi Maxim,

On 2023-10-06 00:59, Maxim Cournoyer wrote:
> Because search path fields are not delayed, this is susceptible to
> introduce circular dependencies between modules (see: "info (guix)
> Cyclic Modules Dependencies").  It' be better to either repeat it, or
> define some %libxslt-search-paths variable among the (guix search-paths)
> module to be reused elsewhere.

Do you think it's worth defining this as:

--8<---------------cut here---------------start------------->8---
(define %libxml2-search-paths
  (list …))

;; libxslt happens to share the same search-paths with libxml2.
(define %libxslt-search-paths %libxml2-search-paths)

--8<---------------cut here---------------end--------------->8---

That is, we add an alias for libxslt since it happens to coincide
with libxml2 in the regard that both also make use of
SGML_CATALOG_PATHS?
Maxim Cournoyer Oct. 7, 2023, 4:09 p.m. UTC | #3
Hi,

Bruno Victal <mirai@makinata.eu> writes:

> Hi Maxim,
>
> On 2023-10-06 00:59, Maxim Cournoyer wrote:
>> Because search path fields are not delayed, this is susceptible to
>> introduce circular dependencies between modules (see: "info (guix)
>> Cyclic Modules Dependencies").  It' be better to either repeat it, or
>> define some %libxslt-search-paths variable among the (guix search-paths)
>> module to be reused elsewhere.
>
> Do you think it's worth defining this as:
>
> (define %libxml2-search-paths
>   (list …))
>
> ;; libxslt happens to share the same search-paths with libxml2.
> (define %libxslt-search-paths %libxml2-search-paths)

I think I'd rather have only one name for that specific search paths
set, but I don't feel strongly about it.
diff mbox series

Patch

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 7f9b19b6ee..5995aa0346 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -602,7 +602,7 @@  (define-public perl-app-xml-docbook-builder
      (list perl-class-xsaccessor perl-test-trap))
     (native-search-paths
      ;; xsltproc's search paths, to avoid propagating libxslt.
-     (list $XML_CATALOG_FILES))
+     (package-native-search-paths libxslt))
     (home-page "https://www.shlomifish.org/open-source/projects/docmake/")
     (synopsis "Translate DocBook/XML documentation into other file formats")
     (description
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index ec3de82765..bbae6dd766 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -363,6 +363,9 @@  (define-public libxslt
            xz))
     (native-inputs
      (list pkg-config))
+    (native-search-paths
+     (list $SGML_CATALOG_FILES $XML_CATALOG_FILES))
+    (search-paths native-search-paths)
     (description
      "Libxslt is an XSLT C library developed for the GNOME project.  It is
 based on libxml for XML parsing, tree manipulation and XPath support.")