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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
48 (uri (string-append "mirror://sourceforge/expat/expat/"
49 version "/expat-" version ".tar.gz"))
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")
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)))
63 (define-public libxml2
69 (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
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")
85 (file-pattern "^catalog\\.xml$")
86 (file-type 'regular))))
87 (search-paths native-search-paths)
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)))
93 (define-public python-libxml2
94 (package (inherit libxml2)
95 (name "python-libxml2")
96 (build-system python-build-system)
98 `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
101 (modify-phases %standard-phases
104 (lambda* (#:key inputs #:allow-other-keys)
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'.
112 (format #f "ROOT = r'~a'" libxml2))
115 (string-append glibc "/include")))))))))
116 (inputs `(("libxml2" ,libxml2)))
117 (synopsis "Python bindings for the libxml2 library")))
119 (define-public python2-libxml2
120 (package-with-python2 python-libxml2))
122 (define-public libxslt
128 (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-"
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)
138 ("python" ,python-minimal-wrapper)
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)))
145 (define-public perl-xml-parser
147 (name "perl-xml-parser")
152 "mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-"
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")
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")))
176 (define-public perl-libxml
183 "mirror://cpan/authors/id/K/KM/KMACLEOD/libxml-perl-"
187 "1jy9af0ljyzj7wakqli0437zb2vrbplqj4xhab7bfj2xgfdhawa5"))))
188 (build-system perl-build-system)
190 `(("perl-xml-parser" ,perl-xml-parser)))
191 (license (package-license perl))
192 (synopsis "Perl SAX parser using XML::Parser")
194 "XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser
196 (home-page "http://search.cpan.org/~kmacleod/libxml-perl/lib/XML/Parser/PerlSAX.pm")))
198 (define-public perl-xml-libxml
200 (name "perl-xml-libxml")
205 (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
206 "XML-LibXML-" version ".tar.gz"))
209 "170c8dbk4p6jw9is0cria73021yp3hpmhb19p9j0zg2yxwkawr6c"))))
210 (build-system perl-build-system)
212 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
213 ("perl-xml-sax" ,perl-xml-sax)))
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))))
224 (define-public perl-xml-namespacesupport
226 (name "perl-xml-namespacesupport")
231 (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
232 "XML-NamespaceSupport-" version ".tar.gz"))
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
243 (license (package-license perl))))
245 (define-public perl-xml-sax
247 (name "perl-xml-sax")
252 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
253 "XML-SAX-" version ".tar.gz"))
256 "115dypb50w1l94y3iwihv5nkixbsv1cxiqkd93y4rk5n6s74pc1j"))))
257 (build-system perl-build-system)
259 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
260 ("perl-xml-sax-base" ,perl-xml-sax-base)))
262 `(#:phases (modify-phases %standard-phases
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)
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))))
279 (define-public perl-xml-sax-base
281 (name "perl-xml-sax-base")
286 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
287 "XML-SAX-Base-" version ".tar.gz"))
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()
299 (license (package-license perl))))
301 (define-public perl-xml-simple
303 (name "perl-xml-simple")
308 "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-"
312 "0jj3jiray1l4pi9wkjcpxjc3v431whdwx5aqnhgdm4i7h3817zsw"))))
313 (build-system perl-build-system)
315 `(("perl-xml-parser" ,perl-xml-parser)))
316 (license (package-license perl))
317 (synopsis "Perl module for easy reading/writing of XML files")
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
322 (home-page "http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm")))
324 (define-public perl-xml-regexp
326 (name "perl-xml-regexp")
331 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-RegExp-"
335 "0m7wj00a2kik7wj0azhs1zagwazqh3hlz4255n75q21nc04r06fz"))))
336 (build-system perl-build-system)
338 `(("perl-xml-parser" ,perl-xml-parser)))
339 (license (package-license perl))
340 (synopsis "Perl regular expressions for XML tokens")
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")))
347 (define-public perl-xml-dom
349 (name "perl-xml-dom")
354 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-DOM-"
358 "1r0ampc88ni3sjpzr583k86076qg399arfm9xirv3cw49k3k5bzn"))))
359 (build-system perl-build-system)
361 `(("perl-libwww" ,perl-libwww)
362 ("perl-libxml" ,perl-libxml)
363 ("perl-xml-regexp" ,perl-xml-regexp)))
364 (license (package-license perl))
366 "Perl module for building DOM Level 1 compliant document structures")
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")))
375 (define-public pugixml
382 (uri (string-append "https://github.com/zeux/pugixml/archive/v"
384 (file-name (string-append name "-" version ".tar.gz"))
387 "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi"))))
388 (build-system cmake-build-system)
392 #:phases (modify-phases %standard-phases
398 (home-page "http://pugixml.org")
399 (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support")
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
408 (license license:expat)))
418 "https://fedorahosted.org/releases/x/m/xmlto/xmlto-"
422 "0dp5nxq491gymq806za0dk4hngfmq65ysrqbn0ypajqbbl6vf71n"))))
423 (build-system gnu-build-system)
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
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")
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+)))
442 (define-public xmlsec
448 (uri (string-append "https://www.aleksey.com/xmlsec/download/"
449 name "1-" version ".tar.gz"))
452 "01bkbv2y3x8d1sf4dcln1x3y2jyj391s3208d9a2ndhglly5j89j"))))
453 (build-system gnu-build-system)
454 (propagated-inputs ; according to xmlsec1.pc
455 `(("libxml2" ,libxml2)
456 ("libxslt" ,libxslt)))
459 ("libgcrypt" ,libgcrypt)
460 ("libltdl" ,libltdl)))
461 (home-page "http://www.libexpat.org/")
462 (synopsis "XML Security Library")
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
468 (license (license:x11-style "file://COPYING"
469 "See 'COPYING' in the distribution."))))
471 (define-public minixml
477 (uri (string-append "http://www.msweet.org/files/project3/mxml-"
481 "14pzhlfidj5v1qbxy7a59yn4jz9pnjrs2zwalz228jsq7ijm9vfd"))))
482 (build-system gnu-build-system)
484 `(#:tests? #f)) ;no "check" target
485 (home-page "http://www.minixml.org/")
486 (synopsis "Small XML parsing library")
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+)))