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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
47 (uri (string-append "mirror://sourceforge/expat/expat/"
48 version "/expat-" version ".tar.gz"))
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")
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)))
61 (define-public libxml2
67 (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
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")
83 (file-pattern "^catalog\\.xml$")
84 (file-type 'regular))))
85 (search-paths native-search-paths)
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)))
91 (define-public python-libxml2
92 (package (inherit libxml2)
93 (name "python-libxml2")
94 (build-system python-build-system)
96 `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
99 (modify-phases %standard-phases
102 (lambda* (#:key inputs #:allow-other-keys)
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'.
110 (format #f "ROOT = r'~a'" libxml2))
113 (string-append glibc "/include")))))))))
114 (inputs `(("libxml2" ,libxml2)))
115 (synopsis "Python bindings for the libxml2 library")))
117 (define-public python2-libxml2
118 (package-with-python2 python-libxml2))
120 (define-public libxslt
126 (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-"
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)
136 ("python" ,python-wrapper)
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)))
143 (define-public perl-xml-parser
145 (name "perl-xml-parser")
150 "mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-"
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")
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")))
174 (define-public perl-libxml
181 "mirror://cpan/authors/id/K/KM/KMACLEOD/libxml-perl-"
185 "1jy9af0ljyzj7wakqli0437zb2vrbplqj4xhab7bfj2xgfdhawa5"))))
186 (build-system perl-build-system)
188 `(("perl-xml-parser" ,perl-xml-parser)))
189 (license (package-license perl))
190 (synopsis "Perl SAX parser using XML::Parser")
192 "XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser
194 (home-page "http://search.cpan.org/~kmacleod/libxml-perl/lib/XML/Parser/PerlSAX.pm")))
196 (define-public perl-xml-libxml
198 (name "perl-xml-libxml")
203 (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
204 "XML-LibXML-" version ".tar.gz"))
207 "170c8dbk4p6jw9is0cria73021yp3hpmhb19p9j0zg2yxwkawr6c"))))
208 (build-system perl-build-system)
210 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
211 ("perl-xml-sax" ,perl-xml-sax)))
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))))
222 (define-public perl-xml-namespacesupport
224 (name "perl-xml-namespacesupport")
229 (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
230 "XML-NamespaceSupport-" version ".tar.gz"))
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
241 (license (package-license perl))))
243 (define-public perl-xml-sax
245 (name "perl-xml-sax")
250 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
251 "XML-SAX-" version ".tar.gz"))
254 "115dypb50w1l94y3iwihv5nkixbsv1cxiqkd93y4rk5n6s74pc1j"))))
255 (build-system perl-build-system)
257 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
258 ("perl-xml-sax-base" ,perl-xml-sax-base)))
260 `(#:phases (modify-phases %standard-phases
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)
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))))
277 (define-public perl-xml-sax-base
279 (name "perl-xml-sax-base")
284 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
285 "XML-SAX-Base-" version ".tar.gz"))
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()
297 (license (package-license perl))))
299 (define-public perl-xml-simple
301 (name "perl-xml-simple")
306 "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-"
310 "0jj3jiray1l4pi9wkjcpxjc3v431whdwx5aqnhgdm4i7h3817zsw"))))
311 (build-system perl-build-system)
313 `(("perl-xml-parser" ,perl-xml-parser)))
314 (license (package-license perl))
315 (synopsis "Perl module for easy reading/writing of XML files")
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
320 (home-page "http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm")))
322 (define-public perl-xml-regexp
324 (name "perl-xml-regexp")
329 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-RegExp-"
333 "0m7wj00a2kik7wj0azhs1zagwazqh3hlz4255n75q21nc04r06fz"))))
334 (build-system perl-build-system)
336 `(("perl-xml-parser" ,perl-xml-parser)))
337 (license (package-license perl))
338 (synopsis "Perl regular expressions for XML tokens")
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")))
345 (define-public perl-xml-dom
347 (name "perl-xml-dom")
352 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-DOM-"
356 "1r0ampc88ni3sjpzr583k86076qg399arfm9xirv3cw49k3k5bzn"))))
357 (build-system perl-build-system)
359 `(("perl-libwww" ,perl-libwww)
360 ("perl-libxml" ,perl-libxml)
361 ("perl-xml-regexp" ,perl-xml-regexp)))
362 (license (package-license perl))
364 "Perl module for building DOM Level 1 compliant document structures")
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")))
373 (define-public pugixml
380 (uri (string-append "https://github.com/zeux/pugixml/archive/v"
382 (file-name (string-append name "-" version ".tar.gz"))
385 "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi"))))
386 (build-system cmake-build-system)
390 #:phases (modify-phases %standard-phases
396 (home-page "http://pugixml.org")
397 (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support")
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
406 (license license:expat)))
416 "https://fedorahosted.org/releases/x/m/xmlto/xmlto-"
420 "0dp5nxq491gymq806za0dk4hngfmq65ysrqbn0ypajqbbl6vf71n"))))
421 (build-system gnu-build-system)
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
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")
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+)))
440 (define-public xmlsec
446 (uri (string-append "https://www.aleksey.com/xmlsec/download/"
447 name "1-" version ".tar.gz"))
450 "01bkbv2y3x8d1sf4dcln1x3y2jyj391s3208d9a2ndhglly5j89j"))))
451 (build-system gnu-build-system)
452 (propagated-inputs ; according to xmlsec1.pc
453 `(("libxml2" ,libxml2)
454 ("libxslt" ,libxslt)))
457 ("libgcrypt" ,libgcrypt)
458 ("libltdl" ,libltdl)))
459 (home-page "http://www.libexpat.org/")
460 (synopsis "XML Security Library")
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
466 (license (license:x11-style "file://COPYING"
467 "See 'COPYING' in the distribution."))))