Subject: [PATCH] Add js_of_ocaml

From: divoplade <[email-masked]>
Date: Wed, 30 Dec 2020 20:22:57 +0100

Dear guix,

I finally got js_of_ocaml packaged. I'm not sure I did everything
correctly (especially indentation, but also how to make non-4.07
packages, and whether the package should have multiple outputs
corresponding to the opam packages), so do not hesitate to sendfeedback. 

Best regards,

divoplade

From 0a753eb2d96b2deb7059bce0be6846f6623a85e4 Mon Sep 17 00:00:00 2001
From: divoplade <[email-masked]>
Date: Wed, 30 Dec 2020 18:45:28 +0100
Subject: [PATCH 1/5] gnu: Add ocaml-compiler-libs

* gnu/packages/ocaml.scm (ocaml-compiler-libs): New variable.
(ocaml4.07-compiler-libs): Inherit from ocaml-compiler-libs.
---
 gnu/packages/ocaml.scm | 45 +++++++++++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2df16e7cd2..4b1ed09a79 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -3683,7 +3683,7 @@ syntax checking on dedukti files.")
      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
        ("ocaml-migrate-parsetree"
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-       ("ocaml-compiler-libs" ,ocaml4.07-compiler-libs)
+       ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-compiler-libs))
        ("ocaml-sexplib0" ,(package-with-ocaml4.07 ocaml-sexplib0))
        ("ocaml-stdio" ,ocaml4.07-stdio)
        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
@@ -4285,10 +4285,10 @@ provided by companion libraries such as
         #:dune ,ocaml4.07-dune))
      (properties '()))))
 
-(define-public ocaml4.07-compiler-libs
+(define-public ocaml-compiler-libs
   (package
-    (name "ocaml4.07-compiler-libs")
-    (version "0.11.0")
+    (name "ocaml-compiler-libs")
+    (version "0.12.3")
     (home-page "https://github.com/janestreet/ocaml-compiler-libs")
     (source
      (origin
@@ -4299,20 +4299,41 @@ provided by companion libraries such as
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "03jds7bszh8wwpfwxb3dg0gyr1j1872wxwx1xqhry5ir0i84bg0s"))))
+         "00nrar7h2pyflbdiq6wwwrb4k5jh9iff0jllihzm6ms8d5pspsg5"))))
     (build-system dune-build-system)
-    (arguments
-     `(#:tests? #f ;no tests
-       #:ocaml ,ocaml-4.07
-       #:findlib ,ocaml4.07-findlib
-       #:dune ,ocaml4.07-dune))
-    (properties `((upstream-name . "ocaml-compiler-libs")))
+    (arguments `(#:tests? #f))
+    (properties `((upstream-name . "ocaml-compiler-libs")
+		  (ocaml4.07-variant . ,(delay ocaml4.07-compiler-libs))))
     (synopsis "Compiler libraries repackaged")
     (description "This package simply repackages the OCaml compiler libraries
 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-compiler-libs
+  (package-with-ocaml4.07
+   (package
+     (inherit ocaml-compiler-libs)
+     (name "ocaml4.07-compiler-libs")
+     (version "0.11.0")
+     (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url (string-append (package-home-page ocaml-compiler-libs)
+                                  ".git"))
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "03jds7bszh8wwpfwxb3dg0gyr1j1872wxwx1xqhry5ir0i84bg0s"))))
+     (arguments
+      `(#:tests? #f ;no tests
+        #:ocaml ,ocaml-4.07
+        #:findlib ,ocaml4.07-findlib
+        #:dune ,ocaml4.07-dune))
+     (properties '()))))
+
 (define-public ocaml4.07-stdio
   (package
     (name "ocaml4.07-stdio")
@@ -4389,7 +4410,7 @@ as part of the same ocaml-migrate-parsetree driver.")
     (build-system dune-build-system)
     (propagated-inputs
      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-compiler-libs" ,ocaml4.07-compiler-libs)
+       ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-compiler-libs))
        ("ocaml-migrate-parsetree"
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
        ("ocaml-ppx-derivers" ,(package-with-ocaml4.07 ocaml-ppx-derivers))
-- 
2.29.2

From 042ecb06d915acd7e97373122772bf9458ed82f1 Mon Sep 17 00:00:00 2001
From: divoplade <[email-masked]>
Date: Wed, 30 Dec 2020 18:56:09 +0100
Subject: [PATCH 2/5] gnu: Add ocaml-stdio

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

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 4b1ed09a79..9e19772997 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -1636,7 +1636,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)))
@@ -3685,7 +3685,7 @@ syntax checking on dedukti files.")
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
        ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-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")
@@ -4028,7 +4028,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
@@ -4334,37 +4334,44 @@ is now @code{Ocaml_common.Ast_helper}.")
         #:dune ,ocaml4.07-dune))
      (properties '()))))
 
-(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))
-    (synopsis "Standard IO library for OCaml")
+     `(("ocaml-base" ,ocaml-base)
+       ("ocaml-sexplib0" ,ocaml-sexplib0)))
+    (arguments `(#:tests? #f))
+    (properties `((ocaml4.07-variant . ,(delay ocaml4.07-stdio))))
+    (synopsis
+     "Standard IO library for OCaml")
     (description
      "Stdio implements simple input/output functionalities for OCaml.  It
 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)
