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> |
d2d1144d | 5 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
c915b404 LC |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
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. | |
13 | ;;; | |
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. | |
18 | ;;; | |
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/>. | |
21 | ||
22 | (define-module (gnu packages docbook) | |
23 | #:use-module (gnu packages) | |
24 | #:use-module (gnu packages compression) | |
2efb3dda EB |
25 | #:use-module (gnu packages imagemagick) |
26 | #:use-module (gnu packages inkscape) | |
8f9ac901 | 27 | #:use-module (gnu packages tex) |
2efb3dda | 28 | #:use-module (gnu packages python) |
b777d784 | 29 | #:use-module (gnu packages base) |
2efb3dda | 30 | #:use-module (gnu packages xml) |
c915b404 LC |
31 | #:use-module (guix licenses) |
32 | #:use-module (guix packages) | |
33 | #:use-module (guix download) | |
34 | #:use-module (guix build-system trivial) | |
148585c2 | 35 | #:use-module (guix build-system python)) |
c915b404 LC |
36 | |
37 | (define-public docbook-xml | |
38 | (package | |
39 | (name "docbook-xml") | |
40 | (version "4.5") | |
41 | (source (origin | |
42 | (method url-fetch) | |
e6711212 | 43 | (uri (string-append "https://www.docbook.org/xml/" version |
c915b404 LC |
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 | |
e3cfef22 | 61 | (invoke unzip source)) |
a6639cf7 JD |
62 | (substitute* (string-append out "/xml/dtd/docbook/catalog.xml") |
63 | (("uri=\"") | |
64 | (string-append | |
e3cfef22 MW |
65 | "uri=\"file://" dtd "/"))) |
66 | #t)) | |
a6639cf7 | 67 | #:modules ((guix build utils)))) |
c915b404 | 68 | (native-inputs `(("unzip" ,unzip))) |
e6711212 | 69 | (home-page "https://docbook.org") |
c915b404 LC |
70 | (synopsis "DocBook XML DTDs for document authoring") |
71 | (description | |
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.")))) | |
76 | ||
1cac3de6 JD |
77 | (define-public docbook-xml-4.4 |
78 | (package (inherit docbook-xml) | |
1e47d0e2 | 79 | (version "4.4") |
1cac3de6 JD |
80 | (source (origin |
81 | (method url-fetch) | |
e6711212 | 82 | (uri (string-append "https://www.docbook.org/xml/" version |
1cac3de6 JD |
83 | "/docbook-xml-" version ".zip")) |
84 | (sha256 | |
85 | (base32 | |
86 | "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82")))))) | |
87 | ||
88 | (define-public docbook-xml-4.3 | |
89 | (package (inherit docbook-xml) | |
1e47d0e2 | 90 | (version "4.3") |
1cac3de6 JD |
91 | (source (origin |
92 | (method url-fetch) | |
e6711212 | 93 | (uri (string-append "https://www.docbook.org/xml/" version |
1cac3de6 JD |
94 | "/docbook-xml-" version ".zip")) |
95 | (sha256 | |
96 | (base32 | |
97 | "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3")))))) | |
98 | ||
aec149e3 FB |
99 | (define-public docbook-xml-4.2 |
100 | (package (inherit docbook-xml) | |
1e47d0e2 | 101 | (version "4.2") |
aec149e3 FB |
102 | (source (origin |
103 | (method url-fetch) | |
e6711212 | 104 | (uri (string-append "https://www.docbook.org/xml/" version |
aec149e3 FB |
105 | "/docbook-xml-" version ".zip")) |
106 | (sha256 | |
107 | (base32 | |
108 | "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c")))))) | |
109 | ||
1e47d0e2 ML |
110 | (define-public docbook-xml-4.1.2 |
111 | (package (inherit docbook-xml) | |
112 | (version "4.1.2") | |
113 | (source (origin | |
114 | (method url-fetch) | |
e6711212 | 115 | (uri (string-append "https://www.docbook.org/xml/" version |
1e47d0e2 ML |
116 | "/docbkx412.zip")) |
117 | (sha256 | |
118 | (base32 | |
119 | "0wkp5rvnqj0ghxia0558mnn4c7s3n501j99q2isp3sp0ci069w1h")))) | |
120 | (arguments | |
121 | '(#:modules ((guix build utils)) | |
122 | #:builder | |
123 | (begin | |
124 | (use-modules (guix build utils)) | |
125 | (let ((source (assoc-ref %build-inputs "source")) | |
126 | (unzip (string-append (assoc-ref %build-inputs "unzip") | |
127 | "/bin/unzip")) | |
128 | (dtd (string-append (assoc-ref %outputs "out") | |
129 | "/xml/dtd/docbook"))) | |
130 | (mkdir-p dtd) | |
e3cfef22 | 131 | (invoke unzip source "-d" dtd))))))) |
1e47d0e2 | 132 | |
c915b404 LC |
133 | (define-public docbook-xsl |
134 | (package | |
135 | (name "docbook-xsl") | |
cf7daaf5 | 136 | (version "1.79.1") |
c915b404 LC |
137 | (source (origin |
138 | (method url-fetch) | |
de67e922 LF |
139 | (uri (string-append "mirror://sourceforge/docbook/docbook-xsl/" |
140 | version "/docbook-xsl-" version ".tar.bz2")) | |
0f72f052 | 141 | (patches (search-patches "docbook-xsl-nonrecursive-string-subst.patch")) |
c915b404 LC |
142 | (sha256 |
143 | (base32 | |
52f1687d MB |
144 | "0s59lihif2fr7rznckxr2kfyrvkirv76r1zvidp9b5mj28p4apvj")) |
145 | (modules '((guix build utils))) | |
146 | (snippet | |
147 | '(begin | |
148 | (for-each delete-file (find-files "." "\\.jar$")) | |
149 | #t)))) | |
c915b404 LC |
150 | (build-system trivial-build-system) |
151 | (arguments | |
7f4bf030 | 152 | `(#:builder (let ((name-version (string-append ,name "-" ,version))) |
c915b404 LC |
153 | (use-modules (guix build utils)) |
154 | ||
155 | (let* ((bzip2 (assoc-ref %build-inputs "bzip2")) | |
0f72f052 | 156 | (xz (assoc-ref %build-inputs "xz")) |
c915b404 LC |
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"))) | |
0f72f052 | 161 | (setenv "PATH" (string-append bzip2 "/bin" ":" xz "/bin")) |
e3cfef22 | 162 | (invoke (string-append tar "/bin/tar") "xvf" source) |
c915b404 LC |
163 | |
164 | (mkdir-p xsl) | |
7f4bf030 JD |
165 | (copy-recursively name-version |
166 | (string-append xsl "/" name-version)) | |
167 | ||
168 | (substitute* (string-append xsl "/" name-version "/catalog.xml") | |
a124bbd2 SB |
169 | (("rewritePrefix=\"./") |
170 | (string-append "rewritePrefix=\"file://" xsl "/" | |
e3cfef22 MW |
171 | name-version "/"))) |
172 | #t)) | |
173 | #:modules ((guix build utils)))) | |
c915b404 | 174 | (native-inputs `(("bzip2" ,bzip2) |
52f1687d | 175 | ("xz" ,xz) ;needed for repacked tarballs |
c915b404 | 176 | ("tar" ,tar))) |
e6711212 | 177 | (home-page "https://docbook.org") |
c915b404 LC |
178 | (synopsis "DocBook XSL style sheets for document authoring") |
179 | (description | |
180 | "This package provides XSL style sheets for DocBook.") | |
181 | (license (x11-style "" "See 'COPYING' file.")))) | |
2efb3dda EB |
182 | |
183 | (define-public dblatex | |
184 | (package | |
185 | (name "dblatex") | |
8419a7ed | 186 | (version "0.3.11") |
2efb3dda EB |
187 | (source (origin |
188 | (method url-fetch) | |
de67e922 LF |
189 | (uri (string-append "mirror://sourceforge/dblatex/dblatex/" |
190 | "dblatex-" version "/dblatex-" | |
2efb3dda EB |
191 | version ".tar.bz2")) |
192 | (sha256 | |
193 | (base32 | |
8419a7ed | 194 | "0rp1bc2lgisigscq1i7zxfd2qdaxxxld6khbcxss4pq7fpi9fzkv")))) |
2efb3dda EB |
195 | (build-system python-build-system) |
196 | ;; TODO: Add xfig/transfig for fig2dev utility | |
197 | (inputs | |
f75aa97f | 198 | `(("texlive" ,(texlive-union (list texlive-amsfonts |
b81dd94a RW |
199 | texlive-latex-anysize |
200 | texlive-latex-appendix | |
201 | texlive-latex-changebar | |
202 | texlive-latex-colortbl | |
203 | texlive-latex-eepic | |
204 | texlive-latex-eso-pic | |
205 | texlive-latex-fancybox | |
206 | texlive-latex-fancyhdr | |
207 | texlive-latex-fancyvrb | |
208 | texlive-latex-float | |
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 | |
219 | texlive-latex-url | |
220 | texlive-latex-wasysym | |
221 | ||
b81dd94a RW |
222 | texlive-fonts-ec |
223 | texlive-fonts-rsfs | |
224 | texlive-fonts-stmaryrd | |
225 | ||
226 | texlive-generic-ifxetex))) | |
2efb3dda EB |
227 | ("imagemagick" ,imagemagick) ;for convert |
228 | ("inkscape" ,inkscape) ;for svg conversion | |
229 | ("docbook" ,docbook-xml) | |
230 | ("libxslt" ,libxslt))) ;for xsltproc | |
231 | (arguments | |
232 | `(#:python ,python-2 ;'print' syntax | |
447b9473 HG |
233 | ;; Using setuptools causes an invalid "package_base" path in |
234 | ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused | |
235 | ;; by dblatex's setup.py stripping the root path when creating the | |
236 | ;; script. (dblatex's setup.py still uses distutils and thus has to | |
237 | ;; create the script by itself. The feature for creating scripts is one | |
238 | ;; of setuptools' features.) | |
239 | ;; See this thread for details: | |
3cc0342b MB |
240 | ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html |
241 | #:use-setuptools? #f | |
2efb3dda EB |
242 | #:tests? #f ;no 'test' command |
243 | #:phases | |
d2d1144d TGR |
244 | (modify-phases %standard-phases |
245 | (add-after 'wrap 'set-path | |
246 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
247 | (let ((out (assoc-ref outputs "out"))) | |
248 | ;; dblatex executes helper programs at runtime. | |
249 | (wrap-program (string-append out "/bin/dblatex") | |
250 | `("PATH" ":" prefix | |
251 | ,(map (lambda (input) | |
252 | (string-append (assoc-ref inputs input) | |
253 | "/bin")) | |
254 | '("libxslt" "texlive" | |
255 | "imagemagick" "inkscape")))) | |
256 | #t)))))) | |
2efb3dda EB |
257 | (home-page "http://dblatex.sourceforge.net") |
258 | (synopsis "DocBook to LaTeX Publishing") | |
259 | (description | |
260 | "DocBook to LaTeX Publishing transforms your SGML/XML DocBook documents | |
261 | to DVI, PostScript or PDF by translating them in pure LaTeX as a first | |
262 | process. MathML 2.0 markups are supported too. It started as a clone of | |
263 | DB2LaTeX.") | |
264 | ;; lib/contrib/which is under an X11 license | |
265 | (license gpl2+))) |