Subject: [PATCH v2 08/43] gnu: Add ocaml-stdio.

From: pukkamustard <[email-masked]>
Date: Mon, 10 May 2021 05:15:53 +0000

* gnu/packages/ocaml.scm (ocaml-stdio): New variable.
  (ocaml4.07-stdio): Inherit from ocaml-stdio.
---
 gnu/packages/ocaml.scm | 58 +++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 877b9284d1..95407de74d 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -1978,7 +1978,7 @@ library.")
        #:dune ,ocaml4.07-dune))
     (native-inputs
      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-stdio" ,ocaml4.07-stdio)
+       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("sqlite" ,sqlite)))
@@ -4086,7 +4086,7 @@ syntax checking on dedukti files.")
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
        ("ocaml-compiler-libs" ,ocaml4.07-compiler-libs)
        ("ocaml-sexplib0" ,(package-with-ocaml4.07 ocaml-sexplib0))
-       ("ocaml-stdio" ,ocaml4.07-stdio)
+       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_inline_test")))
     (synopsis "Syntax extension for writing in-line tests in ocaml code")
@@ -4429,7 +4429,7 @@ Atom.")
      `(("gsl" ,gsl)))
     (propagated-inputs
      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-stdio" ,ocaml4.07-stdio)))
+       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))))
     (home-page "https://mmottl.github.io/gsl-ocaml")
     (synopsis "Bindings to the GNU Scientific Library")
     (description
@@ -4714,30 +4714,20 @@ so they don't expose everything at toplevel.  For instance, @code{Ast_helper}
 is now @code{Ocaml_common.Ast_helper}.")
     (license license:expat)))
 
-(define-public ocaml4.07-stdio
+(define-public ocaml-stdio
   (package
-    (name "ocaml4.07-stdio")
-    (version "0.11.0")
+    (name "ocaml-stdio")
+    (version "0.14.0")
     (home-page "https://github.com/janestreet/stdio")
     (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url (string-append home-page ".git"))
-             (commit (string-append "v" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32
-         "1facajqhvq34g2wrg368y0ajxd6lrj5b3lyzyj0jhdmraxajjcwn"))))
+     (janestreet-origin "stdio" version
+                        "1hj5hraprqy2i90a690l11yjszvb99j818q3d684ryx6p2lddk0l"))
     (build-system dune-build-system)
     (propagated-inputs
-     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-sexplib0" ,(package-with-ocaml4.07 ocaml-sexplib0))))
-    (arguments
-     `(#:tests? #f ;no tests
-       #:ocaml ,ocaml-4.07
-       #:findlib ,ocaml4.07-findlib
-       #:dune ,ocaml4.07-dune))
+     `(("ocaml-base" ,ocaml-base)
+       ("ocaml-sexplib0" ,ocaml-sexplib0)))
+    (arguments `(#:tests? #f)) ;no tests
+    (properties `((ocaml4.07-variant . ,(delay ocaml4.07-stdio))))
     (synopsis "Standard IO library for OCaml")
     (description
      "Stdio implements simple input/output functionalities for OCaml.  It
@@ -4745,6 +4735,16 @@ re-exports the input/output functions of the OCaml standard libraries using
 a more consistent API.")
     (license license:expat)))
 
+(define-public ocaml4.07-stdio
+  (package-with-ocaml4.07
+   (package
+     (inherit ocaml-stdio)
+     (version "0.11.0")
+     (source
+      (janestreet-origin "stdio" version
+                         "0pqbp2wy5fgmc38irwvmj9nlcvclb1ix1mp4y7l39bgvvlz303h9"))
+     (properties '()))))
+
 (define-public ocaml-ppx-derivers
   (package
     (name "ocaml-ppx-derivers")
@@ -4794,7 +4794,7 @@ as part of the same ocaml-migrate-parsetree driver.")
        ("ocaml-migrate-parsetree"
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
        ("ocaml-ppx-derivers" ,(package-with-ocaml4.07 ocaml-ppx-derivers))
-       ("ocaml-stdio" ,ocaml4.07-stdio)
+       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
        ("ocaml-result" ,(package-with-ocaml4.07 ocaml-result))
        ("ocaml-sexplib0" ,(package-with-ocaml4.07 ocaml-sexplib0))))
     (arguments
@@ -5422,7 +5422,7 @@ else expression.")
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
       `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-stdio" ,ocaml4.07-stdio)
+        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
         ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_optcomp")))
     (home-page "https://github.com/janestreet/ppx_optcomp")
@@ -5551,7 +5551,7 @@ useful errors on failure.")
         ("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
         ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
         ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
-        ("ocaml-stdio" ,ocaml4.07-stdio)
+        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
         ("ocaml-migrate-parsetree"
          ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
         ("ocaml-ppxlib" ,ocaml4.07-ppxlib)
@@ -5827,7 +5827,7 @@ various Jane Street packages.")
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
       `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-stdio" ,ocaml4.07-stdio)))
+        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))))
     (home-page "https://github.com/janestreet/configurator")
     (synopsis "Helper library for gathering system configuration")
     (description "Configurator is a small library that helps writing OCaml
@@ -5920,7 +5920,7 @@ thousands of times faster than fork.
         ("ocaml-ppx-jane" ,ocaml4.07-ppx-jane)
         ("ocaml-sexplib" ,(package-with-ocaml4.07 ocaml-sexplib))
         ("ocaml-spawn" ,ocaml4.07-spawn)
-        ("ocaml-stdio" ,ocaml4.07-stdio)
+        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
         ("ocaml-migrate-parsetree"
          ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
         ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
@@ -5967,7 +5967,7 @@ standard library that was developed by Jane Street.")
         ("ocaml-ppx-sexp-message" ,ocaml4.07-ppx-sexp-message)
         ("ocaml-sexplib" ,(package-with-ocaml4.07 ocaml-sexplib))
         ("ocaml-splittable-random" ,ocaml4.07-splittable-random)
-        ("ocaml-stdio" ,ocaml4.07-stdio)
+        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
         ("ocaml-typerep" ,ocaml4.07-typerep)
         ("ocaml-variantslib" ,ocaml4.07-variantslib)
         ("ocaml-migrate-parsetree"
@@ -6251,7 +6251,7 @@ library FFTW.")
      `(("openblas" ,openblas)
        ("lapack" ,lapack)
        ("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-stdio" ,ocaml4.07-stdio)))
+       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))))
     (home-page "https://mmottl.github.io/lacaml/")
     (synopsis
      "OCaml-bindings to BLAS and LAPACK")
-- 
2.31.1