summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/ocaml.scm34
-rw-r--r--gnu/packages/patches/ocaml-piqilib-Update-base64.patch46
3 files changed, 61 insertions, 20 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 1b0298ec6f..fb97fe7bee 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1114,6 +1114,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ocaml-dose3-Fix-for-ocaml-4.06.patch	\
   %D%/packages/patches/ocaml-dose3-dont-make-printconf.patch	\
   %D%/packages/patches/ocaml-dose3-Install-mli-cmx-etc.patch	\
+  %D%/packages/patches/ocaml-piqilib-Update-base64.patch	\
   %D%/packages/patches/omake-fix-non-determinism.patch	\
   %D%/packages/patches/ola-readdir-r.patch			\
   %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch	\
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index ca7c3455fb..d4df52edc6 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2170,29 +2170,21 @@ multitude of other network protocols (FTP/SMTP/RTSP/etc).")
 (define-public ocaml-base64
   (package
     (name "ocaml-base64")
-    (version "2.1.2")
+    (version "3.2.0")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/mirage/ocaml-base64/"
-                                  "releases/download/v" version "/base64-"
-                                   version ".tbz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/mirage/ocaml-base64")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                 "1p45sawchmrkr22gkmydjc4ary23pisp58zsnb7iq7d82nxs1lfq"))))
-    (build-system ocaml-build-system)
-    (arguments
-     `(#:build-flags (list "build" "--tests" "true")
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure))))
+                 "1ilw3zj0w6cq7i4pvr8m2kv5l5f2y9aldmv72drlwwns013b1gwy"))))
+    (build-system dune-build-system)
     (native-inputs
-     `(("topkg" ,ocaml-topkg)
-       ("ocamlbuild" ,ocamlbuild)
-       ("opam" ,opam)
-       ("rresult" ,ocaml-rresult)
-       ("bos" ,ocaml-bos)
-       ("alcotest" ,ocaml-alcotest)))
+     `(("ocaml-alcotest" ,ocaml-alcotest)
+       ("ocaml-bos" ,ocaml-bos)
+       ("ocaml-rresult" ,ocaml-rresult)))
     (home-page "https://github.com/mirage/ocaml-base64")
     (synopsis "Base64 encoding for OCaml")
     (description "Base64 is a group of similar binary-to-text encoding schemes
@@ -2732,7 +2724,9 @@ Format module of the OCaml standard library.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0lyqllmfsxmwlg7qidy92kvxi9n39lvachmydcyi81f8p07ykd2d"))))
+        (base32 "0lyqllmfsxmwlg7qidy92kvxi9n39lvachmydcyi81f8p07ykd2d"))
+       (patches
+         (search-patches "ocaml-piqilib-Update-base64.patch"))))
     (build-system ocaml-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/ocaml-piqilib-Update-base64.patch b/gnu/packages/patches/ocaml-piqilib-Update-base64.patch
new file mode 100644
index 0000000000..ec2c02d93e
--- /dev/null
+++ b/gnu/packages/patches/ocaml-piqilib-Update-base64.patch
@@ -0,0 +1,46 @@
+From 98abdbff3d5316a75f27d6a76fe09317d56f2a38 Mon Sep 17 00:00:00 2001
+From: Vincent Bernardoff <vb@luminar.eu.org>
+Date: Sun, 10 Feb 2019 14:47:07 +0100
+Subject: [PATCH] Fix compilation with newer base64 versions
+
+---
+ opam                   | 2 +-
+ piqilib/piqi_base64.ml | 9 ++++-----
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/opam b/opam
+index 3a9128e..bb5a53f 100644
+--- a/opam
++++ b/opam
+@@ -26,6 +26,6 @@ depends: [
+   "easy-format"
+   "ulex"
+   "xmlm"
+-  "base64" {>="2.0.0"}
++  "base64" {>="3.1.0"}
+ ]
+ dev-repo: "git://github.com/alavrik/piqi"
+diff --git a/piqilib/piqi_base64.ml b/piqilib/piqi_base64.ml
+index c5a6ae7..a98346e 100644
+--- a/piqilib/piqi_base64.ml
++++ b/piqilib/piqi_base64.ml
+@@ -18,12 +18,11 @@
+ (* TODO: add more base64 validation; the base64 library doesn't do any
+  * validation *)
+ let decode x =
+-  try
+-    B64.decode x
+-  with _ ->
+-    invalid_arg "Piqi_base64.decode"
++  match Base64.decode x with
++  | Error _ -> invalid_arg "Piqi_base64.decode"
++  | Ok v -> v
+ 
+ 
+ let encode x =
+-  B64.encode x
++  Base64.encode_exn x
+ 
+-- 
+2.21.0
+