Commit | Line | Data |
---|---|---|
c915b404 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> | |
2efb3dda | 3 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> |
1e47d0e2 | 4 | ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> |
c915b404 LC |
5 | ;;; |
6 | ;;; This file is part of GNU Guix. | |
7 | ;;; | |
8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
9 | ;;; under the terms of the GNU General Public License as published by | |
10 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
11 | ;;; your option) any later version. | |
12 | ;;; | |
13 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;;; GNU General Public License for more details. | |
17 | ;;; | |
18 | ;;; You should have received a copy of the GNU General Public License | |
19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
20 | ||
21 | (define-module (gnu packages docbook) | |
22 | #:use-module (gnu packages) | |
23 | #:use-module (gnu packages compression) | |
2efb3dda EB |
24 | #:use-module (gnu packages imagemagick) |
25 | #:use-module (gnu packages inkscape) | |
8f9ac901 | 26 | #:use-module (gnu packages tex) |
2efb3dda | 27 | #:use-module (gnu packages python) |
b777d784 | 28 | #:use-module (gnu packages base) |
2efb3dda | 29 | #:use-module (gnu packages xml) |
c915b404 LC |
30 | #:use-module (guix licenses) |
31 | #:use-module (guix packages) | |
32 | #:use-module (guix download) | |
33 | #:use-module (guix build-system trivial) | |
2efb3dda | 34 | #:use-module (guix build-system python) |
c915b404 LC |
35 | #:autoload (gnu packages zip) (unzip)) |
36 | ||
37 | (define-public docbook-xml | |
38 | (package | |
39 | (name "docbook-xml") | |
40 | (version "4.5") | |
41 | (source (origin | |
42 | (method url-fetch) | |
43 | (uri (string-append "http://www.docbook.org/xml/" version | |
44 | "/docbook-xml-" version ".zip")) | |
45 | (sha256 | |
46 | (base32 | |
47 | "1d671lcjckjri28xfbf6dq7y3xnkppa910w1jin8rjc35dx06kjf")))) | |
48 | (build-system trivial-build-system) | |
49 | (arguments | |
50 | '(#:builder (begin | |
51 | (use-modules (guix build utils)) | |
52 | ||
53 | (let* ((unzip | |
54 | (string-append (assoc-ref %build-inputs "unzip") | |
55 | "/bin/unzip")) | |
56 | (source (assoc-ref %build-inputs "source")) | |
57 | (out (assoc-ref %outputs "out")) | |
58 | (dtd (string-append out "/xml/dtd/docbook"))) | |
59 | (mkdir-p dtd) | |
60 | (with-directory-excursion dtd | |
a6639cf7 JD |
61 | (system* unzip source)) |
62 | (substitute* (string-append out "/xml/dtd/docbook/catalog.xml") | |
63 | (("uri=\"") | |
64 | (string-append | |
65 | "uri=\"file://" dtd "/"))))) | |
66 | #:modules ((guix build utils)))) | |
c915b404 LC |
67 | (native-inputs `(("unzip" ,unzip))) |
68 | (home-page "http://docbook.org") | |
69 | (synopsis "DocBook XML DTDs for document authoring") | |
70 | (description | |
71 | "DocBook is general purpose XML and SGML document type particularly well | |
72 | suited to books and papers about computer hardware and software (though it is | |
73 | by no means limited to these applications.) This package provides XML DTDs.") | |
74 | (license (x11-style "" "See file headers.")))) | |
75 | ||
1cac3de6 JD |
76 | (define-public docbook-xml-4.4 |
77 | (package (inherit docbook-xml) | |
1e47d0e2 | 78 | (version "4.4") |
1cac3de6 JD |
79 | (source (origin |
80 | (method url-fetch) | |
81 | (uri (string-append "http://www.docbook.org/xml/" version | |
82 | "/docbook-xml-" version ".zip")) | |
83 | (sha256 | |
84 | (base32 | |
85 | "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82")))))) | |
86 | ||
87 | (define-public docbook-xml-4.3 | |
88 | (package (inherit docbook-xml) | |
1e47d0e2 | 89 | (version "4.3") |
1cac3de6 JD |
90 | (source (origin |
91 | (method url-fetch) | |
92 | (uri (string-append "http://www.docbook.org/xml/" version | |
93 | "/docbook-xml-" version ".zip")) | |
94 | (sha256 | |
95 | (base32 | |
96 | "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3")))))) | |
97 | ||
aec149e3 FB |
98 | (define-public docbook-xml-4.2 |
99 | (package (inherit docbook-xml) | |
1e47d0e2 | 100 | (version "4.2") |
aec149e3 FB |
101 | (source (origin |
102 | (method url-fetch) | |
103 | (uri (string-append "http://www.docbook.org/xml/" version | |
104 | "/docbook-xml-" version ".zip")) | |
105 | (sha256 | |
106 | (base32 | |
107 | "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c")))))) | |
108 | ||
1e47d0e2 ML |
109 | (define-public docbook-xml-4.1.2 |
110 | (package (inherit docbook-xml) | |
111 | (version "4.1.2") | |
112 | (source (origin | |
113 | (method url-fetch) | |
114 | (uri (string-append "http://www.docbook.org/xml/" version | |
115 | "/docbkx412.zip")) | |
116 | (sha256 | |
117 | (base32 | |
118 | "0wkp5rvnqj0ghxia0558mnn4c7s3n501j99q2isp3sp0ci069w1h")))) | |
119 | (arguments | |
120 | '(#:modules ((guix build utils)) | |
121 | #:builder | |
122 | (begin | |
123 | (use-modules (guix build utils)) | |
124 | (let ((source (assoc-ref %build-inputs "source")) | |
125 | (unzip (string-append (assoc-ref %build-inputs "unzip") | |
126 | "/bin/unzip")) | |
127 | (dtd (string-append (assoc-ref %outputs "out") | |
128 | "/xml/dtd/docbook"))) | |
129 | (mkdir-p dtd) | |
130 | (zero? (system* unzip source "-d" dtd)))))))) | |
131 | ||
c915b404 LC |
132 | (define-public docbook-xsl |
133 | (package | |
134 | (name "docbook-xsl") | |
a37a3077 | 135 | (version "1.78.1") |
c915b404 LC |
136 | (source (origin |
137 | (method url-fetch) | |
de67e922 LF |
138 | (uri (string-append "mirror://sourceforge/docbook/docbook-xsl/" |
139 | version "/docbook-xsl-" version ".tar.bz2")) | |
c915b404 LC |
140 | (sha256 |
141 | (base32 | |
a37a3077 | 142 | "0rxl013ncmz1n6ymk2idvx3hix9pdabk8xn01cpcv32wmfb753y9")))) |
c915b404 LC |
143 | (build-system trivial-build-system) |
144 | (arguments | |
7f4bf030 | 145 | `(#:builder (let ((name-version (string-append ,name "-" ,version))) |
c915b404 LC |
146 | (use-modules (guix build utils)) |
147 | ||
148 | (let* ((bzip2 (assoc-ref %build-inputs "bzip2")) | |
149 | (tar (assoc-ref %build-inputs "tar")) | |
150 | (source (assoc-ref %build-inputs "source")) | |
151 | (out (assoc-ref %outputs "out")) | |
152 | (xsl (string-append out "/xml/xsl"))) | |
153 | (setenv "PATH" (string-append bzip2 "/bin")) | |
154 | (system* (string-append tar "/bin/tar") "xvf" source) | |
155 | ||
156 | (mkdir-p xsl) | |
7f4bf030 JD |
157 | (copy-recursively name-version |
158 | (string-append xsl "/" name-version)) | |
159 | ||
160 | (substitute* (string-append xsl "/" name-version "/catalog.xml") | |
a124bbd2 SB |
161 | (("rewritePrefix=\"./") |
162 | (string-append "rewritePrefix=\"file://" xsl "/" | |
163 | name-version "/"))))) | |
7f4bf030 | 164 | #:modules ((guix build utils)))) |
c915b404 LC |
165 | (native-inputs `(("bzip2" ,bzip2) |
166 | ("tar" ,tar))) | |
167 | (home-page "http://docbook.org") | |
168 | (synopsis "DocBook XSL style sheets for document authoring") | |
169 | (description | |
170 | "This package provides XSL style sheets for DocBook.") | |
171 | (license (x11-style "" "See 'COPYING' file.")))) | |
2efb3dda EB |
172 | |
173 | (define-public dblatex | |
174 | (package | |
175 | (name "dblatex") | |
176 | (version "0.3.5") | |
177 | (source (origin | |
178 | (method url-fetch) | |
de67e922 LF |
179 | (uri (string-append "mirror://sourceforge/dblatex/dblatex/" |
180 | "dblatex-" version "/dblatex-" | |
2efb3dda EB |
181 | version ".tar.bz2")) |
182 | (sha256 | |
183 | (base32 | |
184 | "0h3472n33pabrn8qwggsahkrjx8lybpwlc3zprby3w3w3x5i830f")))) | |
185 | (build-system python-build-system) | |
186 | ;; TODO: Add xfig/transfig for fig2dev utility | |
187 | (inputs | |
f3b98f4f | 188 | `(("texlive" ,texlive) |
2efb3dda EB |
189 | ("imagemagick" ,imagemagick) ;for convert |
190 | ("inkscape" ,inkscape) ;for svg conversion | |
191 | ("docbook" ,docbook-xml) | |
192 | ("libxslt" ,libxslt))) ;for xsltproc | |
193 | (arguments | |
194 | `(#:python ,python-2 ;'print' syntax | |
195 | #:tests? #f ;no 'test' command | |
196 | #:phases | |
197 | (alist-cons-after | |
198 | 'wrap 'set-path | |
199 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
200 | (let ((out (assoc-ref outputs "out"))) | |
201 | ;; dblatex executes helper programs at runtime. | |
202 | (wrap-program (string-append out "/bin/dblatex") | |
203 | `("PATH" ":" prefix | |
204 | ,(map (lambda (input) | |
205 | (string-append (assoc-ref inputs input) | |
206 | "/bin")) | |
207 | '("libxslt" "texlive" | |
208 | "imagemagick" "inkscape")))))) | |
209 | %standard-phases))) | |
210 | (home-page "http://dblatex.sourceforge.net") | |
211 | (synopsis "DocBook to LaTeX Publishing") | |
212 | (description | |
213 | "DocBook to LaTeX Publishing transforms your SGML/XML DocBook documents | |
214 | to DVI, PostScript or PDF by translating them in pure LaTeX as a first | |
215 | process. MathML 2.0 markups are supported too. It started as a clone of | |
216 | DB2LaTeX.") | |
217 | ;; lib/contrib/which is under an X11 license | |
218 | (license gpl2+))) |