diff options
| author | Bruno Victal <mirai@makinata.eu> | 2023-04-26 01:56:59 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-08-31 10:42:04 +0200 |
| commit | b7947e53d9d20d31ded2dd7c3e8548d694c780fa (patch) | |
| tree | 44f74eb4ef5ed3c962fb5dad027ac9a2f8f2ec25 /gnu/packages/docbook.scm | |
| parent | 69eea259df7d03977c4c010cc91372a70f07879a (diff) | |
gnu: docbook: Refactor dblatex packages.
* gnu/packages/docbook.scm (dblatex): Rewrite using G-Expressions.
(dblatex/stable): Use modify-inputs.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: Ic4c974c60a80871c5bf4764b88b913c871208b3f
Diffstat (limited to 'gnu/packages/docbook.scm')
| -rw-r--r-- | gnu/packages/docbook.scm | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index eb4d40e8882..8e61592f3b3 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #:use-module (gnu packages python) | 37 | #:use-module (gnu packages python) |
| 38 | #:use-module (gnu packages base) | 38 | #:use-module (gnu packages base) |
| 39 | #:use-module (gnu packages web-browsers) | 39 | #:use-module (gnu packages web-browsers) |
| 40 | #:use-module (gnu packages xfig) | ||
| 40 | #:use-module (gnu packages xml) | 41 | #:use-module (gnu packages xml) |
| 41 | #:use-module (guix gexp) | 42 | #:use-module (guix gexp) |
| 42 | #:use-module (guix utils) | 43 | #:use-module (guix utils) |
| @@ -44,7 +45,6 @@ | |||
| 44 | #:use-module (guix packages) | 45 | #:use-module (guix packages) |
| 45 | #:use-module (guix download) | 46 | #:use-module (guix download) |
| 46 | #:use-module (guix git-download) | 47 | #:use-module (guix git-download) |
| 47 | #:use-module ((guix build utils) #:select (alist-replace)) | ||
| 48 | #:use-module (guix build-system copy) | 48 | #:use-module (guix build-system copy) |
| 49 | #:use-module (guix build-system gnu) | 49 | #:use-module (guix build-system gnu) |
| 50 | #:use-module (guix build-system trivial) | 50 | #:use-module (guix build-system trivial) |
| @@ -600,9 +600,33 @@ the in DocBook SGML DTDs.") | |||
| 600 | (base32 | 600 | (base32 |
| 601 | "0yd09nypswy3q4scri1dg7dr99d7gd6r2dwx0xm81l9f4y32gs0n")))) | 601 | "0yd09nypswy3q4scri1dg7dr99d7gd6r2dwx0xm81l9f4y32gs0n")))) |
| 602 | (build-system python-build-system) | 602 | (build-system python-build-system) |
| 603 | ;; TODO: Add fig2dev for fig2dev utility. | 603 | (arguments |
| 604 | (list | ||
| 605 | ;; Using setuptools causes an invalid "package_base" path in | ||
| 606 | ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused | ||
| 607 | ;; by dblatex's setup.py stripping the root path when creating the | ||
| 608 | ;; script. (dblatex's setup.py still uses distutils and thus has to | ||
| 609 | ;; create the script by itself. The feature for creating scripts is one | ||
| 610 | ;; of setuptools' features.) | ||
| 611 | ;; See this thread for details: | ||
| 612 | ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html | ||
| 613 | #:use-setuptools? #f | ||
| 614 | #:tests? #f ;no test suite | ||
| 615 | #:phases | ||
| 616 | #~(modify-phases %standard-phases | ||
| 617 | (add-after 'wrap 'set-path | ||
| 618 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 619 | (let ((path (map (lambda (x) | ||
| 620 | (string-append (assoc-ref inputs x) | ||
| 621 | "/bin")) | ||
| 622 | (list "libxslt" | ||
| 623 | "imagemagick" "inkscape" | ||
| 624 | "texlive-updmap.cfg")))) | ||
| 625 | ;; dblatex executes helper programs at runtime. | ||
| 626 | (wrap-program (string-append #$output "/bin/dblatex") | ||
| 627 | `("PATH" ":" prefix ,path)))))))) | ||
| 604 | (inputs | 628 | (inputs |
| 605 | `(("texlive" ,(texlive-updmap.cfg (list texlive-anysize | 629 | (list (texlive-updmap.cfg (list texlive-anysize |
| 606 | texlive-appendix | 630 | texlive-appendix |
| 607 | texlive-changebar | 631 | texlive-changebar |
| 608 | texlive-fancybox | 632 | texlive-fancybox |
| @@ -619,35 +643,13 @@ the in DocBook SGML DTDs.") | |||
| 619 | texlive-stmaryrd | 643 | texlive-stmaryrd |
| 620 | texlive-subfigure | 644 | texlive-subfigure |
| 621 | texlive-titlesec | 645 | texlive-titlesec |
| 622 | texlive-wasysym))) | 646 | texlive-wasysym)) |
| 623 | ("imagemagick" ,imagemagick) ;for convert | 647 | ;; FIXME: transfig causes the build to fail. |
| 624 | ("inkscape" ,inkscape/stable) ;for svg conversion | 648 | ;;transfig ;for fig2dev |
| 625 | ("docbook" ,docbook-xml) | 649 | imagemagick ;for convert |
| 626 | ("libxslt" ,libxslt))) ;for xsltproc | 650 | inkscape/stable ;for svg conversion |
| 627 | (arguments | 651 | docbook-xml |
| 628 | `( ;; Using setuptools causes an invalid "package_base" path in | 652 | libxslt)) ;for xsltproc |
| 629 | ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused | ||
| 630 | ;; by dblatex's setup.py stripping the root path when creating the | ||
| 631 | ;; script. (dblatex's setup.py still uses distutils and thus has to | ||
| 632 | ;; create the script by itself. The feature for creating scripts is one | ||
| 633 | ;; of setuptools' features.) | ||
| 634 | ;; See this thread for details: | ||
| 635 | ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html | ||
| 636 | #:use-setuptools? #f | ||
| 637 | #:tests? #f ;no 'test' command | ||
| 638 | #:phases | ||
| 639 | (modify-phases %standard-phases | ||
| 640 | (add-after 'wrap 'set-path | ||
| 641 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 642 | (let ((out (assoc-ref outputs "out"))) | ||
| 643 | ;; dblatex executes helper programs at runtime. | ||
| 644 | (wrap-program (string-append out "/bin/dblatex") | ||
| 645 | `("PATH" ":" prefix | ||
| 646 | ,(map (lambda (input) | ||
| 647 | (string-append (assoc-ref inputs input) | ||
| 648 | "/bin")) | ||
| 649 | '("libxslt" "texlive" | ||
| 650 | "imagemagick" "inkscape")))))))))) | ||
| 651 | (home-page "https://dblatex.sourceforge.net") | 653 | (home-page "https://dblatex.sourceforge.net") |
| 652 | (synopsis "DocBook to LaTeX Publishing") | 654 | (synopsis "DocBook to LaTeX Publishing") |
| 653 | (description | 655 | (description |
| @@ -666,8 +668,8 @@ DB2LaTeX.") | |||
| 666 | (define-public dblatex/stable | 668 | (define-public dblatex/stable |
| 667 | (hidden-package | 669 | (hidden-package |
| 668 | (package/inherit dblatex | 670 | (package/inherit dblatex |
| 669 | (inputs (alist-replace "imagemagick" `(,imagemagick/stable) | 671 | (inputs (modify-inputs (package-inputs dblatex) |
| 670 | (package-inputs dblatex)))))) | 672 | (replace "imagemagick" imagemagick/stable)))))) |
| 671 | 673 | ||
| 672 | (define-public docbook-utils | 674 | (define-public docbook-utils |
| 673 | (package | 675 | (package |
