gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / serialization.scm
index 489c53f..4ef74c2 100644 (file)
@@ -1,14 +1,14 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
-;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Corentin Bocquillon <corentin@nybble.fr>
 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
-;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017 Nikita <nikita@n0.is>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -30,6 +30,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-science)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages perl))
 
-(define-public cereal
+(define-public avro-cpp-1.9
   (package
-    (name "cereal")
-    (version "1.2.1")
+    (name "avro-cpp")
+    (version "1.9.2")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://github.com/USCiLab/cereal/archive/v"
-                                  version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (uri (string-append
+                    "https://archive.apache.org/dist/avro/avro-" version
+                    "/avro-src-" version ".tar.gz"))
               (sha256
-               (base32
-                "0kj32h3j2128anig0g9gzw82kfyd5xqfkwq6vdyv900jx8i1qckx"))))
+               (base32 "0i3fpm7r72yw397qc8yw9ybzk2mxjkv0yk5hnn00ylc1wbd0np73"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'chdir
+           (lambda _ (chdir "lang/c++"))))))
+    (inputs
+     `(("boost" ,boost)
+       ("snappy" ,snappy)))
+    (home-page "https://avro.apache.org/")
+    (synopsis "Data serialization system")
+    (description "Apache Avro is a data serialization system.  Avro provides:
+@enumerate
+@item Rich data structures;
+@item a compact, fast, binary data format;
+@item a container file, to store persistent data;
+@item remote procedure call (RPC); and
+@item simple integration with dynamic languages.
+@end enumerate
+
+Code generation is not required to read or write data files nor to use or
+implement RPC protocols.")
+    (license license:asl2.0)))
+
+(define-public cereal
+  (package
+    (name "cereal")
+    (version "1.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/USCiLab/cereal")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vxkrsnxkiblzi1z61vfix167c184fy868sgwj2dxxgbgjcq2nrh"))))
     (build-system cmake-build-system)
     (arguments
      `(;; The only included tests are portability tests requiring
             #t)))))
     (native-inputs
      `(("doxygen" ,doxygen)))
-    (home-page "http://uscilab.github.io/cereal/")
+    (home-page "https://uscilab.github.io/cereal/")
     (synopsis "C++11 library for serialization")
     (description
      "Cereal is a header-only C++11 serialization library.  Cereal takes
@@ -99,7 +141,7 @@ such as compact binary encodings, XML, or JSON.")
 (define-public msgpack
   (package
     (name "msgpack")
-    (version "1.4.2")
+    (version "3.2.1")
     (source
      (origin
        (method url-fetch)
@@ -114,14 +156,10 @@ such as compact binary encodings, XML, or JSON.")
            (close-output-port p)
            #t))
        (sha256
-        (base32
-         "18hzmyfg3mvnp7ab03nqdzzvqagkl42gygjpi4zv4i7aca2dmwf0"))))
-    (build-system gnu-build-system)
+        (base32 "1ljqmgscdb0f8w8kx2lnswnisyxchcmijbjbmswkv0g187bvqg23"))))
+    (build-system cmake-build-system)
     (native-inputs
-     `(("googletest" ,googletest)
-       ("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("libtool" ,libtool)
+     `(("googletest" ,googletest-1.8)
        ("pkg-config" ,pkg-config)))
     (propagated-inputs
      `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
@@ -138,14 +176,15 @@ serialization.")
   (package
     (name "libmpack")
     (version "1.0.5")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/tarruda/libmpack/"
-                                  "archive/" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
-              (sha256
-               (base32
-                "0ml922gv8y99lbldqb9ykpjndla0hlprdjyl79yskkhwv2ai7sac"))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tarruda/libmpack")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -166,14 +205,16 @@ that implements both the msgpack and msgpack-rpc specifications.")
 (define-public lua-libmpack
   (package (inherit libmpack)
     (name "lua-libmpack")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/libmpack/libmpack-lua/"
-                                  "archive/" (package-version libmpack) ".tar.gz"))
-              (file-name (string-append name "-" (package-version libmpack) ".tar.gz"))
-              (sha256
-               (base32
-                "153zrrbyxhf71dgzjjhrk56rfwk3nisslpgcqyg44v8fnz1xpk6i"))))
+    (version "1.0.8")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/libmpack/libmpack-lua")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1ijvzgq5hvib03w5rghv31wi7byamwg7qdx5pawvhvnflaii8ivw"))))
     (build-system gnu-build-system)
     (arguments
      `(;; FIXME: tests require "busted", which is not yet available in Guix.
@@ -202,10 +243,9 @@ that implements both the msgpack and msgpack-rpc specifications.")
              ;; prerequisites are added to the inputs of the gcc invocation.
              (substitute* "Makefile"
                (("\\$\\(MPACK\\): mpack-src") "$(MPACK): "))
-             (mkdir-p "mpack-src")
-             (zero? (system* "tar" "-C" "mpack-src"
-                             "--strip-components=1"
-                             "-xvf" (assoc-ref inputs "libmpack"))))))))
+             (copy-recursively (assoc-ref inputs "libmpack")
+                               "mpack-src")
+             #t)))))
     (inputs
      `(("lua" ,lua)))
     (native-inputs
@@ -215,7 +255,7 @@ that implements both the msgpack and msgpack-rpc specifications.")
     (synopsis "Lua bindings for the libmpack binary serialization library")))
 
 (define-public lua5.1-libmpack
-  (package (inherit lua-libmpack)
+  (package/inherit lua-libmpack
     (name "lua5.1-libmpack")
     (arguments
      (substitute-keyword-arguments (package-arguments lua-libmpack)
@@ -235,7 +275,7 @@ that implements both the msgpack and msgpack-rpc specifications.")
      `(("lua" ,lua-5.1)))))
 
 (define-public lua5.2-libmpack
-  (package (inherit lua-libmpack)
+  (package/inherit lua-libmpack
     (name "lua5.2-libmpack")
     (arguments
      (substitute-keyword-arguments (package-arguments lua-libmpack)
@@ -257,34 +297,19 @@ that implements both the msgpack and msgpack-rpc specifications.")
 (define-public yaml-cpp
   (package
     (name "yaml-cpp")
-    (version "0.6.2")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/jbeder/yaml-cpp/archive/"
-                    "yaml-cpp-" version ".tar.gz"))
-              (sha256
-               (base32
-                "01gxn7kc8pzyh4aadjxxzq8cignmbwmm9rfrsmgqfg9w2q75dn74"))))
+    (version "0.6.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/jbeder/yaml-cpp")
+             (commit (string-append "yaml-cpp-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s"))))
     (build-system cmake-build-system)
     (arguments
-     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'dont-install-gtest-libraries
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (with-directory-excursion
-                 (string-append out "/include")
-                 (delete-file-recursively "gtest")
-                 (delete-file-recursively "gmock"))
-               (with-directory-excursion
-                 (string-append out "/lib")
-                 (for-each (lambda (file)
-                             (delete-file file))
-                           '("libgmock.so" "libgmock_main.so"
-                             "libgtest.so" "libgtest_main.so"))))
-             #t)))))
+     '(#:configure-flags '("-DYAML_BUILD_SHARED_LIBS=ON")))
     (native-inputs
      `(("python" ,python)))
     (home-page "https://github.com/jbeder/yaml-cpp")
@@ -295,20 +320,25 @@ that implements both the msgpack and msgpack-rpc specifications.")
 (define-public jsoncpp
   (package
     (name "jsoncpp")
-    (version "1.8.4")
+    (version "1.9.2")
+    (home-page "https://github.com/open-source-parsers/jsoncpp")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/open-source-parsers/jsoncpp/archive/"
-                    version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference (url home-page) (commit version)))
+              (file-name (git-file-name name version))
+              (patches (search-patches "jsoncpp-fix-inverted-case.patch"))
               (sha256
                (base32
-                "1dpxk8hkni5dq4mdw8qbaj40jmid3a31d1gh8iqcnfwkw34ym7f4"))))
+                "037d1b1qdmn3rksmn1j71j26bv4hkjv7sn7da261k853xb5899sg"))))
     (build-system cmake-build-system)
