unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50131] [PATCH 0/3] Add docbook2x and generate lxc man pages.
@ 2021-08-20 12:03 Andrew Whatson
  2021-08-20 12:09 ` [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module Andrew Whatson
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Whatson @ 2021-08-20 12:03 UTC (permalink / raw)
  To: 50131

Andrew Whatson (3):
  gnu: Prefix licenses in docbook module.
  gnu: Add docbook2x.
  gnu: Generate man pages for lxc.

 gnu/packages/docbook.scm        |  103 +++++++++++++++++++++++++++++---
 gnu/packages/virtualization.scm |    9 ++
 2 files changed, 103 insertions(+), 9 deletions(-)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module.
  2021-08-20 12:03 [bug#50131] [PATCH 0/3] Add docbook2x and generate lxc man pages Andrew Whatson
@ 2021-08-20 12:09 ` Andrew Whatson
  2021-08-20 12:09   ` [bug#50131] [PATCH 2/3] gnu: Add docbook2x Andrew Whatson
                     ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Andrew Whatson @ 2021-08-20 12:09 UTC (permalink / raw)
  To: 50131; +Cc: Andrew Whatson

This prevents conflicts between expat package and expat license.

* gnu/packages/docbook.scm (docbook-xml-5): Prefix license variable.
(docbook-xsl): Likewise.
(docbook-dsssl): Likewise.
(docbook-dsssl-doc): Likewise.
(docbook-sgml): Likewise.
(iso-8879-entities): Likewise.
(dblatex): Likewise.
---
 gnu/packages/docbook.scm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index 1945fb6a4b..6a69f8cf89 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -31,7 +31,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages base)
   #:use-module (gnu packages xml)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module ((guix build utils) #:select (alist-replace))
@@ -77,7 +77,7 @@
      "DocBook is general purpose XML and SGML document type particularly well
 suited to books and papers about computer hardware and software (though it is
 by no means limited to these applications.)  This package provides XML DTDs.")
-    (license (x11-style "" "See file headers."))))
+    (license (license:x11-style "" "See file headers."))))
 
 (define-public docbook-xml
   (package
@@ -215,7 +215,7 @@ by no means limited to these applications.)  This package provides XML DTDs.")
     (synopsis "DocBook XSL style sheets for document authoring")
     (description
      "This package provides XSL style sheets for DocBook.")
-    (license (x11-style "" "See 'COPYING' file."))))
+    (license (license:x11-style "" "See 'COPYING' file."))))
 
 (define-public docbook-dsssl
   (package
@@ -256,7 +256,7 @@ by no means limited to these applications.)  This package provides XML DTDs.")
     (home-page "https://docbook.org/")
     (synopsis "DSSSL style sheets for DocBook")
     (description "This package provides DSSSL style sheets for DocBook.")
-    (license (non-copyleft "file://README"))))
+    (license (license:non-copyleft "file://README"))))
 
 ;;; Private variable, used as the 'doc' output of the docbook-dsssl package.
 (define docbook-dsssl-doc
@@ -294,7 +294,7 @@ by no means limited to these applications.)  This package provides XML DTDs.")
     (home-page "https://docbook.org/")
     (synopsis "DocBook DSSSL style sheets documentation")
     (description "Documentation for the DocBook DSSSL style sheets.")
-    (license (non-copyleft "file://doc/LEGALNOTICE.htm"))))
+    (license (license:non-copyleft "file://doc/LEGALNOTICE.htm"))))
 
 (define-public docbook-sgml
   (package
@@ -336,7 +336,7 @@ by no means limited to these applications.)  This package provides XML DTDs.")
     (home-page "https://docbook.org")
     (synopsis "DocBook SGML style sheets for document authoring")
     (description "This package provides SGML style sheets for DocBook.")
-    (license (x11-style "" "See file headers."))))
+    (license (license:x11-style "" "See file headers."))))
 
 (define-public docbook-sgml-3.1
   (package
@@ -377,7 +377,7 @@ by no means limited to these applications.)  This package provides XML DTDs.")
     (synopsis "ISO 8879 character entities")
     (description "ISO 8879 character entities that are typically used in
 the in DocBook SGML DTDs.")
-    (license (x11-style "" "See file headers."))))
+    (license (license:x11-style "" "See file headers."))))
 
 (define-public dblatex
   (package
@@ -461,7 +461,7 @@ to DVI, PostScript or PDF by translating them in pure LaTeX as a first
 process.  MathML 2.0 markups are supported too.  It started as a clone of
 DB2LaTeX.")
     ;; lib/contrib/which is under an X11 license
-    (license gpl2+)))
+    (license license:gpl2+)))
 
 ;; This is a variant of the 'dblatex' package that is not updated often.  It
 ;; is intended to be used as a native-input at build-time only, e.g. by
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 2/3] gnu: Add docbook2x.
  2021-08-20 12:09 ` [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module Andrew Whatson
@ 2021-08-20 12:09   ` Andrew Whatson
  2021-08-26 15:36     ` Thiago Jung Bauermann via Guix-patches via
  2021-08-20 12:09   ` [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc Andrew Whatson
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Andrew Whatson @ 2021-08-20 12:09 UTC (permalink / raw)
  To: 50131; +Cc: Andrew Whatson

* gnu/packages/docbook.scm (docbook2x): New variable.
---
 gnu/packages/docbook.scm | 87 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index 6a69f8cf89..fdc432eb20 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2021 Andrew Whatson <whatson@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,10 +25,13 @@
 
 (define-module (gnu packages docbook)
   #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages inkscape)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages base)
   #:use-module (gnu packages xml)
@@ -35,6 +39,7 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module ((guix build utils) #:select (alist-replace))
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python))
 
@@ -473,3 +478,85 @@ DB2LaTeX.")
    (package/inherit dblatex
      (inputs (alist-replace "imagemagick" `(,imagemagick/stable)
                             (package-inputs dblatex))))))