+     (name "ocaml4.07-stdio")
+     (version "0.11.0")
+     (source
+      (janestreet-origin "stdio" version
+                         "1facajqhvq34g2wrg368y0ajxd6lrj5b3lyzyj0jhdmraxajjcwn"))
+     (arguments
+      `(#:tests? #f ;no tests
+        #:ocaml ,ocaml-4.07
+        #:findlib ,ocaml4.07-findlib
+        #:dune ,ocaml4.07-dune))
+     (properties '()))))
+
 (define-public ocaml-ppx-derivers
   (package
     (name "ocaml-ppx-derivers")
@@ -4414,7 +4421,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
@@ -5041,9 +5048,9 @@ else expression.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-stdio" ,ocaml4.07-stdio)
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("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")
     (synopsis "Optional compilation for OCaml")
@@ -5162,20 +5169,20 @@ useful errors on failure.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
-        ("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
-        ("ocaml-ppx-custom-printf" ,ocaml4.07-ppx-custom-printf)
-        ("ocaml-ppx-fields-conv" ,ocaml4.07-ppx-fields-conv)
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("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-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)
-        ("ocaml-re" ,(package-with-ocaml4.07 ocaml-re))))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
+       ("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
+       ("ocaml-ppx-custom-printf" ,ocaml4.07-ppx-custom-printf)
+       ("ocaml-ppx-fields-conv" ,ocaml4.07-ppx-fields-conv)
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("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" ,(package-with-ocaml4.07 ocaml-stdio))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,ocaml4.07-ppxlib)
+       ("ocaml-re" ,(package-with-ocaml4.07 ocaml-re))))
     (properties `((upstream-name . "ppx_expect")))
     (home-page "https://github.com/janestreet/ppx_expect")
     (synopsis "Cram like framework for OCaml")
