[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#65479] [PATCH core-updates 12/61] search-paths: Add $XML_CATALOG_FI
From: |
Bruno Victal |
Subject: |
[bug#65479] [PATCH core-updates 12/61] search-paths: Add $XML_CATALOG_FILES and $SGML_CATALOG_FILES. |
Date: |
Wed, 23 Aug 2023 23:35:04 +0100 |
These variables are used by some packages for XML/SGML catalog lookups.
* guix/search-paths ($XML_CATALOG_FILES, $SGML_CATALOG_FILES): New variable,
extracted from …
* gnu/packages/xml.scm (libxml2, opensp)[native-search-paths]: … here. Refer
to the variables from (guix search-paths) respectively.
* gnu/packages/perl.scm (perl-app-xml-docbook-builder)[native-search-paths]:
Use $XML_CATALOG_FILES.
* doc/guix.texi (Search Paths): Update documentation to reflect changes.
---
doc/guix.texi | 24 +++++++++++-------------
gnu/packages/perl.scm | 7 +------
gnu/packages/xml.scm | 19 +++----------------
guix/search-paths.scm | 25 +++++++++++++++++++++++++
4 files changed, 40 insertions(+), 35 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 58cc3d7aad..65b5cf6cab 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11057,17 +11057,14 @@ contain a list of @file{catalog.xml} files (not
directories), which are
to be found in @file{xml} sub-directories---nothing less. The search
path specification looks like this:
+@c This is defined at (guix search-paths) as $XML_CATALOG_FILES.
@lisp
-(package
- (name "libxml2")
- ;; some fields omitted
- (native-search-paths
- (list (search-path-specification
- (variable "XML_CATALOG_FILES")
- (separator " ")
- (files '("xml"))
- (file-pattern "^catalog\\.xml$")
- (file-type 'regular)))))
+(search-path-specification
+ (variable "XML_CATALOG_FILES")
+ (separator " ")
+ (files '("xml"))
+ (file-pattern "^catalog\\.xml$")
+ (file-type 'regular))
@end lisp
Worry not, search path specifications are usually not this tricky.
@@ -11103,15 +11100,16 @@ The type of file being matched---@code{'directory} or
@code{'regular},
though it can be any symbol returned by @code{stat:type} (@pxref{File
System, @code{stat},, guile, GNU Guile Reference Manual}).
-In the libxml2 example above, we would match regular files; in the
-Python example, we would match directories.
+In the @env{XML_CATALOG_FILES} example above, we would match regular
+files; in the Python example, we would match directories.
@item @code{file-pattern} (default: @code{#f})
This must be either @code{#f} or a regular expression specifying
files to be matched @emph{within} the sub-directories specified by the
@code{files} field.
-Again, the libxml2 example shows a situation where this is needed.
+Again, the @env{XML_CATALOG_FILES} example shows a situation where this
+is needed.
@end table
@end deftp
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 6175a38365..7f9b19b6ee 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -602,12 +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 (search-path-specification
- (variable "XML_CATALOG_FILES")
- (separator " ")
- (files '("xml"))
- (file-pattern "^catalog\\.xml$")
- (file-type 'regular))))
+ (list $XML_CATALOG_FILES))
(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 d5c3c75cb9..b3112918ef 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -83,6 +83,7 @@ (define-module (gnu packages xml)
#:use-module (guix build-system python)
#:use-module (guix deprecation)
#:use-module (guix utils)
+ #:use-module (guix search-paths)
#:use-module (gnu packages linux)
#:use-module (gnu packages pkg-config))
@@ -223,14 +224,7 @@ (define-public libxml2
(inputs (list xz))
(propagated-inputs (list zlib)) ; libxml2.la says '-lz'.
(native-inputs (list perl))
- ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
- ;; sub-directory of any given package.
- (native-search-paths (list (search-path-specification
- (variable "XML_CATALOG_FILES")
- (separator " ")
- (files '("xml"))
- (file-pattern "^catalog\\.xml$")
- (file-type 'regular))))
+ (native-search-paths (list $XML_CATALOG_FILES))
(search-paths native-search-paths)
(description
"Libxml2 is the XML C parser and toolkit developed for the Gnome
@@ -1782,14 +1776,7 @@ (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))))
+ (native-search-paths (list $SGML_CATALOG_FILES))
(home-page "https://openjade.sourceforge.net/")
(synopsis "Suite of SGML/XML processing tools")
(description "OpenSP is an object-oriented toolkit for SGML parsing and
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index fcbe7b7953..9af71db402 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -37,6 +37,8 @@ (define-module (guix search-paths)
$PKG_CONFIG_PATH
$SSL_CERT_DIR
$SSL_CERT_FILE
+ $SGML_CATALOG_FILES
+ $XML_CATALOG_FILES
search-path-specification->sexp
sexp->search-path-specification
@@ -114,6 +116,29 @@ (define $SSL_CERT_FILE
(separator #f) ;single entry
(files '("etc/ssl/certs/ca-certificates.crt"))))
+;; Some packages (notably libxml2) make use of 'XML_CATALOG_FILES'
+;; and 'SGML_CATALOG_FILES' for remapping URI references or public/system
+;; identifiers to other URI references.
+(define $SGML_CATALOG_FILES
+ ;; $SGML_CATALOG_FILES lists 'catalog' or 'CATALOG' or '*.cat' files found
+ ;; under the 'sgml' sub-directory of any given package.
+ (search-path-specification
+ (variable "SGML_CATALOG_FILES")
+ (separator ":")
+ (files '("sgml"))
+ (file-pattern "^catalog$|^CATALOG$|^.*\\.cat$")
+ (file-type 'regular)))
+
+(define $XML_CATALOG_FILES
+ ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
+ ;; sub-directory of any given package.
+ (search-path-specification
+ (variable "XML_CATALOG_FILES")
+ (separator " ")
+ (files '("xml"))
+ (file-pattern "^catalog\\.xml$")
+ (file-type 'regular)))
+
(define (search-path-specification->sexp spec)
"Return an sexp representing SPEC, a <search-path-specification>. The sexp
corresponds to the arguments expected by `set-path-environment-variable'."
--
2.40.1
- [bug#65479] [PATCH core-updates 07/61] gnu: docbook-utils: Import patches from debian., (continued)
- [bug#65479] [PATCH core-updates 07/61] gnu: docbook-utils: Import patches from debian., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 14/61] gnu: libxslt: Set search-paths for XML and SGML catalogs., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 19/61] gnu: lilypond: Use dblatex/stable., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 15/61] gnu: dblatex: Add libxslt native-search-paths to its own., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 40/61] gnu: sssd: Drop xmllint workaround., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 47/61] gnu: libnotify: Split documentation., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 13/61] gnu: libxml2: Add SGML_CATALOG_FILES to native-search-path., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 05/61] gnu: docbook-xsl: Add rewrite entries for http., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 09/61] gnu: docbook2x: Fix sgml2xml-isoent and add test dependencies., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 06/61] gnu: docbook: Remove leftovers., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 12/61] search-paths: Add $XML_CATALOG_FILES and $SGML_CATALOG_FILES.,
Bruno Victal <=
- [bug#65479] [PATCH core-updates 39/61] gnu: gnome-session: Remove libxml2., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 16/61] gnu: dblatex: Split documentation., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 18/61] gnu: dblatex: Fix missing texlive binaries., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 21/61] gnu: xmlto: Rewrite with G-Expressions., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 23/61] gnu: gtk-doc: Add libxslt native-search-paths to its own., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 25/61] gnu: secilc: Drop xmlto workaround., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 35/61] gnu: metapixel: Drop docbook workaround., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 46/61] gnu: libnotify: Drop docbook workarounds., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 49/61] gnu: alsa-utils: Rewrite with G-Expressions., Bruno Victal, 2023/08/23
- [bug#65479] [PATCH core-updates 29/61] gnu: udisks: Drop docbook workaround., Bruno Victal, 2023/08/23