+
+(define-public docbook2x
+  (package
+    (name "docbook2x")
+    (version "0.8.8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/docbook2x/docbook2x/"
+                                  version "/docbook2X-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("bash-minimal" ,bash-minimal)
+       ("docbook-xml" ,docbook-xml)
+       ("perl" ,perl)
+       ("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
+       ("perl-xml-parser" ,perl-xml-parser)
+       ("perl-xml-sax" ,perl-xml-sax)
+       ("perl-xml-sax-base" ,perl-xml-sax-base)
+       ("texinfo" ,texinfo)
+       ("xsltproc" ,libxslt)))
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--prefix=" (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'patch-sources
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Fix failed substitution in config.pl
+             (substitute* "perl/config.pl"
+               (("\\$\\{prefix\\}")
+                (assoc-ref outputs "out")))
+             ;; Fix a failing test (maybe it worked with old texinfo?)
+             (substitute* "test/complete-manuals/at1.xml"
+               (("<bridgehead>")
+                "<bridgehead renderas=\"sect2\">"))
+             ;; Patch all the tests use DocBook 4.5
+             (substitute* (find-files "test" "\\.xml$")
+               (("\"-//OASIS//DTD DocBook XML V4\\..+//EN\"")
+                "\"-//OASIS//DTD DocBook XML V4.5//EN\"")
+               (("\"http://www\\.oasis-open\\.org/docbook/xml/4\\..+/docbookx.dtd\"")
+                "\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""))
+             ;; Set XML catalogs for tests to pass
+             (setenv "XML_CATALOG_FILES"
+                     (string-append (assoc-ref inputs "docbook-xml")
+                                    "/xml/dtd/docbook/catalog.xml"))))
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (programs
+                     (map (lambda (p)
+                            (string-append out "/bin/" p))
+                          '("db2x_manxml" "db2x_texixml" "db2x_xsltproc"
+                            "docbook2man" "docbook2texi")))
+                    (perl5lib
+                     (map (lambda (i)
+                            (string-append (assoc-ref inputs i)
+                                           "/lib/perl5/site_perl"))
+                          '("perl-xml-namespacesupport"
+                            "perl-xml-parser"
+                            "perl-xml-sax"
+                            "perl-xml-sax-base")))
+                    (xml-catalog-files
+                     (list (string-append (assoc-ref inputs "docbook-xml")
+                                          "/xml/dtd/docbook/catalog.xml"))))
+               (map (lambda (program)
+                      (wrap-program program
+                        `("PERL5LIB" ":" prefix
+                          ,perl5lib)
+                        `("XML_CATALOG_FILES" " " prefix
+                          ,xml-catalog-files)))
+                    programs)))))))
+    (home-page "http://docbook2x.sourceforge.net")
+    (synopsis "Convert DocBook to man page and Texinfo format")
+    (description
+     "docbook2X is a software package that converts DocBook documents into the
+traditional Unix man page format and the GNU Texinfo format.  Notable features
+include table support for man pages, internationalization support, and easy
+customization of the output using XSLT.")
+    (license license:expat)))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc.
  2021-08-20 12:09 ` [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module Andrew Whatson
  2021-08-20 12:09   ` [bug#50131] [PATCH 2/3] gnu: Add docbook2x Andrew Whatson
@ 2021-08-20 12:09   ` Andrew Whatson
  2021-08-26 15:49     ` Thiago Jung Bauermann via Guix-patches via
  2021-08-27  4:15   ` [bug#50131] [PATCH 2/3 v2] gnu: Add docbook2x Andrew Whatson
  2021-08-27  4:15   ` [bug#50131] [PATCH 3/3 v2] gnu: Generate man pages for lxc Andrew Whatson
  3 siblings, 1 reply; 11+ messages in thread
From: Andrew Whatson @ 2021-08-20 12:09 UTC (permalink / raw)
  To: 50131; +Cc: Andrew Whatson

* gnu/packages/virtualization.scm (lxc)[inputs]: Add docboo2x.
[phases]{patch-docbook-dtd}: New phase.
---
 gnu/packages/virtualization.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 1bbcb46b99..f1a9e28d3f 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1008,7 +1008,8 @@ all common programming languages.  Vala bindings are also provided.")
                 "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("docbook2x" ,docbook2x)))
     (inputs
      `(("gnutls" ,gnutls)
        ("libcap" ,libcap)
@@ -1022,6 +1023,12 @@ all common programming languages.  Vala bindings are also provided.")
              "--localstatedir=/var")
        #:phases
        (modify-phases %standard-phases
+         (add-before 'configure 'patch-docbook-dtd
+           (lambda _
+             ;; Fix incorrect DocBook DTD
+             (substitute* "configure"
+               (("\\\\\"-//Davenport//DTD DocBook V3\\.0//EN\\\\\"")
+                "\\\"-//OASIS//DTD DocBook XML\\\" \\\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\\\""))))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out         (assoc-ref outputs "out"))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 2/3] gnu: Add docbook2x.
  2021-08-20 12:09   ` [bug#50131] [PATCH 2/3] gnu: Add docbook2x Andrew Whatson
@ 2021-08-26 15:36     ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 0 replies; 11+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-26 15:36 UTC (permalink / raw)
  To: 50131, Andrew Whatson

Hello Andrew,

Em sexta-feira, 20 de agosto de 2021, às 09:09:06 -03, Andrew Whatson 
escreveu:
> * gnu/packages/docbook.scm (docbook2x): New variable.
> ---
>  gnu/packages/docbook.scm | 87 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 87 insertions(+)

FWIW, this looks good to me. Just one minor comment below.
 
> @@ -473,3 +478,85 @@ DB2LaTeX.")
>     (package/inherit dblatex
>       (inputs (alist-replace "imagemagick" `(,imagemagick/stable)
>                              (package-inputs dblatex))))))
> +
> +(define-public docbook2x
> +  (package
> +    (name "docbook2x")
> +    (version "0.8.8")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> "mirror://sourceforge/docbook2x/docbook2x/" +                           
>       version "/docbook2X-" version ".tar.gz")) +              (sha256
> +               (base32
> +               
> "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0")))) +   
> (build-system gnu-build-system)
> +    (inputs
> +     `(("bash-minimal" ,bash-minimal)
> +       ("docbook-xml" ,docbook-xml)
> +       ("perl" ,perl)
> +       ("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
> +       ("perl-xml-parser" ,perl-xml-parser)
> +       ("perl-xml-sax" ,perl-xml-sax)
> +       ("perl-xml-sax-base" ,perl-xml-sax-base)
> +       ("texinfo" ,texinfo)
> +       ("xsltproc" ,libxslt)))
> +    (arguments
> +     `(#:configure-flags
> +       (list (string-append "--prefix=" (assoc-ref %outputs "out")))

There’s no need to pass the prefix argument. ‘gnu-build-system’ already 
does it.

-- 
Thanks,
Thiago







^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc.
  2021-08-20 12:09   ` [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc Andrew Whatson
@ 2021-08-26 15:49     ` Thiago Jung Bauermann via Guix-patches via
  2021-08-27  4:21       ` Andrew Whatson
  0 siblings, 1 reply; 11+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-26 15:49 UTC (permalink / raw)
  To: 50131, Andrew Whatson

Hello Andrew,

Em sexta-feira, 20 de agosto de 2021, às 09:09:07 -03, Andrew Whatson 
escreveu:
> * gnu/packages/virtualization.scm (lxc)[inputs]: Add docboo2x.
> [phases]{patch-docbook-dtd}: New phase.
> ---
>  gnu/packages/virtualization.scm | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Looks good to me. Just one question below.

> diff --git a/gnu/packages/virtualization.scm
> b/gnu/packages/virtualization.scm index 1bbcb46b99..f1a9e28d3f 100644
> --- a/gnu/packages/virtualization.scm
> +++ b/gnu/packages/virtualization.scm
> @@ -1008,7 +1008,8 @@ all common programming languages.  Vala bindings
> are also provided.")
> "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci")))) (build-system
> gnu-build-system)
>      (native-inputs
> -     `(("pkg-config" ,pkg-config)))
> +     `(("pkg-config" ,pkg-config)
> +       ("docbook2x" ,docbook2x)))
>      (inputs
>       `(("gnutls" ,gnutls)
>         ("libcap" ,libcap)
> @@ -1022,6 +1023,12 @@ all common programming languages.  Vala bindings
> are also provided.") "--localstatedir=/var")
>         #:phases
>         (modify-phases %standard-phases
> +         (add-before 'configure 'patch-docbook-dtd
> +           (lambda _
> +             ;; Fix incorrect DocBook DTD
> +             (substitute* "configure"
> +               (("\\\\\"-//Davenport//DTD DocBook V3\\.0//EN\\\\\"")
> +                "\\\"-//OASIS//DTD DocBook XML\\\"
> \\\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\\\""))))

Has this fix been submitted upstream, or is it already available in a newer 
lxc version? Ideally, we wouldn’t have to carry this change indefinitely.

The same question would apply to the substitutions made in docbook2x, but 
that project seems abandoned so there’s no point.

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 2/3 v2] gnu: Add docbook2x.
  2021-08-20 12:09 ` [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module Andrew Whatson
  2021-08-20 12:09   ` [bug#50131] [PATCH 2/3] gnu: Add docbook2x Andrew Whatson
  2021-08-20 12:09   ` [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc Andrew Whatson
@ 2021-08-27  4:15   ` Andrew Whatson
  2021-08-27  4:15   ` [bug#50131] [PATCH 3/3 v2] gnu: Generate man pages for lxc Andrew Whatson
  3 siblings, 0 replies; 11+ messages in thread
From: Andrew Whatson @ 2021-08-27  4:15 UTC (permalink / raw)
  To: 50131; +Cc: Andrew Whatson

* gnu/packages/docbook.scm (docbook2x): New variable.
---
 gnu/packages/docbook.scm | 94 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index 6a69f8cf89..ba90376e8b 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2021 Andrew Whatson <whatson@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,10 +25,13 @@
 
 (define-module (gnu packages docbook)
   #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages inkscape)
   #:use-module (gnu packages tex)
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages base)
   #:use-module (gnu packages xml)
@@ -35,6 +39,7 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module ((guix build utils) #:select (alist-replace))
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system python))
 
@@ -473,3 +478,92 @@ DB2LaTeX.")
    (package/inherit dblatex
      (inputs (alist-replace "imagemagick" `(,imagemagick/stable)
                             (package-inputs dblatex))))))
+
+(define-public docbook2x
+  (package
+    (name "docbook2x")
+    (version "0.8.8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/docbook2x/docbook2x/"
+                                  version "/docbook2X-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("bash-minimal" ,bash-minimal)
+       ("docbook-xml" ,docbook-xml)
+       ("perl" ,perl)
+       ("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
+       ("perl-xml-parser" ,perl-xml-parser)
+       ("perl-xml-sax" ,perl-xml-sax)
+       ("perl-xml-sax-base" ,perl-xml-sax-base)
+       ("texinfo" ,texinfo)
+       ("xsltproc" ,libxslt)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'patch-sources
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Fix failed substitution in config.pl
+             (substitute* "perl/config.pl"
+               (("\\$\\{prefix\\}")
+                (assoc-ref outputs "out")))
+             ;; Fix a failing test (maybe it worked with old texinfo?)
+             (substitute* "test/complete-manuals/at1.xml"
+               (("<bridgehead>")
+                "<bridgehead renderas=\"sect2\">"))
+             ;; Patch all the tests use DocBook 4.5
+             (substitute* (find-files "test" "\\.xml$")
+               (("\"-//OASIS//DTD DocBook XML V4\\..+//EN\"")
+                "\"-//OASIS//DTD DocBook XML V4.5//EN\"")
+               (("\"http://www\\.oasis-open\\.org/docbook/xml/4\\..+/docbookx.dtd\"")
+                "\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""))
+             ;; Set XML catalogs for tests to pass
+             (setenv "XML_CATALOG_FILES"
+                     (string-append (assoc-ref inputs "docbook-xml")
+                                    "/xml/dtd/docbook/catalog.xml"))))
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (programs
+                     (map (lambda (p)
+                            (string-append out "/bin/" p))
+                          '("db2x_manxml" "db2x_texixml" "db2x_xsltproc"
+                            "docbook2man" "docbook2texi")))
+                    (perl5lib
+                     (map (lambda (i)
+                            (string-append (assoc-ref inputs i)
+                                           "/lib/perl5/site_perl"))
+                          '("perl-xml-namespacesupport"
+                            "perl-xml-parser"
+                            "perl-xml-sax"
+                            "perl-xml-sax-base")))
+                    (xml-catalog-files
+                     (list (string-append (assoc-ref inputs "docbook-xml")
+                                          "/xml/dtd/docbook/catalog.xml"))))
+               (map (lambda (program)
+                      (wrap-program program
+                        `("PERL5LIB" ":" prefix
+                          ,perl5lib)
+                        `("XML_CATALOG_FILES" " " prefix
+                          ,xml-catalog-files)))
+                    programs))))
+         (add-after 'install 'create-symlinks
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               ;; Create db2x_* symlinks to satisfy some configure scripts
+               ;; which use these names to differentiate from an older
+               ;; docbook2man script provided by docbook-utils.
+               (map (lambda (prog)
+                      (symlink prog (string-append out "/bin/db2x_" prog)))
+                    '("docbook2man" "docbook2texi"))))))))
+    (home-page "http://docbook2x.sourceforge.net")
+    (synopsis "Convert DocBook to man page and Texinfo format")
+    (description
+     "docbook2X is a software package that converts DocBook documents into the
+traditional Unix man page format and the GNU Texinfo format.  Notable features
+include table support for man pages, internationalization support, and easy
+customization of the output using XSLT.")
+    (license license:expat)))
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 3/3 v2] gnu: Generate man pages for lxc.
  2021-08-20 12:09 ` [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module Andrew Whatson
                     ` (2 preceding siblings ...)
  2021-08-27  4:15   ` [bug#50131] [PATCH 2/3 v2] gnu: Add docbook2x Andrew Whatson
@ 2021-08-27  4:15   ` Andrew Whatson
  2021-08-27 17:48     ` Thiago Jung Bauermann via Guix-patches via
  3 siblings, 1 reply; 11+ messages in thread
From: Andrew Whatson @ 2021-08-27  4:15 UTC (permalink / raw)
  To: 50131; +Cc: Andrew Whatson

* gnu/packages/virtualization.scm (lxc)[inputs]: Add docboo2x.
---
 gnu/packages/virtualization.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index e952c009b5..667dd0fa3e 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1008,7 +1008,8 @@ all common programming languages.  Vala bindings are also provided.")
                 "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("docbook2x" ,docbook2x)))
     (inputs
      `(("gnutls" ,gnutls)
        ("libcap" ,libcap)
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc.
  2021-08-26 15:49     ` Thiago Jung Bauermann via Guix-patches via
@ 2021-08-27  4:21       ` Andrew Whatson
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Whatson @ 2021-08-27  4:21 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: 50131

On Thu, 26 Aug 2021 at 15:37, Thiago Jung Bauermann
<bauermann@kolabnow.com> wrote:
>
> There’s no need to pass the prefix argument. ‘gnu-build-system’ already
> does it.

Thanks, fixed in the revised patch.

> > +         (add-before 'configure 'patch-docbook-dtd
> > +           (lambda _
> > +             ;; Fix incorrect DocBook DTD
> > +             (substitute* "configure"
> > +               (("\\\\\"-//Davenport//DTD DocBook V3\\.0//EN\\\\\"")
> > +                "\\\"-//OASIS//DTD DocBook XML\\\"
> > \\\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\\\""))))
>
> Has this fix been submitted upstream, or is it already available in a newer
> lxc version? Ideally, we wouldn’t have to carry this change indefinitely.

The lxc configure script checks for both db2x_docbook2man and
docbook2man (in that order).  If it finds docbook2man, it assumes this
is an older tool and formats the documents with the wrong DTD.  I've
revised the docbook2x package to provide a db2x_docbook2man symlink as
it's possible other packages using docbook2x will make the same
assumption.  This means patching configure is no longure required.

> The same question would apply to the substitutions made in docbook2x, but
> that project seems abandoned so there’s no point.

Similar fixes for docbook2x are found in the arch & nix builds, and
actually some have been incorporated into its CVS repo but never been
released.  I haven't tried to get in touch with upstream, but I guess
it's worth a shot.

Thanks!




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#50131] [PATCH 3/3 v2] gnu: Generate man pages for lxc.
  2021-08-27  4:15   ` [bug#50131] [PATCH 3/3 v2] gnu: Generate man pages for lxc Andrew Whatson
@ 2021-08-27 17:48     ` Thiago Jung Bauermann via Guix-patches via
  2021-09-13 10:30       ` bug#50131: [PATCH 0/3] Add docbook2x and generate lxc man pages Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2021-08-27 17:48 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 50131

Hello Andrew,

Em sexta-feira, 27 de agosto de 2021, às 01:15:38 -03, Andrew Whatson 
escreveu:
> * gnu/packages/virtualization.scm (lxc)[inputs]: Add docboo2x.
> ---
>  gnu/packages/virtualization.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/virtualization.scm
> b/gnu/packages/virtualization.scm index e952c009b5..667dd0fa3e 100644
> --- a/gnu/packages/virtualization.scm
> +++ b/gnu/packages/virtualization.scm
> @@ -1008,7 +1008,8 @@ all common programming languages.  Vala bindings
> are also provided.")
> "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci")))) (build-system
> gnu-build-system)
>      (native-inputs
> -     `(("pkg-config" ,pkg-config)))
> +     `(("pkg-config" ,pkg-config)
> +       ("docbook2x" ,docbook2x)))
>      (inputs
>       `(("gnutls" ,gnutls)
>         ("libcap" ,libcap)

Awesome! Both patch 2/3 v2 and this one look good to me.
The symlink trick was a great find.

-- 
Thanks,
Thiago






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#50131: [PATCH 0/3] Add docbook2x and generate lxc man pages.
  2021-08-27 17:48     ` Thiago Jung Bauermann via Guix-patches via
@ 2021-09-13 10:30       ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2021-09-13 10:30 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: Andrew Whatson, 50131-done

Hello,

Thiago Jung Bauermann <bauermann@kolabnow.com> skribis:

> Em sexta-feira, 27 de agosto de 2021, às 01:15:38 -03, Andrew Whatson 
> escreveu:
>> * gnu/packages/virtualization.scm (lxc)[inputs]: Add docboo2x.
>> ---
>>  gnu/packages/virtualization.scm | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/gnu/packages/virtualization.scm
>> b/gnu/packages/virtualization.scm index e952c009b5..667dd0fa3e 100644
>> --- a/gnu/packages/virtualization.scm
>> +++ b/gnu/packages/virtualization.scm
>> @@ -1008,7 +1008,8 @@ all common programming languages.  Vala bindings
>> are also provided.")
>> "0qz4l7mlhq7hx53q606qgvkyzyr01glsw290v8ppzvxn1fydlrci")))) (build-system
>> gnu-build-system)
>>      (native-inputs
>> -     `(("pkg-config" ,pkg-config)))
>> +     `(("pkg-config" ,pkg-config)
>> +       ("docbook2x" ,docbook2x)))
>>      (inputs
>>       `(("gnutls" ,gnutls)
>>         ("libcap" ,libcap)
>
> Awesome! Both patch 2/3 v2 and this one look good to me.
> The symlink trick was a great find.

Applied all three patches.

Thanks Andrew, and thanks Thiago for reviewing!

Ludo’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-09-13 10:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-20 12:03 [bug#50131] [PATCH 0/3] Add docbook2x and generate lxc man pages Andrew Whatson
2021-08-20 12:09 ` [bug#50131] [PATCH 1/3] gnu: Prefix licenses in docbook module Andrew Whatson
2021-08-20 12:09   ` [bug#50131] [PATCH 2/3] gnu: Add docbook2x Andrew Whatson
2021-08-26 15:36     ` Thiago Jung Bauermann via Guix-patches via
2021-08-20 12:09   ` [bug#50131] [PATCH 3/3] gnu: Generate man pages for lxc Andrew Whatson
2021-08-26 15:49     ` Thiago Jung Bauermann via Guix-patches via
2021-08-27  4:21       ` Andrew Whatson
2021-08-27  4:15   ` [bug#50131] [PATCH 2/3 v2] gnu: Add docbook2x Andrew Whatson
2021-08-27  4:15   ` [bug#50131] [PATCH 3/3 v2] gnu: Generate man pages for lxc Andrew Whatson
2021-08-27 17:48     ` Thiago Jung Bauermann via Guix-patches via
2021-09-13 10:30       ` bug#50131: [PATCH 0/3] Add docbook2x and generate lxc man pages Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).