@@ -5446,8 +5453,8 @@ various Jane Street packages.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-stdio" ,ocaml4.07-stdio)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("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
@@ -5533,17 +5540,17 @@ thousands of times faster than fork.
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-configurator" ,ocaml4.07-configurator)
-        ("ocaml-core-kernel" ,ocaml4.07-core-kernel)
-        ("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
-        ("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-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-configurator" ,ocaml4.07-configurator)
+       ("ocaml-core-kernel" ,ocaml4.07-core-kernel)
+       ("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
+       ("ocaml-ppx-jane" ,ocaml4.07-ppx-jane)
+       ("ocaml-sexplib" ,(package-with-ocaml4.07 ocaml-sexplib))
+       ("ocaml-spawn" ,ocaml4.07-spawn)
+       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (home-page "https://github.com/janestreet/core")
     (synopsis "Alternative to OCaml's standard library")
     (description "The Core suite of libraries is an alternative to OCaml's
@@ -5573,25 +5580,25 @@ standard library that was developed by Jane Street.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-bin-prot" ,ocaml4.07-bin-prot)
-        ("ocaml-configurator" ,ocaml4.07-configurator)
-        ("ocaml-fieldslib" ,ocaml4.07-fieldslib)
-        ("ocaml-jane-street-headers" ,ocaml4.07-jane-street-headers)
-        ("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
-        ("ocaml-ppx-base" ,ocaml4.07-ppx-base)
-        ("ocaml-ppx-hash" ,ocaml4.07-ppx-hash)
-        ("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
-        ("ocaml-ppx-jane" ,ocaml4.07-ppx-jane)
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("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-typerep" ,ocaml4.07-typerep)
-        ("ocaml-variantslib" ,ocaml4.07-variantslib)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-bin-prot" ,ocaml4.07-bin-prot)
+       ("ocaml-configurator" ,ocaml4.07-configurator)
+       ("ocaml-fieldslib" ,ocaml4.07-fieldslib)
+       ("ocaml-jane-street-headers" ,ocaml4.07-jane-street-headers)
+       ("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
+       ("ocaml-ppx-base" ,ocaml4.07-ppx-base)
+       ("ocaml-ppx-hash" ,ocaml4.07-ppx-hash)
+       ("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
+       ("ocaml-ppx-jane" ,ocaml4.07-ppx-jane)
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("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" ,(package-with-ocaml4.07 ocaml-stdio))
+       ("ocaml-typerep" ,ocaml4.07-typerep)
+       ("ocaml-variantslib" ,ocaml4.07-variantslib)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))))
     (properties `((upstream-name . "core_kernel")))
     (home-page "https://github.com/janestreet/core_kernel")
     (synopsis "Portable standard library for OCaml")
@@ -5873,7 +5880,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.29.2

From c08d0dc308c5dd429212c171b824135577e570ed Mon Sep 17 00:00:00 2001
From: divoplade <[email-masked]>
Date: Wed, 30 Dec 2020 19:05:34 +0100
Subject: [PATCH 3/5] gnu: add ocaml-ppxlib

* gnu/packages/ocaml.scm (ocaml-ppxlib): New variable.
(ocaml4.07-ppxlib): Inherit from ocaml-ppxlib.
---
 gnu/packages/ocaml.scm | 356 ++++++++++++++++++++++++-----------------
 1 file changed, 207 insertions(+), 149 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 9e19772997..828dd6ff73 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -3686,7 +3686,7 @@ syntax checking on dedukti files.")
        ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-compiler-libs))
        ("ocaml-sexplib0" ,(package-with-ocaml4.07 ocaml-sexplib0))
        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
-       ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_inline_test")))
     (synopsis "Syntax extension for writing in-line tests in ocaml code")
     (description "This package contains a syntax extension for writing
@@ -4399,10 +4399,12 @@ ppx_deriving and ppx_type_conv to inter-operate gracefully when linked
 as part of the same ocaml-migrate-parsetree driver.")
     (license license:bsd-3)))
 
-(define-public ocaml4.07-ppxlib
+(define-public ocaml-ppxlib
+  ;; Future versions are not compatible with ocaml-migrate-parsetree
+  ;; 1.7.3
   (package
-    (name "ocaml4.07-ppxlib")
-    (version "0.6.0")
+    (name "ocaml-ppxlib")
+    (version "0.15.0")
     (home-page "https://github.com/ocaml-ppx/ppxlib")
     (source
      (origin
@@ -4413,20 +4415,28 @@ as part of the same ocaml-migrate-parsetree driver.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0my9x7sxb329h0lzshppdaawiyfbaw6g5f41yiy7bhl071rnlvbv"))))
+         "1p037kqj5858xrhh0dps6vbf4fnijla6z9fjz5zigvnqp4i2xkrn"))))
     (build-system dune-build-system)
     (propagated-inputs
-     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-       ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-compiler-libs))
-       ("ocaml-migrate-parsetree"
-        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-       ("ocaml-ppx-derivers" ,(package-with-ocaml4.07 ocaml-ppx-derivers))
-       ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
-       ("ocaml-result" ,(package-with-ocaml4.07 ocaml-result))
-       ("ocaml-sexplib0" ,(package-with-ocaml4.07 ocaml-sexplib0))))
+     `(("ocaml-ppx-derivers" ,ocaml-ppx-derivers)
+       ("ocaml-compiler-libs" ,ocaml-compiler-libs)
+       ("ocaml-stdlib-shims" ,ocaml-stdlib-shims)
+       ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
+       ("ocaml-sexplib0" ,ocaml-sexplib0)))
+    (native-inputs
+     `(("ocaml-base" ,ocaml-base)
+       ("ocaml-stdio" ,ocaml-stdio)))
+    (properties `((ocaml4.07-variant . ,(delay ocaml4.07-ppxlib))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-before 'build 'fix-deprecated
+           (lambda _
+	     ;; Silence a deprecation warning
+	     (substitute* "src/gen/dune"
+			  (("-safe-string")
+			   "-safe-string -w -3"))
+	     #t))
          (add-before 'check 'set-topfind
            (lambda* (#:key inputs #:allow-other-keys)
              ;; add the line #directory ".." at the top of each file
@@ -4443,10 +4453,7 @@ as part of the same ocaml-migrate-parsetree driver.")
                  (("#use \"topfind\";;" all)
                   (string-append "#directory \"" findlib-libdir "\"\n"
                                  all))))
-             #t)))
-       #:ocaml ,ocaml-4.07
-       #:findlib ,ocaml4.07-findlib
-       #:dune ,ocaml4.07-dune))
+             #t)))))
     (synopsis
      "Base library and tools for ppx rewriters")
     (description
@@ -4464,6 +4471,57 @@ OCaml AST in the OCaml syntax;
 @end itemize")
     (license license:expat)))
 
+(define-public ocaml4.07-ppxlib
+  (package-with-ocaml4.07
+   (package
+     (inherit ocaml-ppxlib)
+     (name "ocaml4.07-ppxlib")
+     (version "0.6.0")
+     (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url (string-append (package-home-page ocaml-ppxlib)
+                                  ".git"))
+              (commit version)))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "0my9x7sxb329h0lzshppdaawiyfbaw6g5f41yiy7bhl071rnlvbv"))))
+     (propagated-inputs
+      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+        ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-compiler-libs))
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppx-derivers" ,(package-with-ocaml4.07 ocaml-ppx-derivers))
+        ("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
+      `(#:phases
+        (modify-phases %standard-phases
+          (add-before 'check 'set-topfind
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; add the line #directory ".." at the top of each file
+              ;; using #use "topfind";; to be able to find topfind
+              (let* ((findlib-path (assoc-ref inputs "findlib"))
+                     (findlib-libdir
+                      (string-append findlib-path "/lib/ocaml/site-lib")))
+                (substitute* '("test/base/test.ml"
+                               "test/code_path/test.ml"
+                               "test/deriving/test.ml"
+                               "test/driver/attributes/test.ml"
+                               "test/driver/non-compressible-suffix/test.ml"
+                               "test/driver/transformations/test.ml")
+                  (("#use \"topfind\";;" all)
+                   (string-append "#directory \"" findlib-libdir "\"\n"
+                                  all))))
+              #t)))
+        #:ocaml ,ocaml-4.07
+        #:findlib ,ocaml4.07-findlib
+        #:dune ,ocaml4.07-dune))
+    (properties '()))))
+
 (define-public ocaml4.07-ppx-compare
   (package
     (name "ocaml4.07-ppx-compare")
@@ -4479,10 +4537,10 @@ OCaml AST in the OCaml syntax;
                 "06bq4m1bsm4jlx4g7wh5m99qky7xm4c2g52kaz6pv25hdn5agi2m"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (arguments
      `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
@@ -4518,10 +4576,10 @@ by making sure that you only compare comparable values.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "fieldslib")))
     (home-page "https://github.com/janestreet/fieldslib")
     (synopsis "Syntax extension to record fields")
