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> |
c915b404 LC |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
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. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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/>. | |
19 | ||
20 | (define-module (gnu packages docbook) | |
21 | #:use-module (gnu packages) | |
22 | #:use-module (gnu packages compression) | |
2efb3dda EB |
23 | #:use-module (gnu packages imagemagick) |
24 | #:use-module (gnu packages inkscape) | |
25 | #:use-module (gnu packages texlive) | |
26 | #:use-module (gnu packages python) | |
b777d784 | 27 | #:use-module (gnu packages base) |
2efb3dda | 28 | #:use-module (gnu packages xml) |
c915b404 LC |
29 | #:use-module (guix licenses) |
30 | #:use-module (guix packages) | |
31 | #:use-module (guix download) | |
32 | #:use-module (guix build-system trivial) | |
2efb3dda | 33 | #:use-module (guix build-system python) |
c915b404 LC |
34 | #:autoload (gnu packages zip) (unzip)) |
35 | ||
36 | (define-public docbook-xml | |
37 | (package | |
38 | (name "docbook-xml") | |
39 | (version "4.5") | |
40 | (source (origin | |
41 | (method url-fetch) | |
42 | (uri (string-append "http://www.docbook.org/xml/" version | |
43 | "/docbook-xml-" version ".zip")) | |
44 | (sha256 | |
45 | (base32 | |
46 | "1d671lcjckjri28xfbf6dq7y3xnkppa910w1jin8rjc35dx06kjf")))) | |
47 | (build-system trivial-build-system) | |
48 | (arguments | |
49 | '(#:builder (begin | |
50 | (use-modules (guix build utils)) | |
51 | ||
52 | (let* ((unzip | |
53 | (string-append (assoc-ref %build-inputs "unzip") | |
54 | "/bin/unzip")) | |
55 | (source (assoc-ref %build-inputs "source")) | |
56 | (out (assoc-ref %outputs "out")) | |
57 | (dtd (string-append out "/xml/dtd/docbook"))) | |
58 | (mkdir-p dtd) | |
59 | (with-directory-excursion dtd | |
a6639cf7 JD |
60 | (system* unzip source)) |
61 | (substitute* (string-append out "/xml/dtd/docbook/catalog.xml") | |
62 | (("uri=\"") | |
63 | (string-append | |
64 | "uri=\"file://" dtd "/"))))) | |
65 | #:modules ((guix build utils)))) | |
c915b404 LC |
66 | (native-inputs `(("unzip" ,unzip))) |
67 | (home-page "http://docbook.org") | |
68 | (synopsis "DocBook XML DTDs for document authoring") | |
69 | (description | |
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.")))) | |
74 | ||
1cac3de6 JD |
75 | (define-public docbook-xml-4.4 |
76 | (package (inherit docbook-xml) | |
77 | (version "4.4") | |
78 | (source (origin | |
79 | (method url-fetch) | |
80 | (uri (string-append "http://www.docbook.org/xml/" version | |
81 | "/docbook-xml-" version ".zip")) | |
82 | (sha256 | |
83 | (base32 | |
84 | "141h4zsyc71sfi2zzd89v4bb4qqq9ca1ri9ix2als9f4i3mmkw82")))))) | |
85 | ||
86 | (define-public docbook-xml-4.3 | |
87 | (package (inherit docbook-xml) | |
88 | (version "4.3") | |
89 | (source (origin | |
90 | (method url-fetch) | |
91 | (uri (string-append "http://www.docbook.org/xml/" version | |
92 | "/docbook-xml-" version ".zip")) | |
93 | (sha256 | |
94 | (base32 | |
95 | "0r1l2if1z4wm2v664sqdizm4gak6db1kx9y50jq89m3gxaa8l1i3")))))) | |
96 | ||
aec149e3 FB |
97 | (define-public docbook-xml-4.2 |
98 | (package (inherit docbook-xml) | |
99 | (version "4.2") | |
100 | (source (origin | |
101 | (method url-fetch) | |
102 | (uri (string-append "http://www.docbook.org/xml/" version | |
103 | "/docbook-xml-" version ".zip")) | |
104 | (sha256 | |
105 | (base32 | |
106 | "18hgwvmywh6a5jh38szjmg3hg2r4v5lb6r3ydc3rd8cp9wg61i5c")))))) | |
107 | ||
c915b404 LC |
108 | (define-public docbook-xsl |
109 | (package | |
110 | (name "docbook-xsl") | |
a37a3077 | 111 | (version "1.78.1") |
c915b404 LC |
112 | (source (origin |
113 | (method url-fetch) | |
114 | (uri (string-append "mirror://sourceforge/docbook/docbook-xsl-" | |
115 | version ".tar.bz2")) | |
116 | (sha256 | |
117 | (base32 | |
a37a3077 | 118 | "0rxl013ncmz1n6ymk2idvx3hix9pdabk8xn01cpcv32wmfb753y9")))) |
c915b404 LC |
119 | (build-system trivial-build-system) |
120 | (arguments | |
7f4bf030 | 121 | `(#:builder (let ((name-version (string-append ,name "-" ,version))) |
c915b404 LC |
122 | (use-modules (guix build utils)) |
123 | ||
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) | |
131 | ||
132 | (mkdir-p xsl) | |
7f4bf030 JD |
133 | (copy-recursively name-version |
134 | (string-append xsl "/" name-version)) | |
135 | ||
136 | (substitute* (string-append xsl "/" name-version "/catalog.xml") | |
137 | (("rewritePrefix=\"./") | |
138 | (string-append "rewritePrefix=\"file://" xsl "/" name-version "/"))))) | |
139 | #:modules ((guix build utils)))) | |
c915b404 LC |
140 | (native-inputs `(("bzip2" ,bzip2) |
141 | ("tar" ,tar))) | |
142 | (home-page "http://docbook.org") | |
143 | (synopsis "DocBook XSL style sheets for document authoring") | |
144 | (description | |
145 | "This package provides XSL style sheets for DocBook.") | |
146 | (license (x11-style "" "See 'COPYING' file.")))) | |
2efb3dda EB |
147 | |
148 | (define-public dblatex | |
149 | (package | |
150 | (name "dblatex") | |
151 | (version "0.3.5") | |
152 | (source (origin | |
153 | (method url-fetch) | |
154 | (uri (string-append "mirror://sourceforge/dblatex/dblatex-" | |
155 | version ".tar.bz2")) | |
156 | (sha256 | |
157 | (base32 | |
158 | "0h3472n33pabrn8qwggsahkrjx8lybpwlc3zprby3w3w3x5i830f")))) | |
159 | (build-system python-build-system) | |
160 | ;; TODO: Add xfig/transfig for fig2dev utility | |
161 | (inputs | |
162 | `(("python-setuptools" ,python-setuptools) | |
163 | ("texlive" ,texlive) | |
164 | ("imagemagick" ,imagemagick) ;for convert | |
165 | ("inkscape" ,inkscape) ;for svg conversion | |
166 | ("docbook" ,docbook-xml) | |
167 | ("libxslt" ,libxslt))) ;for xsltproc | |
168 | (arguments | |
169 | `(#:python ,python-2 ;'print' syntax | |
170 | #:tests? #f ;no 'test' command | |
171 | #:phases | |
172 | (alist-cons-after | |
173 | 'wrap 'set-path | |
174 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
175 | (let ((out (assoc-ref outputs "out"))) | |
176 | ;; dblatex executes helper programs at runtime. | |
177 | (wrap-program (string-append out "/bin/dblatex") | |
178 | `("PATH" ":" prefix | |
179 | ,(map (lambda (input) | |
180 | (string-append (assoc-ref inputs input) | |
181 | "/bin")) | |
182 | '("libxslt" "texlive" | |
183 | "imagemagick" "inkscape")))))) | |
184 | %standard-phases))) | |
185 | (home-page "http://dblatex.sourceforge.net") | |
186 | (synopsis "DocBook to LaTeX Publishing") | |
187 | (description | |
188 | "DocBook to LaTeX Publishing transforms your SGML/XML DocBook documents | |
189 | to DVI, PostScript or PDF by translating them in pure LaTeX as a first | |
190 | process. MathML 2.0 markups are supported too. It started as a clone of | |
191 | DB2LaTeX.") | |
192 | ;; lib/contrib/which is under an X11 license | |
193 | (license gpl2+))) |