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