@@ -4550,10 +4608,10 @@ of a record and create new record values.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "variantslib")))
     (home-page "https://github.com/janestreet/variantslib")
     (synopsis "OCaml variants as first class values")
@@ -4575,11 +4633,11 @@ standard library.")
                 "07zrd3qky2ppbfl55gpm90rvqa5860xgwcsvihrjmkrw6d0jirkc"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-fieldslib" ,ocaml4.07-fieldslib)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-fieldslib" ,ocaml4.07-fieldslib)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (arguments
      `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
@@ -4608,10 +4666,10 @@ new record values.")
                 "0pqwnqy1xp309wvdcaax4lg02yk64lq2w03mbgfvf6ps5ry4gis9"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (arguments
      `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
@@ -4638,11 +4696,11 @@ definitions.")
                 "1yc0gsds5m2nv39zga8nnrca2n75rkqy5dz4xj1635ybz20hhbjd"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-variantslib" ,ocaml4.07-variantslib)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-variantslib" ,ocaml4.07-variantslib)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (arguments
      `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
@@ -4671,11 +4729,11 @@ variant types.")
                 "11b73smf3g3bpd9lg014pr4rx285nk9mnk6g6464ph51jv0sqzhj"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (arguments
      `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
@@ -4770,12 +4828,12 @@ storage of large amounts of data.")
                 "1p0ic6aijxlrdggpmycj12q3cy9xksbq2vq727215maz4snvlf5p"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (arguments
      `(#:ocaml ,ocaml-4.07
        #:findlib ,ocaml4.07-findlib
@@ -4807,10 +4865,10 @@ hash functions from type exrpessions and definitions.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_enumerate")))
     (home-page "https://github.com/janestreet/ppx_enumerate")
     (synopsis "Generate a list containing all values of a finite type")
@@ -4839,10 +4897,10 @@ many values).")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_bench")))
     (home-page "https://github.com/janestreet/ppx_bench")
     (synopsis "Syntax extension for writing in-line benchmarks in ocaml code")
@@ -4869,10 +4927,10 @@ many values).")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_here")))
     (home-page "https://github.com/janestreet/ppx_here")
     (synopsis "Expands [%here] into its location")
@@ -4922,12 +4980,12 @@ many values).")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_sexp_value")))
     (home-page "https://github.com/janestreet/ppx_sexp_value")
     (synopsis "Simplify building s-expressions from ocaml values")
@@ -4953,12 +5011,12 @@ ocaml values.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_sexp_message")))
     (home-page "https://github.com/janestreet/ppx_sexp_message")
     (synopsis "A ppx rewriter for easy construction of s-expressions")
@@ -4988,9 +5046,9 @@ context such as function arguments.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_pipebang")))
     (home-page "https://github.com/janestreet/ppx_pipebang")
     (synopsis "Inline reverse application operators `|>` and `|!`")
@@ -5018,10 +5076,10 @@ context such as function arguments.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_optional")))
     (home-page "https://github.com/janestreet/ppx_optional")
     (synopsis "Pattern matching on flat options")
@@ -5050,7 +5108,7 @@ else expression.")
     (propagated-inputs
      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
-       ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_optcomp")))
     (home-page "https://github.com/janestreet/ppx_optcomp")
     (synopsis "Optional compilation for OCaml")
@@ -5077,10 +5135,10 @@ size, the version of the compiler, ...")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_let")))
     (home-page "https://github.com/janestreet/ppx_let")
     (synopsis "Monadic let-bindings")
@@ -5106,11 +5164,11 @@ match expressions, and if expressions.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_fail")))
     (home-page "https://github.com/janestreet/ppx_fail")
     (synopsis "Add location to calls to failwiths")
@@ -5136,13 +5194,13 @@ position.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_assert")))
     (home-page "https://github.com/janestreet/ppx_assert")
     (synopsis "Assert-like extension nodes that raise useful errors on failure")
@@ -5181,7 +5239,7 @@ useful errors on failure.")
        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
        ("ocaml-migrate-parsetree"
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-       ("ocaml-ppxlib" ,ocaml4.07-ppxlib)
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))
        ("ocaml-re" ,(package-with-ocaml4.07 ocaml-re))))
     (properties `((upstream-name . "ppx_expect")))
     (home-page "https://github.com/janestreet/ppx_expect")
@@ -5213,11 +5271,11 @@ to denote the expected output.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-octavius" ,(package-with-ocaml4.07 ocaml-octavius))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-octavius" ,(package-with-ocaml4.07 ocaml-octavius))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_js_style")))
     (home-page "https://github.com/janestreet/ppx_js_style")
     (synopsis "Code style checker for Jane Street Packages")