-    (home-page "https://github.com/open-source-parsers/jsoncpp")
     (arguments
-     `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")))
+     `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
+                           ,@(if (%current-target-system)
+                                 `("-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF")
+                                 '()))
+       ,@(if (%current-target-system)
+             '()
+             `(#:cmake ,cmake-bootstrap))))
     (synopsis "C++ library for interacting with JSON")
     (description "JsonCpp is a C++ library that allows manipulating JSON values,
 including serialization and deserialization to and from strings.  It can also
@@ -316,10 +346,27 @@ preserve existing comment in unserialization/serialization steps, making
 it a convenient format to store user input files.")
     (license license:expat)))
 
+;; Tensorflow does not build with jsoncpp 1.8.x.  It is built with commit
+;; 4356d9bba191e1e16ce7a92073cbf3e63564e973, which lies between version 1.7.2
+;; and 1.7.3.
+(define-public jsoncpp-for-tensorflow
+  (package (inherit jsoncpp)
+    (name "jsoncpp")
+    (version "1.7.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/open-source-parsers/jsoncpp")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1180ln8blrb0mwzpcf78k49hlki6di65q77rsvglf83kfcyh4d7z"))))))
+
 (define-public capnproto
   (package
     (name "capnproto")
-    (version "0.7.0")
+    (version "0.8.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -327,7 +374,7 @@ it a convenient format to store user input files.")
                     version ".tar.gz"))
               (sha256
                (base32
-                "0hfdnhlbskagzgvby8wy6lrxj53zfzpfqimbhga68c0ji2yw1969"))))
+                "03f1862ljdshg7d0rg3j7jzgm3ip55kzd2y91q7p0racax3hxx6i"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -374,28 +421,6 @@ convert JSON documents to BSON and the opposite.  BSON stands for Binary JSON,
 it is comparable to protobuf.")
     (license license:asl2.0)))
 
