Merge branch 'master' into core-updates
[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, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages xml)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages gnupg)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages tls)
32 #:use-module (gnu packages web)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system perl)
39 #:use-module (guix build-system python)
40 #:use-module (gnu packages linux))
41
42 (define-public expat
43 (package
44 (name "expat")
45 (version "2.1.0")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "mirror://sourceforge/expat/expat/"
49 version "/expat-" version ".tar.gz"))
50 (sha256
51 (base32
52 "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2"))
53 (patches (list (search-patch "expat-CVE-2015-1283.patch")))))
54 (build-system gnu-build-system)
55 (home-page "http://www.libexpat.org/")
56 (synopsis "Stream-oriented XML parser library written in C")
57 (description
58 "Expat is an XML parser library written in C. It is a
59 stream-oriented parser in which an application registers handlers for
60 things the parser might find in the XML document (like start tags).")
61 (license license:expat)))
62
63 (define-public libxml2
64 (package
65 (name "libxml2")
66 (version "2.9.2")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
70 version ".tar.gz"))
71 (sha256
72 (base32
73 "1g6mf03xcabmk5ing1lwqmasr803616gb2xhn7pll10x2l5w6y2i"))))
74 (build-system gnu-build-system)
75 (home-page "http://www.xmlsoft.org/")
76 (synopsis "C parser for XML")
77 (propagated-inputs `(("zlib" ,zlib))) ; libxml2.la says '-lz'.
78 (native-inputs `(("perl" ,perl)))
79 ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
80 ;; sub-directory of any given package.
81 (native-search-paths (list (search-path-specification
82 (variable "XML_CATALOG_FILES")
83 (separator " ")
84 (files '("xml"))
85 (file-pattern "^catalog\\.xml$")
86 (file-type 'regular))))
87 (search-paths native-search-paths)
88 (description
89 "Libxml2 is the XML C parser and toolkit developed for the Gnome
90 project (but it is usable outside of the Gnome platform).")
91 (license license:x11)))
92
93 (define-public python-libxml2
94 (package (inherit libxml2)
95 (name "python-libxml2")
96 (build-system python-build-system)
97 (arguments
98 `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
99 #:tests? #f
100 #:phases
101 (modify-phases %standard-phases
102 (add-before
103 'build 'configure
104 (lambda* (#:key inputs #:allow-other-keys)
105 (chdir "python")
106 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
107 "cross-libc" "libc")))
108 (libxml2 (assoc-ref inputs "libxml2")))
109 (substitute* "setup.py"
110 ;; For 'libxml2/libxml/tree.h'.
111 (("ROOT = r'/usr'")
112 (format #f "ROOT = r'~a'" libxml2))
113 ;; For 'iconv.h'.
114 (("/opt/include")
115 (string-append glibc "/include")))))))))
116 (inputs `(("libxml2" ,libxml2)))
117 (synopsis "Python bindings for the libxml2 library")))
118
119 (define-public python2-libxml2
120 (package-with-python2 python-libxml2))
121
122 (define-public libxslt
123 (package
124 (name "libxslt")
125 (version "1.1.28")
126 (source (origin
127 (method url-fetch)
128 (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-"
129 version ".tar.gz"))
130 (sha256
131 (base32
132 "13029baw9kkyjgr7q3jccw2mz38amq7mmpr5p3bh775qawd1bisz"))))
133 (build-system gnu-build-system)
134 (home-page "http://xmlsoft.org/XSLT/index.html")
135 (synopsis "C library for applying XSLT stylesheets to XML documents")
136 (inputs `(("libgcrypt" ,libgcrypt)
137 ("libxml2" ,libxml2)
138 ("python" ,python-wrapper)
139 ("zlib" ,zlib)))
140 (description
141 "Libxslt is an XSLT C library developed for the GNOME project. It is
142 based on libxml for XML parsing, tree manipulation and XPath support.")
143 (license license:x11)))
144
145 (define-public perl-xml-parser
146 (package
147 (name "perl-xml-parser")
148 (version "2.44")
149 (source (origin
150 (method url-fetch)
151 (uri (string-append
152 "mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-"
153 version ".tar.gz"))
154 (sha256
155 (base32
156 "05ij0g6bfn27iaggxf8nl5rhlwx6f6p6xmdav6rjcly3x5zd1s8s"))))
157 (build-system perl-build-system)
158 (arguments `(#:make-maker-flags
159 (let ((expat (assoc-ref %build-inputs "expat")))
160 (list (string-append "EXPATLIBPATH=" expat "/lib")
161 (string-append "EXPATINCPATH=" expat "/include")))))
162 (inputs `(("expat" ,expat)))
163 (license (package-license perl))
164 (synopsis "Perl bindings to the Expat XML parsing library")
165 (description
166 "This module provides ways to parse XML documents. It is built on top of
167 XML::Parser::Expat, which is a lower level interface to James Clark's expat
168 library. Each call to one of the parsing methods creates a new instance of
169 XML::Parser::Expat which is then used to parse the document. Expat options
170 may be provided when the XML::Parser object is created. These options are
171 then passed on to the Expat object on each parse call. They can also be given
172 as extra arguments to the parse methods, in which case they override options
173 given at XML::Parser creation time.")
174 (home-page "http://search.cpan.org/dist/XML-Parser")))
175
176 (define-public perl-libxml
177 (package
178 (name "perl-libxml")
179 (version "0.08")
180 (source (origin
181 (method url-fetch)
182 (uri (string-append
183 "mirror://cpan/authors/id/K/KM/KMACLEOD/libxml-perl-"
184 version ".tar.gz"))
185 (sha256
186 (base32
187 "1jy9af0ljyzj7wakqli0437zb2vrbplqj4xhab7bfj2xgfdhawa5"))))
188 (build-system perl-build-system)
189 (propagated-inputs
190 `(("perl-xml-parser" ,perl-xml-parser)))
191 (license (package-license perl))
192 (synopsis "Perl SAX parser using XML::Parser")
193 (description
194 "XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser
195 module.")
196 (home-page "http://search.cpan.org/~kmacleod/libxml-perl/lib/XML/Parser/PerlSAX.pm")))
197
198 (define-public perl-xml-libxml
199 (package
200 (name "perl-xml-libxml")
201 (version "2.0118")
202 (source
203 (origin
204 (method url-fetch)
205 (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
206 "XML-LibXML-" version ".tar.gz"))
207 (sha256
208 (base32
209 "170c8dbk4p6jw9is0cria73021yp3hpmhb19p9j0zg2yxwkawr6c"))))
210 (build-system perl-build-system)
211 (propagated-inputs
212 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
213 ("perl-xml-sax" ,perl-xml-sax)))
214 (inputs
215 `(("libxml2" ,libxml2)))
216 (home-page "http://search.cpan.org/dist/XML-LibXML")
217 (synopsis "Perl interface to libxml2")
218 (description "This module implements a Perl interface to the libxml2
219 library which provides interfaces for parsing and manipulating XML files. This
220 module allows Perl programmers to make use of the highly capable validating
221 XML parser and the high performance DOM implementation.")
222 (license (package-license perl))))
223
224 (define-public perl-xml-namespacesupport
225 (package
226 (name "perl-xml-namespacesupport")
227 (version "1.11")
228 (source
229 (origin
230 (method url-fetch)
231 (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
232 "XML-NamespaceSupport-" version ".tar.gz"))
233 (sha256
234 (base32
235 "1sklgcldl3w6gn706vx1cgz6pm4y5lfgsjxnfqyk20pilgq530bd"))))
236 (build-system perl-build-system)
237 (home-page "http://search.cpan.org/dist/XML-NamespaceSupport")
238 (synopsis "XML namespace support class")
239 (description "This module offers a simple to process namespaced XML
240 names (unames) from within any application that may need them. It also helps
241 maintain a prefix to namespace URI map, and provides a number of basic
242 checks.")
243 (license (package-license perl))))
244
245 (define-public perl-xml-sax
246 (package
247 (name "perl-xml-sax")
248 (version "0.99")
249 (source
250 (origin
251 (method url-fetch)
252 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
253 "XML-SAX-" version ".tar.gz"))
254 (sha256
255 (base32
256 "115dypb50w1l94y3iwihv5nkixbsv1cxiqkd93y4rk5n6s74pc1j"))))
257 (build-system perl-build-system)
258 (propagated-inputs
259 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
260 ("perl-xml-sax-base" ,perl-xml-sax-base)))
261 (arguments
262 `(#:phases (modify-phases %standard-phases
263 (add-before
264 'install 'augment-path
265 ;; The install target tries to load the newly-installed
266 ;; XML::SAX module, but can't find it, so we need to tell
267 ;; perl where to look.
268 (lambda* (#:key outputs #:allow-other-keys)
269 (setenv "PERL5LIB"
270 (string-append (getenv "PERL5LIB") ":"
271 (assoc-ref outputs "out")
272 "/lib/perl5/site_perl")))))))
273 (home-page "http://search.cpan.org/dist/XML-SAX")
274 (synopsis "Perl API for XML")
275 (description "XML::SAX consists of several framework classes for using and
276 building Perl SAX2 XML parsers, filters, and drivers.")
277 (license (package-license perl))))
278
279 (define-public perl-xml-sax-base
280 (package
281 (name "perl-xml-sax-base")
282 (version "1.08")
283 (source
284 (origin
285 (method url-fetch)
286 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
287 "XML-SAX-Base-" version ".tar.gz"))
288 (sha256
289 (base32
290 "17i161rq1ngjlk0c8vdkrkkc56y1pf51k1g54y28py0micqp0qk6"))))
291 (build-system perl-build-system)
292 (home-page "http://search.cpan.org/dist/XML-SAX-Base")
293 (synopsis "Base class for SAX Drivers and Filters")
294 (description "This module has a very simple task - to be a base class for
295 PerlSAX drivers and filters. It's default behaviour is to pass the input
296 directly to the output unchanged. It can be useful to use this module as a
297 base class so you don't have to, for example, implement the characters()
298 callback.")
299 (license (package-license perl))))
300
301 (define-public perl-xml-simple
302 (package
303 (name "perl-xml-simple")
304 (version "2.20")
305 (source (origin
306 (method url-fetch)
307 (uri (string-append
308 "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-"
309 version ".tar.gz"))
310 (sha256
311 (base32
312 "0jj3jiray1l4pi9wkjcpxjc3v431whdwx5aqnhgdm4i7h3817zsw"))))
313 (build-system perl-build-system)
314 (propagated-inputs
315 `(("perl-xml-parser" ,perl-xml-parser)))
316 (license (package-license perl))
317 (synopsis "Perl module for easy reading/writing of XML files")
318 (description
319 "The XML::Simple module provides a simple API layer on top of an
320 underlying XML parsing module (either XML::Parser or one of the SAX2
321 parser modules).")
322 (home-page "http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm")))
323
324 (define-public perl-xml-regexp
325 (package
326 (name "perl-xml-regexp")
327 (version "0.04")
328 (source (origin
329 (method url-fetch)
330 (uri (string-append
331 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-RegExp-"
332 version ".tar.gz"))
333 (sha256
334 (base32
335 "0m7wj00a2kik7wj0azhs1zagwazqh3hlz4255n75q21nc04r06fz"))))
336 (build-system perl-build-system)
337 (inputs
338 `(("perl-xml-parser" ,perl-xml-parser)))
339 (license (package-license perl))
340 (synopsis "Perl regular expressions for XML tokens")
341 (description
342 "XML::RegExp contains regular expressions for the following XML tokens:
343 BaseChar, Ideographic, Letter, Digit, Extender, CombiningChar, NameChar,
344 EntityRef, CharRef, Reference, Name, NmToken, and AttValue.")
345 (home-page "http://search.cpan.org/~tjmather/XML-RegExp/lib/XML/RegExp.pm")))
346
347 (define-public perl-xml-dom
348 (package
349 (name "perl-xml-dom")
350 (version "1.44")
351 (source (origin
352 (method url-fetch)
353 (uri (string-append
354 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-DOM-"
355 version ".tar.gz"))
356 (sha256
357 (base32
358 "1r0ampc88ni3sjpzr583k86076qg399arfm9xirv3cw49k3k5bzn"))))
359 (build-system perl-build-system)
360 (propagated-inputs
361 `(("perl-libwww" ,perl-libwww)
362 ("perl-libxml" ,perl-libxml)
363 ("perl-xml-regexp" ,perl-xml-regexp)))
364 (license (package-license perl))
365 (synopsis
366 "Perl module for building DOM Level 1 compliant document structures")
367 (description
368 "This module extends the XML::Parser module by Clark Cooper. The
369 XML::Parser module is built on top of XML::Parser::Expat, which is a lower
370 level interface to James Clark's expat library. XML::DOM::Parser is derived
371 from XML::Parser. It parses XML strings or files and builds a data structure
372 that conforms to the API of the Document Object Model.")
373 (home-page "http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm")))
374
375 (define-public pugixml
376 (package
377 (name "pugixml")
378 (version "1.6")
379 (source
380 (origin
381 (method url-fetch)
382 (uri (string-append "https://github.com/zeux/pugixml/archive/v"
383 version ".tar.gz"))
384 (file-name (string-append name "-" version ".tar.gz"))
385 (sha256
386 (base32
387 "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi"))))
388 (build-system cmake-build-system)
389 (arguments
390 `(#:tests? #f
391 #:out-of-source? #f
392 #:phases (modify-phases %standard-phases
393 (add-before
394 'configure 'chdir
395 (lambda _
396 (chdir "scripts")
397 #t)))))
398 (home-page "http://pugixml.org")
399 (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support")
400 (description
401 "pugixml is a C++ XML processing library, which consists of a DOM-like
402 interface with rich traversal/modification capabilities, a fast XML parser
403 which constructs the DOM tree from an XML file/buffer, and an XPath 1.0
404 implementation for complex data-driven tree queries. Full Unicode support is
405 also available, with Unicode interface variants and conversions between
406 different Unicode encodings which happen automatically during
407 parsing/saving.")
408 (license license:expat)))
409
410 (define-public xmlto
411 (package
412 (name "xmlto")
413 (version "0.0.25")
414 (source
415 (origin
416 (method url-fetch)
417 (uri (string-append
418 "https://fedorahosted.org/releases/x/m/xmlto/xmlto-"
419 version ".tar.bz2"))
420 (sha256
421 (base32
422 "0dp5nxq491gymq806za0dk4hngfmq65ysrqbn0ypajqbbl6vf71n"))))
423 (build-system gnu-build-system)
424 (arguments
425 ;; Make sure the reference to util-linux's 'getopt' is kept in 'xmlto'.
426 '(#:configure-flags (list (string-append "GETOPT="
427 (assoc-ref %build-inputs
428 "util-linux")
429 "/bin/getopt"))))
430 (inputs
431 `(("util-linux" ,util-linux) ; for 'getopt'
432 ("libxml2" ,libxml2) ; for 'xmllint'
433 ("libxslt" ,libxslt))) ; for 'xsltproc'
434 (home-page "http://cyberelk.net/tim/software/xmlto/")
435 (synopsis "Front-end to an XSL toolchain")
436 (description
437 "Xmlto is a front-end to an XSL toolchain. It chooses an appropriate
438 stylesheet for the conversion you want and applies it using an external
439 XSL-T processor. It also performs any necessary post-processing.")
440 (license license:gpl2+)))
441
442 (define-public xmlsec
443 (package
444 (name "xmlsec")
445 (version "1.2.20")
446 (source (origin
447 (method url-fetch)
448 (uri (string-append "https://www.aleksey.com/xmlsec/download/"
449 name "1-" version ".tar.gz"))
450 (sha256
451 (base32
452 "01bkbv2y3x8d1sf4dcln1x3y2jyj391s3208d9a2ndhglly5j89j"))))
453 (build-system gnu-build-system)
454 (propagated-inputs ; according to xmlsec1.pc
455 `(("libxml2" ,libxml2)
456 ("libxslt" ,libxslt)))
457 (inputs
458 `(("gnutls" ,gnutls)
459 ("libgcrypt" ,libgcrypt)
460 ("libltdl" ,libltdl)))
461 (home-page "http://www.libexpat.org/")
462 (synopsis "XML Security Library")
463 (description
464 "The XML Security Library is a C library based on Libxml2. It
465 supports XML security standards such as XML Signature, XML Encryption,
466 Canonical XML (part of Libxml2) and Exclusive Canonical XML (part of
467 Libxml2).")
468 (license (license:x11-style "file://COPYING"
469 "See 'COPYING' in the distribution."))))
470
471 (define-public minixml
472 (package
473 (name "minixml")
474 (version "2.9")
475 (source (origin
476 (method url-fetch)
477 (uri (string-append "http://www.msweet.org/files/project3/mxml-"
478 version ".tar.gz"))
479 (sha256
480 (base32
481 "14pzhlfidj5v1qbxy7a59yn4jz9pnjrs2zwalz228jsq7ijm9vfd"))))
482 (build-system gnu-build-system)
483 (arguments
484 `(#:tests? #f)) ;no "check" target
485 (home-page "http://www.minixml.org/")
486 (synopsis "Small XML parsing library")
487 (description
488 "Mini-XML is a small C library to read and write XML files and strings in
489 UTF-8 and UTF-16 encoding.")
490 ;; LGPL 2.0+ with additional exceptions for static linking
491 (license license:lgpl2.0+)))