@@ -5246,11 +5304,11 @@ packages.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-typerep" ,ocaml4.07-typerep)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-typerep" ,ocaml4.07-typerep)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_typerep_conv")))
     (home-page "https://github.com/janestreet/ppx_typerep_conv")
     (synopsis "Generation of runtime types from type declarations")
@@ -5277,14 +5335,14 @@ from type definitions.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
-        ("ocaml-ppx-enumerate" ,ocaml4.07-ppx-enumerate)
-        ("ocaml-ppx-hash" ,ocaml4.07-ppx-hash)
-        ("ocaml-ppx-js-style" ,ocaml4.07-ppx-js-style)
-        ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-ppx-compare" ,ocaml4.07-ppx-compare)
+       ("ocaml-ppx-enumerate" ,ocaml4.07-ppx-enumerate)
+       ("ocaml-ppx-hash" ,ocaml4.07-ppx-hash)
+       ("ocaml-ppx-js-style" ,ocaml4.07-ppx-js-style)
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_base")))
     (home-page "https://github.com/janestreet/ppx_base")
     (synopsis "Base set of ppx rewriters")
@@ -5315,12 +5373,12 @@ verification tool.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
-        ("ocaml-bin-prot" ,ocaml4.07-bin-prot)
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-base" ,(package-with-ocaml4.07 ocaml-base))
+       ("ocaml-bin-prot" ,ocaml4.07-bin-prot)
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_bin_prot")))
     (home-page "https://github.com/janestreet/ppx_bin_prot")
     (synopsis "Generation of bin_prot readers and writers from types")
