gnu: Add XML-SAX;
[jackhill/guix/guix.git] / gnu / packages / xml.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
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 xml)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages compression)
24 #:use-module (gnu packages gnupg)
25 #:use-module (gnu packages perl)
26 #:use-module (gnu packages python)
27 #:use-module (gnu packages web)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system perl)
33 #:use-module (gnu packages linux))
34
35 (define-public expat
36 (package
37 (name "expat")
38 (version "2.1.0")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append "mirror://sourceforge/expat/expat/"
42 version "/expat-" version ".tar.gz"))
43 (sha256
44 (base32
45 "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2"))))
46 (build-system gnu-build-system)
47 (home-page "http://www.libexpat.org/")
48 (synopsis "Stream-oriented XML parser library written in C")
49 (description
50 "Expat is an XML parser library written in C. It is a
51 stream-oriented parser in which an application registers handlers for
52 things the parser might find in the XML document (like start tags).")
53 (license license:expat)))
54
55 (define-public libxml2
56 (package
57 (name "libxml2")
58 (version "2.9.0")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
62 version ".tar.gz"))
63 (sha256
64 (base32
65 "10ib8bpar2pl68aqksfinvfmqknwnk7i35ibq6yjl8dpb0cxj9dd"))))
66 (build-system gnu-build-system)
67 (home-page "http://www.xmlsoft.org/")
68 (synopsis "C parser for XML")
69 (propagated-inputs `(("zlib" ,zlib))) ; libxml2.la says '-lz'.
70 (native-inputs `(("perl" ,perl)
71 ("python" ,python-2))) ; incompatible with Python 3 (print syntax)
72
73
74 ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
75 ;; sub-directory of any given package.
76 (native-search-paths (list (search-path-specification
77 (variable "XML_CATALOG_FILES")
78 (separator " ")
79 (files '("xml"))
80 (file-pattern "^catalog\\.xml$")
81 (file-type 'regular))))
82 (search-paths native-search-paths)
83
84 (arguments
85 `(#:phases
86 (alist-replace
87 'install
88 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
89 (let ((install (assoc-ref %standard-phases 'install))
90 (glibc (assoc-ref inputs ,(if (%current-target-system)
91 "cross-libc" "libc")))
92 (out (assoc-ref outputs "out")))
93 (apply install args)
94 (chdir "python")
95 (substitute* "setup.py"
96 (("/opt/include")
97 (string-append glibc "/include")))
98 (system* "python" "setup.py" "install"
99 (string-append "--prefix=" out))))
100 %standard-phases)))
101 (description
102 "Libxml2 is the XML C parser and toolkit developed for the Gnome project
103 (but it is usable outside of the Gnome platform).")
104 (license license:x11)))
105
106 (define-public libxslt
107 (package
108 (name "libxslt")
109 (version "1.1.28")
110 (source (origin
111 (method url-fetch)
112 (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-"
113 version ".tar.gz"))
114 (sha256
115 (base32
116 "13029baw9kkyjgr7q3jccw2mz38amq7mmpr5p3bh775qawd1bisz"))))
117 (build-system gnu-build-system)
118 (home-page "http://xmlsoft.org/XSLT/index.html")
119 (synopsis "C library for applying XSLT stylesheets to XML documents")
120 (inputs `(("libgcrypt" ,libgcrypt)
121 ("libxml2" ,libxml2)
122 ("python" ,python-wrapper)
123 ("zlib" ,zlib)))
124 (description
125 "Libxslt is an XSLT C library developed for the GNOME project. It is
126 based on libxml for XML parsing, tree manipulation and XPath support.")
127 (license license:x11)))
128
129 (define-public perl-xml-parser
130 (package
131 (name "perl-xml-parser")
132 (version "2.41")
133 (source (origin
134 (method url-fetch)
135 (uri (string-append
136 "mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-"
137 version ".tar.gz"))
138 (sha256
139 (base32
140 "1sadi505g5qmxr36lgcbrcrqh3a5gcdg32b405gnr8k54b6rg0dl"))))
141 (build-system perl-build-system)
142 (arguments `(#:make-maker-flags
143 (let ((expat (assoc-ref %build-inputs "expat")))
144 (list (string-append "EXPATLIBPATH=" expat "/lib")
145 (string-append "EXPATINCPATH=" expat "/include")))))
146 (inputs `(("expat" ,expat)))
147 (license (package-license perl))
148 (synopsis "Perl bindings to the Expat XML parsing library")
149 (description
150 "This module provides ways to parse XML documents. It is built on top of
151 XML::Parser::Expat, which is a lower level interface to James Clark's expat
152 library. Each call to one of the parsing methods creates a new instance of
153 XML::Parser::Expat which is then used to parse the document. Expat options
154 may be provided when the XML::Parser object is created. These options are
155 then passed on to the Expat object on each parse call. They can also be given
156 as extra arguments to the parse methods, in which case they override options
157 given at XML::Parser creation time.")
158 (home-page "http://search.cpan.org/~toddr/XML-Parser-2.41/Parser.pm")))
159
160 (define-public perl-libxml
161 (package
162 (name "perl-libxml")
163 (version "0.08")
164 (source (origin
165 (method url-fetch)
166 (uri (string-append
167 "mirror://cpan/authors/id/K/KM/KMACLEOD/libxml-perl-"
168 version ".tar.gz"))
169 (sha256
170 (base32
171 "1jy9af0ljyzj7wakqli0437zb2vrbplqj4xhab7bfj2xgfdhawa5"))))
172 (build-system perl-build-system)
173 (propagated-inputs
174 `(("perl-xml-parser" ,perl-xml-parser)))
175 (license (package-license perl))
176 (synopsis "Perl SAX parser using XML::Parser")
177 (description
178 "XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser
179 module.")
180 (home-page "http://search.cpan.org/~kmacleod/libxml-perl/lib/XML/Parser/PerlSAX.pm")))
181
182 (define-public perl-xml-namespacesupport
183 (package
184 (name "perl-xml-namespacesupport")
185 (version "1.11")
186 (source
187 (origin
188 (method url-fetch)
189 (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
190 "XML-NamespaceSupport-" version ".tar.gz"))
191 (sha256
192 (base32
193 "1sklgcldl3w6gn706vx1cgz6pm4y5lfgsjxnfqyk20pilgq530bd"))))
194 (build-system perl-build-system)
195 (home-page "http://search.cpan.org/dist/XML-NamespaceSupport")
196 (synopsis "XML namespace support class")
197 (description "This module offers a simple to process namespaced XML
198 names (unames) from within any application that may need them. It also helps
199 maintain a prefix to namespace URI map, and provides a number of basic
200 checks.")
201 (license (package-license perl))))
202
203 (define-public perl-xml-sax
204 (package
205 (name "perl-xml-sax")
206 (version "0.99")
207 (source
208 (origin
209 (method url-fetch)
210 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
211 "XML-SAX-" version ".tar.gz"))
212 (sha256
213 (base32
214 "115dypb50w1l94y3iwihv5nkixbsv1cxiqkd93y4rk5n6s74pc1j"))))
215 (build-system perl-build-system)
216 (propagated-inputs
217 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
218 ("perl-xml-sax-base" ,perl-xml-sax-base)))
219 (arguments
220 `(#:phases (modify-phases %standard-phases
221 (add-before
222 install augment-path
223 ;; The install target tries to load the newly-installed
224 ;; XML::SAX module, but can't find it, so we need to tell
225 ;; perl where to look.
226 (lambda* (#:key outputs #:allow-other-keys)
227 (setenv "PERL5LIB"
228 (string-append (getenv "PERL5LIB") ":"
229 (assoc-ref outputs "out")
230 "/lib/perl5/site_perl")))))))
231 (home-page "http://search.cpan.org/dist/XML-SAX")
232 (synopsis "Perl API for XML")
233 (description "XML::SAX consists of several framework classes for using and
234 building Perl SAX2 XML parsers, filters, and drivers.")
235 (license (package-license perl))))
236
237 (define-public perl-xml-sax-base
238 (package
239 (name "perl-xml-sax-base")
240 (version "1.08")
241 (source
242 (origin
243 (method url-fetch)
244 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
245 "XML-SAX-Base-" version ".tar.gz"))
246 (sha256
247 (base32
248 "17i161rq1ngjlk0c8vdkrkkc56y1pf51k1g54y28py0micqp0qk6"))))
249 (build-system perl-build-system)
250 (home-page "http://search.cpan.org/dist/XML-SAX-Base")
251 (synopsis "Base class for SAX Drivers and Filters")
252 (description "This module has a very simple task - to be a base class for
253 PerlSAX drivers and filters. It's default behaviour is to pass the input
254 directly to the output unchanged. It can be useful to use this module as a
255 base class so you don't have to, for example, implement the characters()
256 callback.")
257 (license (package-license perl))))
258
259 (define-public perl-xml-simple
260 (package
261 (name "perl-xml-simple")
262 (version "2.20")
263 (source (origin
264 (method url-fetch)
265 (uri (string-append
266 "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-"
267 version ".tar.gz"))
268 (sha256
269 (base32
270 "0jj3jiray1l4pi9wkjcpxjc3v431whdwx5aqnhgdm4i7h3817zsw"))))
271 (build-system perl-build-system)
272 (propagated-inputs
273 `(("perl-xml-parser" ,perl-xml-parser)))
274 (license (package-license perl))
275 (synopsis "Perl module for easy reading/writing of XML files")
276 (description
277 "The XML::Simple module provides a simple API layer on top of an
278 underlying XML parsing module (either XML::Parser or one of the SAX2
279 parser modules).")
280 (home-page "http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm")))
281
282 (define-public perl-xml-regexp
283 (package
284 (name "perl-xml-regexp")
285 (version "0.04")
286 (source (origin
287 (method url-fetch)
288 (uri (string-append
289 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-RegExp-"
290 version ".tar.gz"))
291 (sha256
292 (base32
293 "0m7wj00a2kik7wj0azhs1zagwazqh3hlz4255n75q21nc04r06fz"))))
294 (build-system perl-build-system)
295 (inputs
296 `(("perl-xml-parser" ,perl-xml-parser)))
297 (license (package-license perl))
298 (synopsis "Perl regular expressions for XML tokens")
299 (description
300 "XML::RegExp contains regular expressions for the following XML tokens:
301 BaseChar, Ideographic, Letter, Digit, Extender, CombiningChar, NameChar,
302 EntityRef, CharRef, Reference, Name, NmToken, and AttValue.")
303 (home-page "http://search.cpan.org/~tjmather/XML-RegExp/lib/XML/RegExp.pm")))
304
305 (define-public perl-xml-dom
306 (package
307 (name "perl-xml-dom")
308 (version "1.44")
309 (source (origin
310 (method url-fetch)
311 (uri (string-append
312 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-DOM-"
313 version ".tar.gz"))
314 (sha256
315 (base32
316 "1r0ampc88ni3sjpzr583k86076qg399arfm9xirv3cw49k3k5bzn"))))
317 (build-system perl-build-system)
318 (propagated-inputs
319 `(("perl-libwww" ,perl-libwww)
320 ("perl-libxml" ,perl-libxml)
321 ("perl-xml-regexp" ,perl-xml-regexp)))
322 (license (package-license perl))
323 (synopsis
324 "Perl module for building DOM Level 1 compliant document structures")
325 (description
326 "This module extends the XML::Parser module by Clark Cooper. The
327 XML::Parser module is built on top of XML::Parser::Expat, which is a lower
328 level interface to James Clark's expat library. XML::DOM::Parser is derived
329 from XML::Parser. It parses XML strings or files and builds a data structure
330 that conforms to the API of the Document Object Model.")
331 (home-page "http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm")))
332
333 (define-public xmlto
334 (package
335 (name "xmlto")
336 (version "0.0.25")
337 (source
338 (origin
339 (method url-fetch)
340 (uri (string-append
341 "https://fedorahosted.org/releases/x/m/xmlto/xmlto-"
342 version ".tar.bz2"))
343 (sha256
344 (base32
345 "0dp5nxq491gymq806za0dk4hngfmq65ysrqbn0ypajqbbl6vf71n"))))
346 (build-system gnu-build-system)
347 (arguments
348 ;; Make sure the reference to util-linux's 'getopt' is kept in 'xmlto'.
349 '(#:configure-flags (list (string-append "GETOPT="
350 (assoc-ref %build-inputs
351 "util-linux")
352 "/bin/getopt"))))
353 (inputs
354 `(("util-linux" ,util-linux) ; for 'getopt'
355 ("libxml2" ,libxml2) ; for 'xmllint'
356 ("libxslt" ,libxslt))) ; for 'xsltproc'
357 (home-page "http://cyberelk.net/tim/software/xmlto/")
358 (synopsis "Front-end to an XSL toolchain")
359 (description
360 "Xmlto is a front-end to an XSL toolchain. It chooses an appropriate
361 stylesheet for the conversion you want and applies it using an external
362 XSL-T processor. It also performs any necessary post-processing.")
363 (license license:gpl2+)))