-(define-public nlohmann-json-cpp
-  (package
-    (name "nlohmann-json-cpp")
-    (version "2.1.1")
-    (source
-     (origin
-      (method url-fetch)
-      (uri (string-append "https://github.com/nlohmann/json/"
-                          "archive/v" version ".tar.gz"))
-      (file-name (string-append name "-" version ".tar.gz"))
-      (sha256
-       (base32
-        "0lrh6cjd643c7kmvmwafbgq7dqj3b778483gjhjbvp6rc6z5xf2r"))))
-    (build-system cmake-build-system)
-    (home-page "https://nlohmann.github.io/json/")
-    (synopsis "JSON library for C++")
-    (description
-     "JSON library for C++ trying to accomplish “Intuitive syntax”,
-“Trivial integration”, and “Serious testing”.
-However, “Memory efficiency” and “Speed” have not been primary goals.")
-    (license license:expat)))
-
 (define-public python-ruamel.yaml
   (package
     (name "python-ruamel.yaml")
@@ -477,14 +502,14 @@ game development and other performance-critical applications.")
 (define-public python-feather-format
   (package
     (name "python-feather-format")
-    (version "0.4.0")
+    (version "0.4.1")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "feather-format" version))
         (sha256
          (base32
-          "1adivm5w5ji4qv7hq7942vqlk8l2wgw87bdlsia771z14z3zp857"))))
+          "00w9hwz7sj3fkdjc378r066vdy6lpxmn6vfac3qx956k8lvpxxj5"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-pandas" ,python-pandas)
@@ -494,6 +519,3 @@ game development and other performance-critical applications.")
     (description "This package provides a Python wrapper library to the
 Apache Arrow-based Feather binary columnar serialization data frame format.")
     (license license:asl2.0)))
-
-(define-public python2-feather-format
-  (package-with-python2 python-feather-format))