@@ -5347,27 +5405,27 @@ functions from type definitions.")
        #:findlib ,ocaml4.07-findlib
        #:dune ,ocaml4.07-dune))
     (propagated-inputs
-      `(("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
-        ("ocaml-ppx-base" ,ocaml4.07-ppx-base)
-        ("ocaml-ppx-bench" ,ocaml4.07-ppx-bench)
-        ("ocaml-ppx-bin-prot" ,ocaml4.07-ppx-bin-prot)
-        ("ocaml-ppx-custom-printf" ,ocaml4.07-ppx-custom-printf)
-        ("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)
-        ("ocaml-ppx-fail" ,ocaml4.07-ppx-fail)
-        ("ocaml-ppx-fields-conv" ,ocaml4.07-ppx-fields-conv)
-        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
-        ("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
-        ("ocaml-ppx-let" ,ocaml4.07-ppx-let)
-        ("ocaml-ppx-optcomp" ,ocaml4.07-ppx-optcomp)
-        ("ocaml-ppx-optional" ,ocaml4.07-ppx-optional)
-        ("ocaml-ppx-pipebang" ,ocaml4.07-ppx-pipebang)
-        ("ocaml-ppx-sexp-message" ,ocaml4.07-ppx-sexp-message)
-        ("ocaml-ppx-sexp-value" ,ocaml4.07-ppx-sexp-value)
-        ("ocaml-ppx-typerep-conv" ,ocaml4.07-ppx-typerep-conv)
-        ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
-        ("ocaml-migrate-parsetree"
-         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+     `(("ocaml-ppx-assert" ,ocaml4.07-ppx-assert)
+       ("ocaml-ppx-base" ,ocaml4.07-ppx-base)
+       ("ocaml-ppx-bench" ,ocaml4.07-ppx-bench)
+       ("ocaml-ppx-bin-prot" ,ocaml4.07-ppx-bin-prot)
+       ("ocaml-ppx-custom-printf" ,ocaml4.07-ppx-custom-printf)
+       ("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)
+       ("ocaml-ppx-fail" ,ocaml4.07-ppx-fail)
+       ("ocaml-ppx-fields-conv" ,ocaml4.07-ppx-fields-conv)
+       ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+       ("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
+       ("ocaml-ppx-let" ,ocaml4.07-ppx-let)
+       ("ocaml-ppx-optcomp" ,ocaml4.07-ppx-optcomp)
+       ("ocaml-ppx-optional" ,ocaml4.07-ppx-optional)
+       ("ocaml-ppx-pipebang" ,ocaml4.07-ppx-pipebang)
+       ("ocaml-ppx-sexp-message" ,ocaml4.07-ppx-sexp-message)
+       ("ocaml-ppx-sexp-value" ,ocaml4.07-ppx-sexp-value)
+       ("ocaml-ppx-typerep-conv" ,ocaml4.07-ppx-typerep-conv)
+       ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (properties `((upstream-name . "ppx_jane")))
     (home-page "https://github.com/janestreet/ppx_jane")
     (synopsis "Standard Jane Street ppx rewriters")
@@ -5550,7 +5608,7 @@ thousands of times faster than fork.
        ("ocaml-stdio" ,(package-with-ocaml4.07 ocaml-stdio))
        ("ocaml-migrate-parsetree"
         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
-       ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+       ("ocaml-ppxlib" ,(package-with-ocaml4.07 ocaml-ppxlib))))
     (home-page "https://github.com/janestreet/core")
     (synopsis "Alternative to OCaml's standard library")
     (description "The Core suite of libraries is an alternative to OCaml's
-- 
2.29.2

From c53824f13472d91cd7087e965976876725164e66 Mon Sep 17 00:00:00 2001
From: divoplade <[email-masked]>
Date: Wed, 30 Dec 2020 19:06:57 +0100
Subject: [PATCH 4/5] gnu: Add ocaml-graphics

---
 gnu/packages/ocaml.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 828dd6ff73..353394e4d4 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -6148,3 +6148,32 @@ provides support to program with time varying values: declarative events and
  signals.  React doesn't define any primitive event or signal, it lets the
 client chooses the concrete timeline.")
     (license license:lgpl2.1+)))
+
+(define-public ocaml-graphics
+  (package
+    (name "ocaml-graphics")
+    (version "5.1.0")
+    (home-page "https://github.com/ocaml/graphics")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url (string-append home-page ".git"))
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1ilw5r1lpy88fpfcpifxxbdg74f468jb5xhimw92iwmr410gnqp2"))))
+    (build-system dune-build-system)
+    (propagated-inputs
+     `(("dune-configurator" ,dune-configurator)
+       ("libx11" ,libx11)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "The OCaml graphics library")
+    (description
+     "The graphics library provides a set of portable drawing
+primitives. Drawing takes place in a separate window that is created
+when Graphics.open_graph is called.
+
+This library used to be distributed with OCaml up to OCaml 4.08.")
+    (license license:lgpl2.1+)))
-- 
2.29.2

From 151ffb96657268adf40103d8c4aac04f4d3a61fb Mon Sep 17 00:00:00 2001
From: divoplade <[email-masked]>
Date: Wed, 30 Dec 2020 19:08:57 +0100
Subject: [PATCH 5/5] gnu: Add ocaml-js-of-ocaml

---
 gnu/packages/ocaml.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 353394e4d4..ce1d09f936 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -6177,3 +6177,41 @@ when Graphics.open_graph is called.
 
 This library used to be distributed with OCaml up to OCaml 4.08.")
     (license license:lgpl2.1+)))
+
+(define-public ocaml-js-of-ocaml
+  (package
+    (name "ocaml-js-of-ocaml")
+    (version "3.8.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ocsigen/js_of_ocaml")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1ls3nhavhifsfwwz45k4xw91ml9zi6rnkfp3175b2havbavbzral"))))
+    (build-system dune-build-system)
+    (arguments `(#:tests? #f))
+    (propagated-inputs
+     `(("ocaml-ppxlib" ,ocaml-ppxlib)
+       ("ocaml-uchar" ,ocaml-uchar)
+       ("ocaml-menhir" ,ocaml-menhir)
+       ("ocaml-reactivedata" ,ocaml-reactivedata)
+       ("ocaml-cmdliner" ,ocaml-cmdliner)
+       ("ocaml-lwt" ,ocaml-lwt)
+       ("ocaml-tyxml" ,ocaml-tyxml)
+       ("ocaml-re" ,ocaml-re)
+       ("ocaml-uutf" ,ocaml-uutf)
+       ("ocaml-graphics" ,ocaml-graphics)))
+    (properties `((upstream-name . "js_of_ocaml")))
+    (home-page
+     "http://ocsigen.github.io/js_of_ocaml")
+    (synopsis
+     "Compiler from OCaml bytecode to Javascript")
+    (description
+     "Js_of_ocaml is a compiler from OCaml bytecode to JavaScript.
+It makes it possible to run pure OCaml programs in JavaScript
+environment like browsers and Node.js
+")
+    (license license:lgpl2.1+)))
-- 
2.29.2