diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index f8a9edd769..070b957339 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -707,73 +707,72 @@ (define-public docbook2x "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0")))) (build-system gnu-build-system) (inputs - `(("bash-minimal" ,bash-minimal) - ("docbook-xml" ,docbook-xml-4.5) - ("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))) + (list bash-minimal + docbook-xml-4.5 + perl + perl-xml-namespacesupport + perl-xml-parser + perl-xml-sax + perl-xml-sax-base + texinfo + 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" - (("") - "")) - ;; 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")))))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'configure 'patch-sources + (lambda* (#:key inputs #:allow-other-keys) + ;; Fix failed substitution in config.pl + (substitute* "perl/config.pl" + (("\\$\\{prefix\\}") + #$output)) + ;; Fix a failing test (maybe it worked with old texinfo?) + (substitute* "test/complete-manuals/at1.xml" + (("") + "")) + ;; 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* ((programs + (map (lambda (p) + (search-input-file outputs + (string-append "bin/" p))) + '("db2x_manxml" "db2x_texixml" "db2x_xsltproc" + "docbook2man" "docbook2texi"))) + (perl5lib + '#$(map (lambda (i) + (file-append (this-package-input i) + "/lib/perl5/site_perl")) + '("perl-xml-namespacesupport" + "perl-xml-parser" + "perl-xml-sax" + "perl-xml-sax-base"))) + (xml-catalog-files + (list (search-input-file + inputs "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 _ + ;; 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 #$output + "/bin/db2x_" prog))) + '("docbook2man" "docbook2texi"))))))) (home-page "https://docbook2x.sourceforge.net") (synopsis "Convert DocBook to man page and Texinfo format") (description