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>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages docbook)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages compression)
23 #:use-module (gnu packages imagemagick)
24 #:use-module (gnu packages inkscape)
25 #:use-module (gnu packages texlive)
26 #:use-module (gnu packages python)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages xml)
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system trivial)
33 #:use-module (guix build-system python)
34 #:autoload (gnu packages zip) (unzip))
36 (define-public docbook-xml
42 (uri (string-append "http://www.docbook.org/xml/" version
43 "/docbook-xml-" version ".zip"))
46 "1d671lcjckjri28xfbf6dq7y3xnkppa910w1jin8rjc35dx06kjf"))))
47 (build-system trivial-build-system)
50 (use-modules (guix build utils))
53 (string-append (assoc-ref %build-inputs "unzip")
55 (source (assoc-ref %build-inputs "source"))
56 (out (assoc-ref %outputs "out"))
57 (dtd (string-append out "/xml/dtd/docbook")))
59 (with-directory-excursion dtd
60 (system* unzip source))
61 (substitute* (string-append out "/xml/dtd/docbook/catalog.xml")
64 "uri=\"file://" dtd "/")))))
65 #:modules ((guix build utils))))
66 (native-inputs `(("unzip" ,unzip)))
67 (home-page "http://docbook.org")
68 (synopsis "DocBook XML DTDs for document authoring")
70 "DocBook is general purpose XML and SGML document type particularly well
71 suited to books and papers about computer hardware and software (though it is
72 by no means limited to these applications.) This package provides XML DTDs.")
73 (license (x11-style "" "See file headers."))))
75 (define-public docbook-xml-4.4
76 (package (inherit docbook-xml)
80 (uri (string-append "http://www.docbook.org/xml/" version
81 "/docbook-xml-" version ".zip"))
84 "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82"))))))
86 (define-public docbook-xml-4.3
87 (package (inherit docbook-xml)
91 (uri (string-append "http://www.docbook.org/xml/" version
92 "/docbook-xml-" version ".zip"))
95 "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3"))))))
97 (define-public docbook-xml-4.2
98 (package (inherit docbook-xml)
102 (uri (string-append "http://www.docbook.org/xml/" version
103 "/docbook-xml-" version ".zip"))
106 "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c"))))))
108 (define-public docbook-xsl
114 (uri (string-append "mirror://sourceforge/docbook/docbook-xsl-"
118 "0rxl013ncmz1n6ymk2idvx3hix9pdabk8xn01cpcv32wmfb753y9"))))
119 (build-system trivial-build-system)
121 `(#:builder (let ((name-version (string-append ,name "-" ,version)))
122 (use-modules (guix build utils))
124 (let* ((bzip2 (assoc-ref %build-inputs "bzip2"))
125 (tar (assoc-ref %build-inputs "tar"))
126 (source (assoc-ref %build-inputs "source"))
127 (out (assoc-ref %outputs "out"))
128 (xsl (string-append out "/xml/xsl")))
129 (setenv "PATH" (string-append bzip2 "/bin"))
130 (system* (string-append tar "/bin/tar") "xvf" source)
133 (copy-recursively name-version
134 (string-append xsl "/" name-version))
136 (substitute* (string-append xsl "/" name-version "/catalog.xml")
137 (("rewritePrefix=\"./")
138 (string-append "rewritePrefix=\"file://" xsl "/"
139 name-version "/")))))
140 #:modules ((guix build utils))))
141 (native-inputs `(("bzip2" ,bzip2)
143 (home-page "http://docbook.org")
144 (synopsis "DocBook XSL style sheets for document authoring")
146 "This package provides XSL style sheets for DocBook.")
147 (license (x11-style "" "See 'COPYING' file."))))
149 (define-public dblatex
155 (uri (string-append "mirror://sourceforge/dblatex/dblatex-"
159 "0h3472n33pabrn8qwggsahkrjx8lybpwlc3zprby3w3w3x5i830f"))))
160 (build-system python-build-system)
161 ;; TODO: Add xfig/transfig for fig2dev utility
163 `(("python-setuptools" ,python-setuptools)
165 ("imagemagick" ,imagemagick) ;for convert
166 ("inkscape" ,inkscape) ;for svg conversion
167 ("docbook" ,docbook-xml)
168 ("libxslt" ,libxslt))) ;for xsltproc
170 `(#:python ,python-2 ;'print' syntax
171 #:tests? #f ;no 'test' command
175 (lambda* (#:key inputs outputs #:allow-other-keys)
176 (let ((out (assoc-ref outputs "out")))
177 ;; dblatex executes helper programs at runtime.
178 (wrap-program (string-append out "/bin/dblatex")
180 ,(map (lambda (input)
181 (string-append (assoc-ref inputs input)
183 '("libxslt" "texlive"
184 "imagemagick" "inkscape"))))))
186 (home-page "http://dblatex.sourceforge.net")
187 (synopsis "DocBook to LaTeX Publishing")
189 "DocBook to LaTeX Publishing transforms your SGML/XML DocBook documents
190 to DVI, PostScript or PDF by translating them in pure LaTeX as a first
191 process. MathML 2.0 markups are supported too. It started as a clone of
193 ;; lib/contrib/which is under an X11 license