1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages docbook)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages compression)
25 #:use-module (gnu packages imagemagick)
26 #:use-module (gnu packages inkscape)
27 #:use-module (gnu packages tex)
28 #:use-module (gnu packages python)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages xml)
31 #:use-module (guix licenses)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system trivial)
35 #:use-module (guix build-system python))
37 (define-public docbook-xml
43 (uri (string-append "http://www.docbook.org/xml/" version
44 "/docbook-xml-" version ".zip"))
47 "1d671lcjckjri28xfbf6dq7y3xnkppa910w1jin8rjc35dx06kjf"))))
48 (build-system trivial-build-system)
51 (use-modules (guix build utils))
54 (string-append (assoc-ref %build-inputs "unzip")
56 (source (assoc-ref %build-inputs "source"))
57 (out (assoc-ref %outputs "out"))
58 (dtd (string-append out "/xml/dtd/docbook")))
60 (with-directory-excursion dtd
61 (invoke unzip source))
62 (substitute* (string-append out "/xml/dtd/docbook/catalog.xml")
65 "uri=\"file://" dtd "/")))
67 #:modules ((guix build utils))))
68 (native-inputs `(("unzip" ,unzip)))
69 (home-page "http://docbook.org")
70 (synopsis "DocBook XML DTDs for document authoring")
72 "DocBook is general purpose XML and SGML document type particularly well
73 suited to books and papers about computer hardware and software (though it is
74 by no means limited to these applications.) This package provides XML DTDs.")
75 (license (x11-style "" "See file headers."))))
77 (define-public docbook-xml-4.4
78 (package (inherit docbook-xml)
82 (uri (string-append "http://www.docbook.org/xml/" version
83 "/docbook-xml-" version ".zip"))
86 "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82"))))))
88 (define-public docbook-xml-4.3
89 (package (inherit docbook-xml)
93 (uri (string-append "http://www.docbook.org/xml/" version
94 "/docbook-xml-" version ".zip"))
97 "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3"))))))
99 (define-public docbook-xml-4.2
100 (package (inherit docbook-xml)
104 (uri (string-append "http://www.docbook.org/xml/" version
105 "/docbook-xml-" version ".zip"))
108 "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c"))))))
110 (define-public docbook-xml-4.1.2
111 (package (inherit docbook-xml)
115 (uri (string-append "http://www.docbook.org/xml/" version
119 "0wkp5rvnqj0ghxia0558mnn4c7s3n501j99q2isp3sp0ci069w1h"))))
121 '(#:modules ((guix build utils))
124 (use-modules (guix build utils))
125 (let ((source (assoc-ref %build-inputs "source"))
126 (unzip (string-append (assoc-ref %build-inputs "unzip")
128 (dtd (string-append (assoc-ref %outputs "out")
129 "/xml/dtd/docbook")))
131 (invoke unzip source "-d" dtd)))))))
133 (define-public docbook-xsl
139 (uri (string-append "mirror://sourceforge/docbook/docbook-xsl/"
140 version "/docbook-xsl-" version ".tar.bz2"))
141 (patches (search-patches "docbook-xsl-nonrecursive-string-subst.patch"))
144 "0s59lihif2fr7rznckxr2kfyrvkirv76r1zvidp9b5mj28p4apvj"))
145 (modules '((guix build utils)))
148 (for-each delete-file (find-files "." "\\.jar$"))
150 (build-system trivial-build-system)
152 `(#:builder (let ((name-version (string-append ,name "-" ,version)))
153 (use-modules (guix build utils))
155 (let* ((bzip2 (assoc-ref %build-inputs "bzip2"))
156 (xz (assoc-ref %build-inputs "xz"))
157 (tar (assoc-ref %build-inputs "tar"))
158 (source (assoc-ref %build-inputs "source"))
159 (out (assoc-ref %outputs "out"))
160 (xsl (string-append out "/xml/xsl")))
161 (setenv "PATH" (string-append bzip2 "/bin" ":" xz "/bin"))
162 (invoke (string-append tar "/bin/tar") "xvf" source)
165 (copy-recursively name-version
166 (string-append xsl "/" name-version))
168 (substitute* (string-append xsl "/" name-version "/catalog.xml")
169 (("rewritePrefix=\"./")
170 (string-append "rewritePrefix=\"file://" xsl "/"
173 #:modules ((guix build utils))))
174 (native-inputs `(("bzip2" ,bzip2)
175 ("xz" ,xz) ;needed for repacked tarballs
177 (home-page "http://docbook.org")
178 (synopsis "DocBook XSL style sheets for document authoring")
180 "This package provides XSL style sheets for DocBook.")
181 (license (x11-style "" "See 'COPYING' file."))))
183 (define-public dblatex
189 (uri (string-append "mirror://sourceforge/dblatex/dblatex/"
190 "dblatex-" version "/dblatex-"
194 "1yicd861rqz78i2khl35j7nvc0ccv4jx4hzqrbhll17082vrdmkg"))))
195 (build-system python-build-system)
196 ;; TODO: Add xfig/transfig for fig2dev utility
198 `(("texlive" ,(texlive-union (list texlive-latex-amsfonts
199 texlive-latex-anysize
200 texlive-latex-appendix
201 texlive-latex-changebar
202 texlive-latex-colortbl
204 texlive-latex-eso-pic
205 texlive-latex-fancybox
206 texlive-latex-fancyhdr
207 texlive-latex-fancyvrb
209 texlive-latex-footmisc
210 texlive-latex-hyperref
211 texlive-latex-jknapltx
212 texlive-latex-listings
213 texlive-latex-multirow
214 texlive-latex-oberdiek
215 texlive-latex-overpic
216 texlive-latex-pdfpages
217 texlive-latex-subfigure
218 texlive-latex-titlesec
220 texlive-latex-wasysym
222 texlive-fonts-amsfonts
225 texlive-fonts-stmaryrd
227 texlive-generic-ifxetex)))
228 ("imagemagick" ,imagemagick) ;for convert
229 ("inkscape" ,inkscape) ;for svg conversion
230 ("docbook" ,docbook-xml)
231 ("libxslt" ,libxslt))) ;for xsltproc
233 `(#:python ,python-2 ;'print' syntax
234 ;; Using setuptools causes an invalid "package_base" path in
235 ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused
236 ;; by dblatex's setup.py stripping the root path when creating the
237 ;; script. (dblatex's setup.py still uses distutils and thus has to
238 ;; create the script by itself. The feature for creating scripts is one
239 ;; of setuptools' features.)
240 ;; See this thread for details:
241 ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html
243 #:tests? #f ;no 'test' command
245 (modify-phases %standard-phases
246 (add-after 'wrap 'set-path
247 (lambda* (#:key inputs outputs #:allow-other-keys)
248 (let ((out (assoc-ref outputs "out")))
249 ;; dblatex executes helper programs at runtime.
250 (wrap-program (string-append out "/bin/dblatex")
252 ,(map (lambda (input)
253 (string-append (assoc-ref inputs input)
255 '("libxslt" "texlive"
256 "imagemagick" "inkscape"))))
258 (home-page "http://dblatex.sourceforge.net")
259 (synopsis "DocBook to LaTeX Publishing")
261 "DocBook to LaTeX Publishing transforms your SGML/XML DocBook documents
262 to DVI, PostScript or PDF by translating them in pure LaTeX as a first
263 process. MathML 2.0 markups are supported too. It started as a clone of
265 ;; lib/contrib/which is under an X11 license