Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / xml.scm
index 173435d..c4ec33e 100644 (file)
@@ -1,6 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
+;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages xml)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages gnutls)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages web)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages linux))
 
 (define-public expat
@@ -54,22 +61,19 @@ things the parser might find in the XML document (like start tags).")
 (define-public libxml2
   (package
     (name "libxml2")
-    (version "2.9.0")
+    (version "2.9.2")
     (source (origin
              (method url-fetch)
              (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
                                  version ".tar.gz"))
              (sha256
               (base32
-               "10ib8bpar2pl68aqksfinvfmqknwnk7i35ibq6yjl8dpb0cxj9dd"))))
+               "1g6mf03xcabmk5ing1lwqmasr803616gb2xhn7pll10x2l5w6y2i"))))
     (build-system gnu-build-system)
     (home-page "http://www.xmlsoft.org/")
     (synopsis "C parser for XML")
     (propagated-inputs `(("zlib" ,zlib))) ; libxml2.la says '-lz'.
-    (native-inputs `(("perl" ,perl)
-                     ("python" ,python-2))) ; incompatible with Python 3 (print syntax)
-
-
+    (native-inputs `(("perl" ,perl)))
     ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
     ;; sub-directory of any given package.
     (native-search-paths (list (search-path-specification
@@ -79,29 +83,40 @@ things the parser might find in the XML document (like start tags).")
                                 (file-pattern "^catalog\\.xml$")
                                 (file-type 'regular))))
     (search-paths native-search-paths)
-
-    (arguments
-     `(#:phases
-        (alist-replace
-         'install
-         (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
-          (let ((install (assoc-ref %standard-phases 'install))
-                (glibc (assoc-ref inputs ,(if (%current-target-system)
-                                              "cross-libc" "libc")))
-                (out (assoc-ref outputs "out")))
-            (apply install args)
-            (chdir "python")
-            (substitute* "setup.py"
-              (("/opt/include")
-               (string-append glibc "/include")))
-            (system* "python" "setup.py" "install"
-                     (string-append "--prefix=" out))))
-        %standard-phases)))
     (description
      "Libxml2 is the XML C parser and toolkit developed for the Gnome project
 (but it is usable outside of the Gnome platform).")
     (license license:x11)))
 
+(define-public python-libxml2
+  (package (inherit libxml2)
+    (name "python-libxml2")
+    (build-system python-build-system)
+    (arguments
+     `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-before
+          'build 'configure
+          (lambda* (#:key inputs #:allow-other-keys)
+            (chdir "python")
+            (let ((glibc   (assoc-ref inputs ,(if (%current-target-system)
+                                                  "cross-libc" "libc")))
+                  (libxml2 (assoc-ref inputs "libxml2")))
+              (substitute* "setup.py"
+                ;; For 'libxml2/libxml/tree.h'.
+                (("ROOT = r'/usr'")
+                 (format #f "ROOT = r'~a'" libxml2))
+                ;; For 'iconv.h'.
+                (("/opt/include")
+                 (string-append glibc "/include")))))))))
+    (inputs `(("libxml2" ,libxml2)))
+    (synopsis "Python bindings for the libxml2 library")))
+
+(define-public python2-libxml2
+  (package-with-python2 python-libxml2))
+
 (define-public libxslt
   (package
     (name "libxslt")
@@ -178,6 +193,109 @@ given at XML::Parser creation time.")
 module.")
     (home-page "http://search.cpan.org/~kmacleod/libxml-perl/lib/XML/Parser/PerlSAX.pm")))
 
+(define-public perl-xml-libxml
+  (package
+    (name "perl-xml-libxml")
+    (version "2.0118")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
+                           "XML-LibXML-" version ".tar.gz"))
+       (sha256
+        (base32
+         "170c8dbk4p6jw9is0cria73021yp3hpmhb19p9j0zg2yxwkawr6c"))))
+    (build-system perl-build-system)
+    (propagated-inputs
+     `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
+       ("perl-xml-sax" ,perl-xml-sax)))
+    (inputs
+     `(("libxml2" ,libxml2)))
+    (home-page "http://search.cpan.org/dist/XML-LibXML")
+    (synopsis "Perl interface to libxml2")
+    (description "This module implements a Perl interface to the libxml2
+library which provides interfaces for parsing and manipulating XML files. This
+module allows Perl programmers to make use of the highly capable validating
+XML parser and the high performance DOM implementation.")
+    (license (package-license perl))))
+
+(define-public perl-xml-namespacesupport
+  (package
+    (name "perl-xml-namespacesupport")
+    (version "1.11")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
+                           "XML-NamespaceSupport-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1sklgcldl3w6gn706vx1cgz6pm4y5lfgsjxnfqyk20pilgq530bd"))))
+    (build-system perl-build-system)
+    (home-page "http://search.cpan.org/dist/XML-NamespaceSupport")
+    (synopsis "XML namespace support class")
+    (description "This module offers a simple to process namespaced XML
+names (unames) from within any application that may need them.  It also helps
+maintain a prefix to namespace URI map, and provides a number of basic
+checks.")
+    (license (package-license perl))))
+
+(define-public perl-xml-sax
+  (package
+    (name "perl-xml-sax")
+    (version "0.99")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
+                           "XML-SAX-" version ".tar.gz"))
+       (sha256
+        (base32
+         "115dypb50w1l94y3iwihv5nkixbsv1cxiqkd93y4rk5n6s74pc1j"))))
+    (build-system perl-build-system)
+    (propagated-inputs
+     `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
+       ("perl-xml-sax-base" ,perl-xml-sax-base)))
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-before
+                   'install 'augment-path
+                   ;; The install target tries to load the newly-installed
+                   ;; XML::SAX module, but can't find it, so we need to tell
+                   ;; perl where to look.
+                   (lambda* (#:key outputs #:allow-other-keys)
+                     (setenv "PERL5LIB"
+                             (string-append (getenv "PERL5LIB") ":"
+                                            (assoc-ref outputs "out")
+                                            "/lib/perl5/site_perl")))))))
+    (home-page "http://search.cpan.org/dist/XML-SAX")
+    (synopsis "Perl API for XML")
+    (description "XML::SAX consists of several framework classes for using and
+building Perl SAX2 XML parsers, filters, and drivers.")
+    (license (package-license perl))))
+
+(define-public perl-xml-sax-base
+  (package
+    (name "perl-xml-sax-base")
+    (version "1.08")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
+                           "XML-SAX-Base-" version ".tar.gz"))
+       (sha256
+        (base32
+         "17i161rq1ngjlk0c8vdkrkkc56y1pf51k1g54y28py0micqp0qk6"))))
+    (build-system perl-build-system)
+    (home-page "http://search.cpan.org/dist/XML-SAX-Base")
+    (synopsis "Base class for SAX Drivers and Filters")
+    (description "This module has a very simple task - to be a base class for
+PerlSAX drivers and filters.  It's default behaviour is to pass the input
+directly to the output unchanged.  It can be useful to use this module as a
+base class so you don't have to, for example, implement the characters()
+callback.")
+    (license (package-license perl))))
+
 (define-public perl-xml-simple
   (package
     (name "perl-xml-simple")
@@ -252,6 +370,41 @@ from XML::Parser.  It parses XML strings or files and builds a data structure
 that conforms to the API of the Document Object Model.")
     (home-page "http://search.cpan.org/~tjmather/XML-DOM-1.44/lib/XML/DOM.pm")))
 
+(define-public pugixml
+  (package
+    (name "pugixml")
+    (version "1.6")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/zeux/pugixml/archive/v"
+                          version ".tar.gz"))
+      (file-name (string-append name "-" version ".tar.gz"))
+      (sha256
+       (base32
+        "0czbcv9aqf2rw3s9cljz2wb1f4zbhd07wnj7ykklklccl0ipfnwi"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f
+       #:out-of-source? #f
+       #:phases (modify-phases %standard-phases
+                  (add-before
+                   'configure 'chdir
+                   (lambda _
+                     (chdir "scripts")
+                     #t)))))
+    (home-page "http://pugixml.org")
+    (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support")
+    (description
+     "pugixml is a C++ XML processing library, which consists of a DOM-like
+interface with rich traversal/modification capabilities, a fast XML parser
+which constructs the DOM tree from an XML file/buffer, and an XPath 1.0
+implementation for complex data-driven tree queries.  Full Unicode support is
+also available, with Unicode interface variants and conversions between
+different Unicode encodings which happen automatically during
+parsing/saving.")
+    (license license:expat)))
+
 (define-public xmlto
   (package
     (name "xmlto")
@@ -283,3 +436,32 @@ that conforms to the API of the Document Object Model.")
 stylesheet for the conversion you want and applies it using an external
 XSL-T processor.  It also performs any necessary post-processing.")
     (license license:gpl2+)))
+
+(define-public xmlsec
+  (package
+    (name "xmlsec")
+    (version "1.2.20")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "https://www.aleksey.com/xmlsec/download/"
+                                 name "1-" version ".tar.gz"))
+             (sha256
+              (base32
+               "01bkbv2y3x8d1sf4dcln1x3y2jyj391s3208d9a2ndhglly5j89j"))))
+    (build-system gnu-build-system)
+    (propagated-inputs ; according to xmlsec1.pc
+     `(("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)))
+    (inputs
+     `(("gnutls" ,gnutls)
+       ("libgcrypt" ,libgcrypt)
+       ("libltdl" ,libltdl)))
+    (home-page "http://www.libexpat.org/")
+    (synopsis "XML Security Library")
+    (description
+     "The XML Security Library is a C library based on Libxml2.  It
+supports XML security standards such as XML Signature, XML Encryption,
+Canonical XML (part of Libxml2) and Exclusive Canonical XML (part of
+Libxml2).")
+    (license (license:x11-style "file://COPYING"
+                                "See 'COPYING' in the distribution."))))