gnu: Add File::Slurp::Tiny.
[jackhill/guix/guix.git] / gnu / packages / xml.scm
CommitLineData
d0414883 1;;; GNU Guix --- Functional package management for GNU
74528069 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
0899144f 3;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
b715dbac 4;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
10ac0f9f 5;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6ce212b8 6;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
99e29da1 7;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
877a6466 8;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
d0414883
LC
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
1ffa7090 25(define-module (gnu packages xml)
f0444eaf 26 #:use-module (gnu packages)
0899144f 27 #:use-module (gnu packages autotools)
322cbda7 28 #:use-module (gnu packages compression)
58cc3b38 29 #:use-module (gnu packages gnupg)
f0444eaf
AE
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages python)
a7fd7b68 32 #:use-module (gnu packages tls)
ad871fc6 33 #:use-module (gnu packages web)
b5b73a82 34 #:use-module ((guix licenses) #:prefix license:)
d0414883
LC
35 #:use-module (guix packages)
36 #:use-module (guix download)
6ce212b8 37 #:use-module (guix build-system cmake)
2a1e82bb 38 #:use-module (guix build-system gnu)
37f9ff63 39 #:use-module (guix build-system perl)
7ce32242 40 #:use-module (guix build-system python)
37f9ff63 41 #:use-module (gnu packages linux))
d0414883
LC
42
43(define-public expat
44 (package
45 (name "expat")
46 (version "2.1.0")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "mirror://sourceforge/expat/expat/"
50 version "/expat-" version ".tar.gz"))
51 (sha256
52 (base32
99e29da1
MW
53 "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2"))
54 (patches (list (search-patch "expat-CVE-2015-1283.patch")))))
d0414883
LC
55 (build-system gnu-build-system)
56 (home-page "http://www.libexpat.org/")
9e771e3b 57 (synopsis "Stream-oriented XML parser library written in C")
d0414883
LC
58 (description
59 "Expat is an XML parser library written in C. It is a
60stream-oriented parser in which an application registers handlers for
61things the parser might find in the XML document (like start tags).")
62 (license license:expat)))
f0444eaf
AE
63
64(define-public libxml2
65 (package
66 (name "libxml2")
821060f3 67 (version "2.9.3")
f0444eaf
AE
68 (source (origin
69 (method url-fetch)
70 (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
71 version ".tar.gz"))
72 (sha256
73 (base32
821060f3 74 "0bd17g6znn2r98gzpjppsqjg33iraky4px923j3k8kdl8qgy7sad"))))
f0444eaf
AE
75 (build-system gnu-build-system)
76 (home-page "http://www.xmlsoft.org/")
35b9e423 77 (synopsis "C parser for XML")
c1944c92 78 (propagated-inputs `(("zlib" ,zlib))) ; libxml2.la says '-lz'.
7ce32242 79 (native-inputs `(("perl" ,perl)))
2a8d4401
LC
80 ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
81 ;; sub-directory of any given package.
74528069
LC
82 (native-search-paths (list (search-path-specification
83 (variable "XML_CATALOG_FILES")
84 (separator " ")
85 (files '("xml"))
86 (file-pattern "^catalog\\.xml$")
87 (file-type 'regular))))
2a8d4401 88 (search-paths native-search-paths)
f0444eaf 89 (description
7c125ce0
AK
90 "Libxml2 is the XML C parser and toolkit developed for the Gnome
91project (but it is usable outside of the Gnome platform).")
f0444eaf 92 (license license:x11)))
58cc3b38 93
7ce32242
SB
94(define-public python-libxml2
95 (package (inherit libxml2)
96 (name "python-libxml2")
97 (build-system python-build-system)
98 (arguments
99 `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
100 #:tests? #f
101 #:phases
102 (modify-phases %standard-phases
103 (add-before
104 'build 'configure
105 (lambda* (#:key inputs #:allow-other-keys)
106 (chdir "python")
107 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
108 "cross-libc" "libc")))
109 (libxml2 (assoc-ref inputs "libxml2")))
110 (substitute* "setup.py"
111 ;; For 'libxml2/libxml/tree.h'.
112 (("ROOT = r'/usr'")
113 (format #f "ROOT = r'~a'" libxml2))
114 ;; For 'iconv.h'.
115 (("/opt/include")
116 (string-append glibc "/include")))))))))
117 (inputs `(("libxml2" ,libxml2)))
118 (synopsis "Python bindings for the libxml2 library")))
119
120(define-public python2-libxml2
121 (package-with-python2 python-libxml2))
122
58cc3b38
AE
123(define-public libxslt
124 (package
125 (name "libxslt")
126 (version "1.1.28")
127 (source (origin
128 (method url-fetch)
129 (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-"
130 version ".tar.gz"))
131 (sha256
132 (base32
b4a88dc2
MW
133 "13029baw9kkyjgr7q3jccw2mz38amq7mmpr5p3bh775qawd1bisz"))
134 (patches (list (search-patch "libxslt-CVE-2015-7995.patch")))))
58cc3b38
AE
135 (build-system gnu-build-system)
136 (home-page "http://xmlsoft.org/XSLT/index.html")
35b9e423 137 (synopsis "C library for applying XSLT stylesheets to XML documents")
58cc3b38
AE
138 (inputs `(("libgcrypt" ,libgcrypt)
139 ("libxml2" ,libxml2)
95288fcc 140 ("python" ,python-minimal-wrapper)
11e3f107 141 ("zlib" ,zlib)))
58cc3b38 142 (description
35b9e423 143 "Libxslt is an XSLT C library developed for the GNOME project. It is
58cc3b38
AE
144based on libxml for XML parsing, tree manipulation and XPath support.")
145 (license license:x11)))
2a1e82bb
LC
146
147(define-public perl-xml-parser
148 (package
149 (name "perl-xml-parser")
d495634b 150 (version "2.44")
2a1e82bb
LC
151 (source (origin
152 (method url-fetch)
153 (uri (string-append
2b8c5f54 154 "mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-"
2a1e82bb
LC
155 version ".tar.gz"))
156 (sha256
157 (base32
d495634b 158 "05ij0g6bfn27iaggxf8nl5rhlwx6f6p6xmdav6rjcly3x5zd1s8s"))))
2a1e82bb
LC
159 (build-system perl-build-system)
160 (arguments `(#:make-maker-flags
161 (let ((expat (assoc-ref %build-inputs "expat")))
162 (list (string-append "EXPATLIBPATH=" expat "/lib")
163 (string-append "EXPATINCPATH=" expat "/include")))))
164 (inputs `(("expat" ,expat)))
165 (license (package-license perl))
166 (synopsis "Perl bindings to the Expat XML parsing library")
167 (description
168 "This module provides ways to parse XML documents. It is built on top of
169XML::Parser::Expat, which is a lower level interface to James Clark's expat
170library. Each call to one of the parsing methods creates a new instance of
171XML::Parser::Expat which is then used to parse the document. Expat options
172may be provided when the XML::Parser object is created. These options are
173then passed on to the Expat object on each parse call. They can also be given
174as extra arguments to the parse methods, in which case they override options
175given at XML::Parser creation time.")
d495634b 176 (home-page "http://search.cpan.org/dist/XML-Parser")))
37f9ff63 177
7339fbe2 178(define-public perl-libxml
1385ba4f 179 (package
7339fbe2 180 (name "perl-libxml")
1385ba4f
AE
181 (version "0.08")
182 (source (origin
183 (method url-fetch)
184 (uri (string-append
185 "mirror://cpan/authors/id/K/KM/KMACLEOD/libxml-perl-"
186 version ".tar.gz"))
187 (sha256
188 (base32
189 "1jy9af0ljyzj7wakqli0437zb2vrbplqj4xhab7bfj2xgfdhawa5"))))
190 (build-system perl-build-system)
7b81406a 191 (propagated-inputs
1385ba4f
AE
192 `(("perl-xml-parser" ,perl-xml-parser)))
193 (license (package-license perl))
194 (synopsis "Perl SAX parser using XML::Parser")
195 (description
196 "XML::Parser::PerlSAX is a PerlSAX parser using the XML::Parser
197module.")
198 (home-page "http://search.cpan.org/~kmacleod/libxml-perl/lib/XML/Parser/PerlSAX.pm")))
199
3dd6bee1
EB
200(define-public perl-xml-libxml
201 (package
202 (name "perl-xml-libxml")
203 (version "2.0118")
204 (source
205 (origin
206 (method url-fetch)
207 (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
208 "XML-LibXML-" version ".tar.gz"))
209 (sha256
210 (base32
211 "170c8dbk4p6jw9is0cria73021yp3hpmhb19p9j0zg2yxwkawr6c"))))
212 (build-system perl-build-system)
213 (propagated-inputs
214 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
215 ("perl-xml-sax" ,perl-xml-sax)))
216 (inputs
217 `(("libxml2" ,libxml2)))
218 (home-page "http://search.cpan.org/dist/XML-LibXML")
219 (synopsis "Perl interface to libxml2")
220 (description "This module implements a Perl interface to the libxml2
221library which provides interfaces for parsing and manipulating XML files. This
222module allows Perl programmers to make use of the highly capable validating
223XML parser and the high performance DOM implementation.")
224 (license (package-license perl))))
225
b715dbac
EB
226(define-public perl-xml-namespacesupport
227 (package
228 (name "perl-xml-namespacesupport")
229 (version "1.11")
230 (source
231 (origin
232 (method url-fetch)
233 (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
234 "XML-NamespaceSupport-" version ".tar.gz"))
235 (sha256
236 (base32
237 "1sklgcldl3w6gn706vx1cgz6pm4y5lfgsjxnfqyk20pilgq530bd"))))
238 (build-system perl-build-system)
239 (home-page "http://search.cpan.org/dist/XML-NamespaceSupport")
240 (synopsis "XML namespace support class")
241 (description "This module offers a simple to process namespaced XML
242names (unames) from within any application that may need them. It also helps
243maintain a prefix to namespace URI map, and provides a number of basic
244checks.")
245 (license (package-license perl))))
246
18b8bbb3
EB
247(define-public perl-xml-sax
248 (package
249 (name "perl-xml-sax")
250 (version "0.99")
251 (source
252 (origin
253 (method url-fetch)
254 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
255 "XML-SAX-" version ".tar.gz"))
256 (sha256
257 (base32
258 "115dypb50w1l94y3iwihv5nkixbsv1cxiqkd93y4rk5n6s74pc1j"))))
259 (build-system perl-build-system)
260 (propagated-inputs
261 `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
262 ("perl-xml-sax-base" ,perl-xml-sax-base)))
263 (arguments
264 `(#:phases (modify-phases %standard-phases
265 (add-before
40b084a3 266 'install 'augment-path
18b8bbb3
EB
267 ;; The install target tries to load the newly-installed
268 ;; XML::SAX module, but can't find it, so we need to tell
269 ;; perl where to look.
270 (lambda* (#:key outputs #:allow-other-keys)
271 (setenv "PERL5LIB"
272 (string-append (getenv "PERL5LIB") ":"
273 (assoc-ref outputs "out")
274 "/lib/perl5/site_perl")))))))
275 (home-page "http://search.cpan.org/dist/XML-SAX")
276 (synopsis "Perl API for XML")
277 (description "XML::SAX consists of several framework classes for using and
278building Perl SAX2 XML parsers, filters, and drivers.")
279 (license (package-license perl))))
280
1ed6d5bc
EB
281(define-public perl-xml-sax-base
282 (package
283 (name "perl-xml-sax-base")
284 (version "1.08")
285 (source
286 (origin
287 (method url-fetch)
288 (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
289 "XML-SAX-Base-" version ".tar.gz"))
290 (sha256
291 (base32
292 "17i161rq1ngjlk0c8vdkrkkc56y1pf51k1g54y28py0micqp0qk6"))))
293 (build-system perl-build-system)
294 (home-page "http://search.cpan.org/dist/XML-SAX-Base")
295 (synopsis "Base class for SAX Drivers and Filters")
296 (description "This module has a very simple task - to be a base class for
297PerlSAX drivers and filters. It's default behaviour is to pass the input
298directly to the output unchanged. It can be useful to use this module as a
299base class so you don't have to, for example, implement the characters()
300callback.")
301 (license (package-license perl))))
302
535dc6cf
AE
303(define-public perl-xml-simple
304 (package
305 (name "perl-xml-simple")
306 (version "2.20")
307 (source (origin
308 (method url-fetch)
309 (uri (string-append
310 "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-"
311 version ".tar.gz"))
312 (sha256
313 (base32
314 "0jj3jiray1l4pi9wkjcpxjc3v431whdwx5aqnhgdm4i7h3817zsw"))))
315 (build-system perl-build-system)
27ef7f45 316 (propagated-inputs
535dc6cf
AE
317 `(("perl-xml-parser" ,perl-xml-parser)))
318 (license (package-license perl))
319 (synopsis "Perl module for easy reading/writing of XML files")
320 (description
321 "The XML::Simple module provides a simple API layer on top of an
322underlying XML parsing module (either XML::Parser or one of the SAX2
323parser modules).")
324 (home-page "http://search.cpan.org/~grantm/XML-Simple-2.20/lib/XML/Simple.pm")))
325
a2e520af
AE
326(define-public perl-xml-regexp
327 (package
328 (name "perl-xml-regexp")
329 (version "0.04")
330 (source (origin
331 (method url-fetch)
332 (uri (string-append
333 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-RegExp-"
334 version ".tar.gz"))
335 (sha256
336 (base32
337 "0m7wj00a2kik7wj0azhs1zagwazqh3hlz4255n75q21nc04r06fz"))))
338 (build-system perl-build-system)
339 (inputs
340 `(("perl-xml-parser" ,perl-xml-parser)))
341 (license (package-license perl))
342 (synopsis "Perl regular expressions for XML tokens")
343 (description
344 "XML::RegExp contains regular expressions for the following XML tokens:
345BaseChar, Ideographic, Letter, Digit, Extender, CombiningChar, NameChar,
346EntityRef, CharRef, Reference, Name, NmToken, and AttValue.")
347 (home-page "http://search.cpan.org/~tjmather/XML-RegExp/lib/XML/RegExp.pm")))
348
ad871fc6
AE
349(define-public perl-xml-dom
350 (package
351 (name "perl-xml-dom")
352 (version "1.44")
353 (source (origin
354 (method url-fetch)
355 (uri (string-append
356 "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-DOM-"
357 version ".tar.gz"))
358 (sha256
359 (base32
360 "1r0ampc88ni3sjpzr583k86076qg399arfm9xirv3cw49k3k5bzn"))))
361 (build-system perl-build-system)
f7faff88
AE
362 (propagated-inputs
363 `(("perl-libwww" ,perl-libwww)
ad871fc6 364 ("perl-libxml" ,perl-libxml)
ad871fc6
AE
365 ("perl-xml-regexp" ,perl-xml-regexp)))
366 (license (package-license perl))
367 (synopsis
368 "Perl module for building DOM Level 1 compliant document structures")
369 (description
370 "This module extends the XML::Parser module by Clark Cooper. The
371XML::Parser module is built on top of XML::Parser::Expat, which is a lower
372level interface to James Clark's expat library. XML::DOM::Parser is derived
373from XML::Parser. It parses XML strings or files and builds a data structure
374that conforms to the API of the Document Object Model.")
375 (home-page "http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm")))
376
649e1676
RW
377(define-public perl-xml-compile-tester
378 (package
379 (name "perl-xml-compile-tester")
380 (version "0.90")
381 (source (origin
382 (method url-fetch)
383 (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
384 "XML-Compile-Tester-" version ".tar.gz"))
385 (sha256
386 (base32
387 "1bcl8x8cyacqv9yjp97aq9qq85sy8wv78kd8c16yd9yw3by4cpp1"))))
388 (build-system perl-build-system)
389 (propagated-inputs
390 `(("perl-log-report" ,perl-log-report)
391 ("perl-test-deep" ,perl-test-deep)))
392 (home-page "http://search.cpan.org/dist/XML-Compile-Tester")
393 (synopsis "XML::Compile related regression testing")
394 (description
395 "The @code{XML::Compile} module suite has extensive regression testing.
396This module provide functions which simplify writing tests for
397@code{XML::Compile} related distributions.")
398 (license (package-license perl))))
399
b494a5f1
RW
400(define-public perl-xml-compile
401 (package
402 (name "perl-xml-compile")
403 (version "1.51")
404 (source (origin
405 (method url-fetch)
406 (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
407 "XML-Compile-" version ".tar.gz"))
408 (sha256
409 (base32
410 "06fj4zf0yh4kf3kx4bhwrmrjr6al40nasasbgfhn8f1zxwkmm8f2"))))
411 (build-system perl-build-system)
412 (propagated-inputs
413 `(("perl-log-report" ,perl-log-report)
414 ("perl-xml-compile-tester" ,perl-xml-compile-tester)
415 ("perl-xml-libxml" ,perl-xml-libxml)
416 ("perl-test-deep" ,perl-test-deep)))
417 (home-page "http://search.cpan.org/dist/XML-Compile")
418 (synopsis "Compilation-based XML processing")
419 (description
420 "@code{XML::Compile} can be used to translate a Perl data-structure into
421XML or XML into a Perl data-structure, both directions under rigid control by
422a schema.")
423 (license (package-license perl))))
424
6ce212b8
RW
425(define-public pugixml
426 (package
427 (name "pugixml")
428 (version "1.6")
429 (source
430 (origin
431 (method url-fetch)
432 (uri (string-append "https://github.com/zeux/pugixml/archive/v"
433 version ".tar.gz"))
434 (file-name (string-append name "-" version ".tar.gz"))
435 (sha256
436 (base32
437 "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi"))))
438 (build-system cmake-build-system)
439 (arguments
440 `(#:tests? #f
441 #:out-of-source? #f
442 #:phases (modify-phases %standard-phases
443 (add-before
444 'configure 'chdir
445 (lambda _
446 (chdir "scripts")
447 #t)))))
448 (home-page "http://pugixml.org")
449 (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support")
450 (description
451 "pugixml is a C++ XML processing library, which consists of a DOM-like
452interface with rich traversal/modification capabilities, a fast XML parser
453which constructs the DOM tree from an XML file/buffer, and an XPath 1.0
454implementation for complex data-driven tree queries. Full Unicode support is
455also available, with Unicode interface variants and conversions between
456different Unicode encodings which happen automatically during
457parsing/saving.")
458 (license license:expat)))
459
37f9ff63
AE
460(define-public xmlto
461 (package
462 (name "xmlto")
877a6466 463 (version "0.0.28")
37f9ff63
AE
464 (source
465 (origin
466 (method url-fetch)
467 (uri (string-append
468 "https://fedorahosted.org/releases/x/m/xmlto/xmlto-"
469 version ".tar.bz2"))
470 (sha256
471 (base32
877a6466 472 "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i"))))
37f9ff63 473 (build-system gnu-build-system)
ae0c1202
LC
474 (arguments
475 ;; Make sure the reference to util-linux's 'getopt' is kept in 'xmlto'.
476 '(#:configure-flags (list (string-append "GETOPT="
477 (assoc-ref %build-inputs
478 "util-linux")
479 "/bin/getopt"))))
37f9ff63 480 (inputs
ae0c1202
LC
481 `(("util-linux" ,util-linux) ; for 'getopt'
482 ("libxml2" ,libxml2) ; for 'xmllint'
483 ("libxslt" ,libxslt))) ; for 'xsltproc'
37f9ff63
AE
484 (home-page "http://cyberelk.net/tim/software/xmlto/")
485 (synopsis "Front-end to an XSL toolchain")
486 (description
487 "Xmlto is a front-end to an XSL toolchain. It chooses an appropriate
488stylesheet for the conversion you want and applies it using an external
489XSL-T processor. It also performs any necessary post-processing.")
490 (license license:gpl2+)))
0899144f
AE
491
492(define-public xmlsec
493 (package
494 (name "xmlsec")
495 (version "1.2.20")
496 (source (origin
497 (method url-fetch)
498 (uri (string-append "https://www.aleksey.com/xmlsec/download/"
499 name "1-" version ".tar.gz"))
500 (sha256
501 (base32
502 "01bkbv2y3x8d1sf4dcln1x3y2jyj391s3208d9a2ndhglly5j89j"))))
503 (build-system gnu-build-system)
504 (propagated-inputs ; according to xmlsec1.pc
505 `(("libxml2" ,libxml2)
506 ("libxslt" ,libxslt)))
507 (inputs
508 `(("gnutls" ,gnutls)
509 ("libgcrypt" ,libgcrypt)
510 ("libltdl" ,libltdl)))
511 (home-page "http://www.libexpat.org/")
512 (synopsis "XML Security Library")
513 (description
514 "The XML Security Library is a C library based on Libxml2. It
515supports XML security standards such as XML Signature, XML Encryption,
516Canonical XML (part of Libxml2) and Exclusive Canonical XML (part of
517Libxml2).")
518 (license (license:x11-style "file://COPYING"
519 "See 'COPYING' in the distribution."))))
96f8d991
RW
520
521(define-public minixml
522 (package
523 (name "minixml")
524 (version "2.9")
525 (source (origin
526 (method url-fetch)
527 (uri (string-append "http://www.msweet.org/files/project3/mxml-"
528 version ".tar.gz"))
529 (sha256
530 (base32
531 "14pzhlfidj5v1qbxy7a59yn4jz9pnjrs2zwalz228jsq7ijm9vfd"))))
532 (build-system gnu-build-system)
533 (arguments
534 `(#:tests? #f)) ;no "check" target
535 (home-page "http://www.minixml.org/")
536 (synopsis "Small XML parsing library")
537 (description
538 "Mini-XML is a small C library to read and write XML files and strings in
539UTF-8 and UTF-16 encoding.")
540 ;; LGPL 2.0+ with additional exceptions for static linking
541 (license license:lgpl2.0+)))
33ae9107
DT
542
543;; TinyXML is an unmaintained piece of software, so the patches and build
544;; system massaging have no upstream potential.
545(define-public tinyxml
546 (package
547 (name "tinyxml")
548 (version "2.6.2")
549 (source (origin
550 (method url-fetch)
551 (uri (string-append "mirror://sourceforge/tinyxml/tinyxml_"
552 (string-join (string-split version #\.) "_")
553 ".tar.gz"))
554 (sha256
555 (base32
556 "14smciid19lvkxqznfig77jxn5s4iq3jpb47vh5a6zcaqp7gvg8m"))
557 (patches (list (search-patch "tinyxml-use-stl.patch")))))
558 (build-system gnu-build-system)
559 ;; This library is missing *a lot* of the steps to make it usable, so we
560 ;; have to add them here, like every other distro must do.
561 (arguments
562 `(#:phases
563 (modify-phases %standard-phases
564 (delete 'configure)
565 (add-after 'build 'build-shared-library
566 (lambda _
567 (zero? (system* "g++" "-Wall" "-O2" "-shared" "-fpic"
568 "tinyxml.cpp" "tinyxmlerror.cpp"
569 "tinyxmlparser.cpp" "tinystr.cpp"
570 "-o" "libtinyxml.so"))))
571 (replace 'check
572 (lambda _ (zero? (system "./xmltest"))))
573 (replace 'install
574 (lambda* (#:key outputs #:allow-other-keys)
575 (let* ((out (assoc-ref outputs "out"))
576 (include (string-append out "/include"))
577 (lib (string-append out "/lib"))
578 (pkgconfig (string-append out "/lib/pkgconfig"))
579 (doc (string-append out "/share/doc")))
580 ;; Install libs and headers.
581 (install-file "libtinyxml.so" lib)
582 (install-file "tinystr.h" include)
583 (install-file "tinyxml.h" include)
584 ;; Generate and install pkg-config file.
585 (mkdir-p pkgconfig)
586 ;; Software such as Kodi expect this file to be present, but
587 ;; it's not provided in the source code.
588 (call-with-output-file (string-append pkgconfig "/tinyxml.pc")
589 (lambda (port)
590 (format port "prefix=~a
591exec_prefix=${prefix}
592libdir=${exec_prefix}/lib
593includedir=${prefix}/include
594
595Name: TinyXML
596Description: A simple, small, C++ XML parser
597Version: ~a
598Libs: -L${libdir} -ltinyxml
599Cflags: -I${includedir}
600"
601 out ,version)))
602 ;; Install docs.
603 (mkdir-p doc)
604 (copy-recursively "docs" (string-append doc "tinyxml"))
605 #t))))))
606 (synopsis "Small XML parser for C++")
607 (description "TinyXML is a small and simple XML parsing library for the
608C++ programming langauge.")
609 (home-page "http://www.grinninglizard.com/tinyxml/index.html")
610 (license license:zlib)))