gnu: Add datafly.
[jackhill/guix/guix.git] / gnu / packages / ocaml.scm
index 0fc4a24..33c3fa0 100644 (file)
@@ -5,15 +5,16 @@
 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016-2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
-;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Peter Kreye <kreyepr@gmail.com>
 ;;; Copyright © 2018, 2019 Gabriel Hondet <gabrielhondet@gmail.com>
 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
+;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages rsync)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
-  #:use-module (gnu packages version-control)
   #:use-module (gnu packages virtualization)
   #:use-module (gnu packages web-browsers)
   #:use-module (gnu packages xml)
@@ -228,45 +229,36 @@ functional, imperative and object-oriented styles of programming.")
                           "--prefix" out
                           "--mandir" mandir))))))))))
 
-(define-public ocaml ocaml-4.07)
+(define-public ocaml ocaml-4.09)
 
 (define-public ocamlbuild
   (package
     (name "ocamlbuild")
-    (version "0.13.1")
+    (version "0.14.0")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocaml/ocamlbuild.git")
+             (url "https://github.com/ocaml/ocamlbuild")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0v37vjvdqw35yvj8ipmlzmwf1jhip0hbsmcbdcn9cnj12p3mr6k7"))))
-    (build-system gnu-build-system)
+        (base32 "1hb5mcdz4wv7sh1pj7dq9q4fgz5h3zg7frpiya6s8zd3ypwzq0kh"))))
+    (build-system ocaml-build-system)
     (arguments
-     `(#:test-target "test"
-       #:tests? #f; tests require findlib
-       #:make-flags
+     `(#:make-flags
        (list (string-append "OCAMLBUILD_PREFIX=" (assoc-ref %outputs "out"))
              (string-append "OCAMLBUILD_BINDIR=" (assoc-ref %outputs "out")
-                        "/bin")
+                            "/bin")
              (string-append "OCAMLBUILD_LIBDIR=" (assoc-ref %outputs "out")
-                        "/lib/ocaml/site-lib")
+                            "/lib/ocaml/site-lib")
              (string-append "OCAMLBUILD_MANDIR=" (assoc-ref %outputs "out")
-                        "/share/man"))
+                            "/share/man"))
        #:phases
        (modify-phases %standard-phases
-         (delete 'bootstrap)
-         (delete 'configure)
-         (add-before 'build 'findlib-environment
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out")))
-               (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
-               (setenv "OCAMLFIND_LDCONF" "ignore")
-               #t))))))
-    (native-inputs
-     `(("ocaml" ,ocaml)))
+         (delete 'configure))
+       ; some failures because of changes in OCaml's error message formating
+       #:tests? #f))
     (home-page "https://github.com/ocaml/ocamlbuild")
     (synopsis "OCaml build tool")
     (description "OCamlbuild is a generic build tool, that has built-in rules
@@ -276,14 +268,14 @@ for building OCaml library and programs.")
 (define-public ocaml-extlib
   (package
     (name "ocaml-extlib")
-    (version "1.7.6")
+    (version "1.7.7")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://ygrek.org.ua/p/release/ocaml-extlib/"
+              (uri (string-append "https://ygrek.org/p/release/ocaml-extlib/"
                                   "extlib-" version ".tar.gz"))
               (sha256
                (base32
-                "0wfs20v1yj5apdbj7214wdsr17ayh0qqq7ihidndvc8nmmwfa1dz"))))
+                "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1"))))
     (build-system ocaml-build-system)
     (arguments
      `(#:phases
@@ -349,7 +341,7 @@ Software distribution.")
                 "1i0hhkrqi7rqlainlg5pc4hibbx6b5dp3x99gmav8c3sbfvlk9mc"))))
     (build-system dune-build-system)
     (propagated-inputs `(("ocaml-cudf" ,ocaml-cudf)))
-    (home-page "http://www.i3s.unice.fr/~cpjm/misc/")
+    (home-page "https://www.i3s.unice.fr/~cpjm/misc/")
     (synopsis "Upgrade path problem solver")
     (description "Mccs (Multi Criteria CUDF Solver) is a CUDF problem solver.
 Mccs take as input a CUDF problem and computes the best solution according to
@@ -470,10 +462,6 @@ the opam file fomat.")
 
        #:test-target "tests"
 
-       ;; FIXME: There's an obscure test failure:
-       ;;   …/_obuild/opam/opam.asm install P1' failed.
-       #:tests? #f
-
        #:phases (modify-phases %standard-phases
                  (add-before 'build 'pre-build
                    (lambda* (#:key inputs make-flags #:allow-other-keys)
@@ -504,15 +492,31 @@ the opam file fomat.")
                        #t)))
                  (add-before 'check 'pre-check
                    (lambda _
-                     (setenv "HOME" (getcwd))
-                     (invoke "git" "config" "--global" "user.email" "guix@gnu.org")
-                     (invoke "git" "config" "--global" "user.name" "Guix")
+                     ;; The "repo" test attempts to open some of these files O_WRONLY
+                     ;; and fails with a bogus "OpamSystem.File_not_found" otherwise.
+                     (for-each
+                      (lambda (f) (chmod f #o644))
+                      (find-files "tests/packages" "\\.opam$"))
+
+                     (substitute* "tests/Makefile"
+                       (("/usr/bin/printf")
+                        (which "printf"))
+                       ;; By default tests run twice: once with a "local" repository
+                       ;; and once with a git repository: disable the git tests to
+                       ;; avoid the dependency.
+                       (("all: local git")
+                        "all: local"))
                      #t)))))
     (native-inputs
      `(("dune" ,dune)
-       ("git" ,git)                               ;for the tests
        ("ocaml-cppo" ,ocaml-cppo)
-       ("python" ,python)))                       ;for the tests
+
+       ;; For tests.
+       ("openssl" ,openssl)
+       ("python" ,python-wrapper)
+       ("rsync" ,rsync)
+       ("unzip" ,unzip)
+       ("which" ,which)))
     (inputs
      `(("ocaml" ,ocaml)
        ("ncurses" ,ncurses)
@@ -537,16 +541,16 @@ Git-friendly development workflow.")
 (define-public camlp5
   (package
     (name "camlp5")
-    (version "7.10")
+    (version "7.12")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/camlp5/camlp5.git")
+             (url "https://github.com/camlp5/camlp5")
              (commit (string-append "rel" (string-delete #\. version)))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1a1lgsc8350afdwmsznsys7m0c0cks4nw6irqz2f92g8g4vkk9b7"))))
+        (base32 "12ix5g15bys932hyf9gs637iz76m0ji9075d83jfdmx85q30llgf"))))
     (build-system gnu-build-system)
     (inputs
      `(("ocaml" ,ocaml)))
@@ -579,7 +583,7 @@ Git-friendly development workflow.")
              (install-file "etc/META" (string-append (assoc-ref outputs "out")
                                                      "/lib/ocaml/camlp5/"))
              #t)))))
-    (home-page "http://camlp5.gforge.inria.fr/")
+    (home-page "https://camlp5.github.io/")
     (synopsis "Pre-processor Pretty Printer for OCaml")
     (description
      "Camlp5 is a Pre-Processor-Pretty-Printer for Objective Caml.  It offers
@@ -591,21 +595,21 @@ concrete syntax of the language (Quotations, Syntax Extensions).")
 (define-public hevea
   (package
     (name "hevea")
-    (version "2.32")
+    (version "2.34")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://hevea.inria.fr/old/"
-                                  name "-" version ".tar.gz"))
+                                  "hevea-" version ".tar.gz"))
               (sha256
                (base32
-                "1s4yqphfcr1pf5mcj5c84mvmd107k525iiym5jdwsxz0ka0ccmfy"))))
+                "1pzyszxw90klpcmhjqrjfc8cw6c0gm4w2blim8ydyxb6rq6qml1s"))))
     (build-system gnu-build-system)
     (inputs
      `(("ocaml" ,ocaml)))
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)))
     (arguments
-     `(#:tests? #f  ; no test suite
+     `(#:tests? #f                      ; no test suite
        #:make-flags (list (string-append "PREFIX=" %output))
        #:phases (modify-phases %standard-phases
                   (delete 'configure)
@@ -629,7 +633,7 @@ written in Objective Caml.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocaml/num.git")
+             (url "https://github.com/ocaml/num")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -675,7 +679,7 @@ the OCaml core distribution.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocaml/tuareg.git")
+             (url "https://github.com/ocaml/tuareg")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -715,7 +719,8 @@ Emacs.")
 (define-public ocaml-menhir
   (package
     (name "ocaml-menhir")
-    (version "20181113")
+    ;; More recent versions can be built after we have dune >= 2.0
+    (version "20190626")
     (source
      (origin
        (method git-fetch)
@@ -724,7 +729,7 @@ Emacs.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1iqdf64ayq4s3d9jkwhs3s8wqc2s48b292hp0kcjsskfhcvwg0kr"))))
+        (base32 "0v8av4pw6rykzb7wx54xhbsx0jhh8xyb4x0k4yrxi0w5ylkck6mb"))))
     (build-system ocaml-build-system)
     (inputs
      `(("ocaml" ,ocaml)))
@@ -773,16 +778,16 @@ Knuth’s LR(1) parser construction technique.")
 (define-public lablgtk
   (package
     (name "lablgtk")
-    (version "2.18.8")
+    (version "2.18.10")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                      (url "https://github.com/garrigue/lablgtk")
-                     (commit "lablgtk2188")))
+                     (commit version)))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0gpww8bkwi5cl68kc006970zvzwvq73h1mwrnd239apmwlxc1l8a"))))
+                "0w8cdfcv2wc19sd3qzj3qq77qc6rbnbynsz02gzbl15kgrvgrfxi"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("ocaml" ,ocaml)
@@ -820,6 +825,7 @@ Knuth’s LR(1) parser construction technique.")
                  (substitute* "config.make"
                    ((ocaml) out))
                  #t))))))
+    (properties `((ocaml4.07-variant . ,(delay ocaml4.07-lablgtk))))
     (home-page "http://lablgtk.forge.ocamlcore.org/")
     (synopsis "GTK+ bindings for OCaml")
     (description
@@ -833,6 +839,16 @@ libglade (and it an generate OCaml code from .glade files),
 libpanel, librsvg and quartz.")
     (license license:lgpl2.1)))
 
+(define-public ocaml4.07-lablgtk
+  (package
+    (inherit lablgtk)
+    (name "ocaml4.07-lablgtk")
+    (native-inputs
+     `(("ocaml" ,ocaml-4.07)
+       ("findlib" ,ocaml4.07-findlib)
+       ("pkg-config" ,pkg-config)))
+    (properties '())))
+
 (define-public unison
   (package
     (name "unison")
@@ -840,7 +856,7 @@ libpanel, librsvg and quartz.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/bcpierce00/unison.git")
+                    (url "https://github.com/bcpierce00/unison")
                     (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -850,7 +866,7 @@ libpanel, librsvg and quartz.")
     (outputs '("out"
                "doc"))                  ; 1.9 MiB of documentation
     (native-inputs
-     `(("ocaml" ,ocaml)
+     `(("ocaml" ,ocaml-4.07)
        ;; For documentation
        ("ghostscript" ,ghostscript)
        ("texlive" ,texlive-tiny)
@@ -968,6 +984,14 @@ compilation and linkage, there are new frontends of the various OCaml
 compilers that can directly deal with packages.")
     (license license:x11)))
 
+(define-public ocaml4.07-findlib
+  (package
+    (inherit ocaml-findlib)
+    (name "ocaml4.07-findlib")
+    (native-inputs
+     `(("m4" ,m4)
+       ("ocaml" ,ocaml-4.07)))))
+
 ;; note that some tests may hang for no obvious reason.
 (define-public ocaml-ounit
   (package
@@ -1028,7 +1052,7 @@ other XUnit testing frameworks.")
        (list "all" "allopt"
              (string-append "INSTALLDIR=" (assoc-ref %outputs "out")
                             "/lib/ocaml"))))
-    (home-page "http://forge.ocamlcore.org/projects/camlzip")
+    (home-page "https://github.com/xavierleroy/camlzip")
     (synopsis "Provides easy access to compressed files")
     (description "Provides easy access to compressed files in ZIP, GZIP and
 JAR format.  It provides functions for reading from and writing to compressed
@@ -1145,7 +1169,7 @@ GNU CC attributes.  It provides also a C pretty printer as an example of use.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/c-cube/qcheck.git")
+             (url "https://github.com/c-cube/qcheck")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -1168,7 +1192,7 @@ GNU CC attributes.  It provides also a C pretty printer as an example of use.")
     (home-page "https://github.com/c-cube/qcheck")
     (synopsis "QuickCheck inspired property-based testing for OCaml")
     (description "QuickCheck inspired property-based testing for OCaml. This
-module allows to check invariants (properties of some types) over randomly
+module checks invariants (properties of some types) over randomly
 generated instances of the type. It provides combinators for generating
 instances and printing them.")
     (license license:lgpl3+)))
@@ -1261,6 +1285,9 @@ release of Jane Street packages.  It reads metadata from @file{dune} files
 following a very simple s-expression syntax.")
     (license license:expat)))
 
+(define-public ocaml4.07-dune
+  (package-with-ocaml4.07 dune))
+
 (define-public ocaml-migrate-parsetree
   (package
     (name "ocaml-migrate-parsetree")
@@ -1431,9 +1458,9 @@ to operate on the result type available from OCaml 4.03 in the standard
 library.")
     (license license:isc)))
 
-(define-public ocaml-sqlite3
+(define-public ocaml4.07-sqlite3
   (package
-    (name "ocaml-sqlite3")
+    (name "ocaml4.07-sqlite3")
     (version "4.4.1")
     (source
      (origin
@@ -1446,9 +1473,12 @@ library.")
         (base32
          "1536agm5fgcqysszhpd3kmw7lkc5n5ni7gmlyglrbvmnmrwf3av2"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
-     `(("ocaml-base" ,ocaml-base)
-       ("ocaml-stdio" ,ocaml-stdio)
+     `(("ocaml-base" ,ocaml4.07-base)
+       ("ocaml-stdio" ,ocaml4.07-stdio)
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("sqlite" ,sqlite)))
@@ -1517,7 +1547,7 @@ manipulate such data.")
          (delete 'configure))))
     (home-page "http://erratique.ch/software/mtime")
     (synopsis "Monotonic wall-clock time for OCaml")
-    (description "Access monotonic wall-clock time.  It allows to measure time
+    (description "Access monotonic wall-clock time.  It measures time
 spans without being subject to operating system calendar time adjustments.")
     (license license:isc)))
 
@@ -1658,15 +1688,15 @@ displayed at the end of the run (with the full logs ready to inspect), with a
 simple (yet expressive) query language to select the tests to run.")
     (license license:isc)))
 
-(define-public ocaml-ppx-tools
+(define-public ocaml4.07-ppx-tools
   (package
-    (name "ocaml-ppx-tools")
+    (name "ocaml4.07-ppx-tools")
     (version "5.1+4.06.0")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/alainfrisch/ppx_tools.git")
+             (url "https://github.com/alainfrisch/ppx_tools")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256 (base32
@@ -1674,7 +1704,9 @@ simple (yet expressive) query language to select the tests to run.")
     (build-system ocaml-build-system)
     (arguments
      `(#:phases (modify-phases %standard-phases (delete 'configure))
-       #:tests? #f))
+       #:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "ppx_tools")))
     (home-page "https://github.com/alainfrisch/ppx_tools")
     (synopsis "Tools for authors of ppx rewriters and other syntactic tools")
@@ -1719,7 +1751,7 @@ lets the client choose the concrete timeline.")
       (origin
         (method git-fetch)
         (uri (git-reference
-              (url "https://github.com/savonet/ocaml-ssl.git")
+              (url "https://github.com/savonet/ocaml-ssl")
               (commit version)))
         (file-name (git-file-name name version))
         (sha256 (base32
@@ -1748,6 +1780,7 @@ through Transport Layer Security (@dfn{TLS}) encrypted connections.")
               (uri (git-reference
                      (url "https://github.com/mirage/mmap")
                      (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
                 "1jaismy5d1bhbbanysmr2k79px0yv6ya265dri3949nha1l23i60"))))
@@ -1756,7 +1789,7 @@ through Transport Layer Security (@dfn{TLS}) encrypted connections.")
     (synopsis "File mapping for OCaml")
     (description "This project provides a @command{Mmap.map_file} function
 for mapping files in memory.  This function is the same as the
-@command{Unix.map_file} funciton added in OCaml >= 4.06.")
+@command{Unix.map_file} function added in OCaml >= 4.06.")
     (license (list license:qpl license:lgpl2.0))))
 
 (define-public ocaml-lwt
@@ -1765,12 +1798,13 @@ for mapping files in memory.  This function is the same as the
     (version "5.1.1")
     (source
       (origin
-        (method url-fetch)
-        (uri (string-append "https://github.com/ocsigen/lwt/archive/" version
-                            ".tar.gz"))
-        (file-name (string-append name "-" version ".tar.gz"))
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/ocsigen/lwt")
+               (commit version)))
+        (file-name (git-file-name name version))
         (sha256 (base32
-                  "0gwdmhn0qx03agc45dplj73ia5y1gb42aan64ywfxmll3lsnr2h7"))))
+                 "1nl7rdnwfdhwcsm5zpay1nr9y5cbapd9x1qzily7zk9ab4v52m8g"))))
     (build-system dune-build-system)
     (arguments
      `(#:package "lwt"))
@@ -1794,6 +1828,28 @@ process.  Also, in many cases, Lwt threads can interact without the need for
 locks or other synchronization primitives.")
     (license license:lgpl2.1)))
 
+(define-public ocaml-lwt-react
+  (package
+    (inherit ocaml-lwt)
+    (name "ocaml-lwt-react")
+    (version "1.1.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/ocsigen/lwt")
+                     ;; Version from opam
+                     (commit "4.3.0")))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0f7036srqz7zmnz0n164734smgkrqz78r1i35cg30x31kkr3pnn4"))))
+    (arguments
+     `(#:package "lwt_react"))
+    (properties `((upstream-name . "lwt_react")))
+    (propagated-inputs
+     `(("ocaml-lwt" ,ocaml-lwt)
+       ("ocaml-react" ,ocaml-react)))))
+
 (define-public ocaml-lwt-log
   (package
     (name "ocaml-lwt-log")
@@ -1951,9 +2007,9 @@ format.  It can process XML documents without a complete in-memory
 representation of the data.")
     (license license:isc)))
 
-(define-public ocaml-gen
+(define-public ocaml4.07-gen
   (package
-    (name "ocaml-gen")
+    (name "ocaml4.07-gen")
     (version "0.5.2")
     (source (origin
               (method git-fetch)
@@ -1967,21 +2023,23 @@ representation of the data.")
     (build-system dune-build-system)
     (arguments
      `(#:tests? #f; no tests
-       #:package "gen"))
+       #:package "gen"
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-     `(("ocaml-odoc" ,ocaml-odoc)))
+     `(("ocaml-odoc" ,ocaml4.07-odoc)))
     (native-inputs
-     `(("ocaml-qtest" ,ocaml-qtest)
-       ("ocaml-qcheck" ,ocaml-qcheck)))
+     `(("ocaml-qtest" ,(package-with-ocaml4.07 ocaml-qtest))
+       ("ocaml-qcheck" ,(package-with-ocaml4.07 ocaml-qcheck))))
     (home-page "https://github.com/c-cube/gen/")
     (synopsis "Iterators for OCaml, both restartable and consumable")
     (description "Gen implements iterators of OCaml, that are both restartable
 and consumable.")
     (license license:bsd-2)))
 
-(define-public ocaml-sedlex
+(define-public ocaml4.07-sedlex
   (package
-    (name "ocaml-sedlex")
+    (name "ocaml4.07-sedlex")
     (version "2.1")
     (source (origin
               (method git-fetch)
@@ -2010,13 +2068,16 @@ and consumable.")
          (add-before 'build 'chmod
            (lambda _
              (for-each (lambda (file) (chmod file #o644)) (find-files "." ".*"))
-             #t)))))
+             #t)))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
-     `(("ocamlbuild" ,ocamlbuild)))
+     `(("ocamlbuild" ,(package-with-ocaml4.07 ocamlbuild))))
     (propagated-inputs
-     `(("ocaml-gen" ,ocaml-gen)
-       ("ocaml-ppx-tools-versioned" ,ocaml-ppx-tools-versioned)
-       ("ocaml-uchar" ,ocaml-uchar)))
+     `(("ocaml-gen" ,ocaml4.07-gen)
+       ("ocaml-ppx-tools-versioned"
+        ,(package-with-ocaml4.07 ocaml-ppx-tools-versioned))
+       ("ocaml-uchar" ,(package-with-ocaml4.07 ocaml-uchar))))
     ;; These three files are needed by src/generator/data/dune, but would be
     ;; downloaded using curl at build time.
     (inputs
@@ -2041,7 +2102,7 @@ and consumable.")
            (sha256
             (base32
              "0gsb1jpj3mnqbjgbavi4l95gl6g4agq58j82km22fdfg63j3w3fk"))))))
-    (home-page "http://www.cduce.org/download.html#side")
+    (home-page "https://www.cduce.org/download.html#side")
     (synopsis "Lexer generator for Unicode and OCaml")
     (description "Lexer generator for Unicode and OCaml.")
     (license license:expat)))
@@ -2144,14 +2205,14 @@ without a complete in-memory representation of the data.")
 (define-public ocaml-ocurl
   (package
     (name "ocaml-ocurl")
-    (version "0.8.2")
+    (version "0.9.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://ygrek.org.ua/p/release/ocurl/ocurl-"
                                   version ".tar.gz"))
               (sha256
                 (base32
-                  "1ax3xdlzgb1zg7d0wr9nwgmh6a45a764m0wk8p6mx07ad94hz0q9"))))
+                  "0n621cxb9012pj280c7821qqsdhypj8qy9qgrah79dkh6a8h2py6"))))
     (build-system ocaml-build-system)
     (arguments
      `(#:phases
@@ -2197,19 +2258,25 @@ radix-64 representation.  It is specified in RFC 4648.")
 (define-public ocamlify
   (package
     (name "ocamlify")
-    (version "0.0.1")
-    (source (origin
-              (method url-fetch)
-              (uri "https://download.ocamlcore.org/ocamlify/ocamlify/0.0.1/ocamlify-0.0.1.tar.gz")
-              (sha256
-               (base32
-                "1j9nb3vjqbdsx3d6jazixgrh776051zkrc06nsc5q5ilp1jhrwkm"))))
+    (version "0.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://download.ocamlcore.org/ocamlify/ocamlify/"
+                           version "/ocamlify-" version ".tar.gz"))
+       (sha256
+        (base32 "1f0fghvlbfryf5h3j4as7vcqrgfjb4c8abl5y0y5h069vs4kp5ii"))))
     (build-system ocaml-build-system)
-    ; tests are done during build
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (delete 'check)
+         (add-after 'unpack 'disable-safe-string
+           ;; Work around ‘Error: This expression has type string but an
+           ;; expression was expected of type bytes’ since OCaml 4.06.
+           (lambda _
+             (setenv "OCAMLPARAM" "safe-string=0,_")
+             #t))
+         (delete 'check)                ; tests are run during the build
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              (invoke "ocaml" "setup.ml" "-configure" "--prefix"
@@ -2218,7 +2285,7 @@ radix-64 representation.  It is specified in RFC 4648.")
      `(("ocamlbuild" ,ocamlbuild)))
     (home-page "https://forge.ocamlcore.org/projects/ocamlify")
     (synopsis "Include files in OCaml code")
-    (description "OCamlify allows to create OCaml source code by including
+    (description "OCamlify creates OCaml source code by including
 whole files into OCaml string or string list.  The code generated can be
 compiled as a standard OCaml file.  It allows embedding external resources as
 OCaml code.")
@@ -2322,9 +2389,9 @@ every compliant installation of OCaml and organize these libraries into a
 hierarchy of modules.")
     (license license:lgpl2.1+)))
 
-(define-public ocaml-pcre
+(define-public ocaml4.07-pcre
   (package
-    (name "ocaml-pcre")
+    (name "ocaml4.07-pcre")
     (version "7.4.1")
     (source (origin
               (method git-fetch)
@@ -2337,9 +2404,12 @@ hierarchy of modules.")
                 "11sd8g668h48790lamz0riw9jgnfkaif5qdfa0akcndwa6aj07jf"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."))
+     `(#:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib
+       #:dune ,ocaml4.07-dune))
     (native-inputs
-     `(("ocaml-base" ,ocaml-base)
+     `(("ocaml-base" ,ocaml4.07-base)
        ("pcre:bin" ,pcre "bin")))
     (propagated-inputs `(("pcre" ,pcre)))
     (home-page "https://mmottl.github.io/pcre-ocaml")
@@ -2349,9 +2419,9 @@ matching and substitution, similar to the functionality offered by the Perl
 language.")
     (license license:lgpl2.1+))); with the OCaml link exception
 
-(define-public ocaml-expect
+(define-public ocaml4.07-expect
   (package
-    (name "ocaml-expect")
+    (name "ocaml4.07-expect")
     (version "0.0.6")
     (source (origin
               (method url-fetch)
@@ -2360,14 +2430,17 @@ language.")
                (base32
                 "098qvg9d4yrqzr5ax291y3whrpax0m3sx4gi6is0mblc96r9yqk0"))))
     (arguments
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (build-system ocaml-build-system)
     (native-inputs
-     `(("ocamlbuild" ,ocamlbuild)
-       ("ocaml-num" ,ocaml-num)
-       ("ocaml-pcre" ,ocaml-pcre)
-       ("ounit" ,ocaml-ounit)))
-    (propagated-inputs `(("batteries" ,ocaml-batteries)))
+     `(("ocamlbuild" ,(package-with-ocaml4.07 ocamlbuild))
+       ("ocaml-num" ,(package-with-ocaml4.07 ocaml-num))
+       ("ocaml-pcre" ,ocaml4.07-pcre)
+       ("ounit" ,(package-with-ocaml4.07 ocaml-ounit))))
+    (propagated-inputs
+     `(("batteries" ,(package-with-ocaml4.07 ocaml-batteries))))
     (home-page "https://forge.ocamlcore.org/projects/ocaml-expect/")
     (synopsis "Simple implementation of expect")
     (description "Help building unitary testing of interactive program.  You
@@ -2399,7 +2472,7 @@ compatibility with older compiler to use these new features in their code.")
 (define-public ocaml-fileutils
   (package
     (name "ocaml-fileutils")
-    (version "0.6.0")
+    (version "0.6.2")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -2408,29 +2481,12 @@ compatibility with older compiler to use these new features in their code.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "06gxbqfssl16xc8y4d34wpm0mwfr0jgph4lmlwfmgazyggnmvc7m"))))
-    (build-system ocaml-build-system)
-    (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (add-before 'configure '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* "setup.ml"
-                 (("#use \"topfind\";;" all)
-                  (string-append "#directory \"" findlib-libdir "\"\n"
-                                 all))))
-             #t)))))
+                "01qf51b8pb7vyfba7y0kb7ajwj1950im25d7f59821zwsibns3d9"))))
+    (build-system dune-build-system)
     (propagated-inputs
      `(("ocaml-stdlib-shims" ,ocaml-stdlib-shims)))
     (native-inputs
-     `(("ocamlbuild" ,ocamlbuild)
-       ("ocaml-oasis" ,ocaml-oasis)
-       ("ocaml-ounit" ,ocaml-ounit)))
+     `(("ocaml-ounit" ,ocaml-ounit)))
     (home-page "http://ocaml-fileutils.forge.ocamlcore.org")
     (synopsis "Pure OCaml functions to manipulate real file and filename")
     (description "Library to provide pure OCaml functions to manipulate real
@@ -2538,7 +2594,7 @@ programs.  It allows the definition of simple macros and file inclusion.  Cpp oi
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/c-cube/seq.git")
+             (url "https://github.com/c-cube/seq")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -2576,7 +2632,7 @@ standard iterator type starting from 4.07.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocaml/ocaml-re.git")
+             (url "https://github.com/ocaml/ocaml-re")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -2606,13 +2662,14 @@ standard iterator type starting from 4.07.")
     (name "ocaml-ocplib-endian")
     (version "1.0")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/OCamlPro/ocplib-endian/"
-                                  "archive/" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/OCamlPro/ocplib-endian/")
+                     (commit version)))
               (sha256
                (base32
-                "0hwj09rnzjs0m0kazz5h2mgs6p95j0zlga8cda5srnzqmzhniwkn"))
-              (file-name (string-append name "-" version ".tar.gz"))))
+                "0s1ld3kavz892b8awyxyg1mr98h2g61gy9ci5v6yb49bsii6wicw"))
+              (file-name (git-file-name name version))))
     (build-system ocaml-build-system)
     (native-inputs
      `(("cppo" ,ocaml-cppo)
@@ -2676,15 +2733,15 @@ writing to these structures, and they are accessed via the Bigarray module.")
     (description "Hex is a minimal library providing hexadecimal converters.")
     (license license:isc)))
 
-(define-public ocaml-ezjsonm
+(define-public ocaml4.07-ezjsonm
   (package
-    (name "ocaml-ezjsonm")
+    (name "ocaml4.07-ezjsonm")
     (version "1.1.0")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/mirage/ezjsonm.git")
+             (url "https://github.com/mirage/ezjsonm")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -2692,13 +2749,15 @@ writing to these structures, and they are accessed via the Bigarray module.")
     (build-system dune-build-system)
     (arguments
      `(#:package "ezjsonm"
-       #:test-target "."))
+       #:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
-     `(("ocaml-alcotest" ,ocaml-alcotest)))
+     `(("ocaml-alcotest" ,(package-with-ocaml4.07 ocaml-alcotest))))
     (propagated-inputs
-     `(("ocaml-hex" ,ocaml-hex)
-       ("ocaml-jsonm" ,ocaml-jsonm)
-       ("ocaml-sexplib" ,ocaml-sexplib)))
+     `(("ocaml-hex" ,(package-with-ocaml4.07 ocaml-hex))
+       ("ocaml-jsonm" ,(package-with-ocaml4.07 ocaml-jsonm))
+       ("ocaml-sexplib" ,ocaml4.07-sexplib)))
     (home-page "https://github.com/mirage/ezjsonm/")
     (synopsis "Read and write JSON data")
     (description "Ezjsonm provides more convenient (but far less flexible) input
@@ -2707,15 +2766,15 @@ the need to write signal code, which is useful for quick scripts that manipulate
 JSON.")
     (license license:isc)))
 
-(define-public ocaml-uri
+(define-public ocaml4.07-uri
   (package
-    (name "ocaml-uri")
+    (name "ocaml4.07-uri")
     (version "2.2.0")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/mirage/ocaml-uri.git")
+             (url "https://github.com/mirage/ocaml-uri")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -2728,14 +2787,16 @@ JSON.")
          (add-before 'build 'update-deprecated
            (lambda _
              (substitute* "lib/uri.ml"
-               (("Re.get") "Re.Group.get")))))))
+               (("Re.get") "Re.Group.get")))))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
-     `(("ocaml-ounit" ,ocaml-ounit)
-       ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)))
+     `(("ocaml-ounit" ,(package-with-ocaml4.07 ocaml-ounit))
+       ("ocaml-ppx-sexp-conv" ,ocaml4.07-ppx-sexp-conv)))
     (propagated-inputs
-     `(("ocaml-re" ,ocaml-re)
-       ("ocaml-sexplib0" ,ocaml-sexplib0)
-       ("ocaml-stringext" ,ocaml-stringext)))
+     `(("ocaml-re" ,(package-with-ocaml4.07 ocaml-re))
+       ("ocaml-sexplib0" ,ocaml4.07-sexplib0)
+       ("ocaml-stringext" ,(package-with-ocaml4.07 ocaml-stringext))))
     (home-page "https://github.com/mirage/ocaml-uri")
     (synopsis "RFC3986 URI/URL parsing library")
     (description "OCaml-uri is a library for parsing URI/URL in the RFC3986 format.")
@@ -2772,15 +2833,15 @@ JSON.")
 Format module of the OCaml standard library.")
     (license license:bsd-3)))
 
-(define-public ocaml-piqilib
+(define-public ocaml4.07-piqilib
   (package
-    (name "ocaml-piqilib")
+    (name "ocaml4.07-piqilib")
     (version "0.6.15")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/alavrik/piqi.git")
+             (url "https://github.com/alavrik/piqi")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -2818,14 +2879,16 @@ Format module of the OCaml standard library.")
              (mkdir-p stubs)
              (symlink (string-append lib "/dllpiqilib_stubs.so")
                       (string-append stubs "/dllpiqilib_stubs.so"))
-             #t))))))
+             #t))))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
      `(("which" ,which)))
     (propagated-inputs
-     `(("ocaml-xmlm" ,ocaml-xmlm)
-       ("ocaml-sedlex" ,ocaml-sedlex)
-       ("ocaml-easy-format" ,ocaml-easy-format)
-       ("ocaml-base64" ,ocaml-base64)))
+     `(("ocaml-xmlm" ,(package-with-ocaml4.07 ocaml-xmlm))
+       ("ocaml-sedlex" ,ocaml4.07-sedlex)
+       ("ocaml-easy-format" ,(package-with-ocaml4.07 ocaml-easy-format))
+       ("ocaml-base64" ,(package-with-ocaml4.07 ocaml-base64))))
     (home-page "http://piqi.org")
     (synopsis "Data serialization and conversion library")
     (description "Piqilib is the common library used by the piqi command-line
@@ -2891,18 +2954,19 @@ and 4 (random based) according to RFC 4122.")
     (description "OCamlgraph is a generic graph library for OCaml.")
     (license license:lgpl2.1)))
 
-(define-public ocaml-piqi
+(define-public ocaml4.07-piqi
   (package
-    (name "ocaml-piqi")
+    (name "ocaml4.07-piqi")
     (version "0.7.7")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/alavrik/piqi-ocaml/"
-                                  "archive/v" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/alavrik/piqi-ocaml")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1l0b4saxmwqgw9mb10mwrz31lvpj3l0abh3cwarqp0x4vdrzshbh"))))
+                "1913jpsb8mvqi8609j4g4sm5jhg50dq0xqxgy8nmvknfryyc89nm"))))
     (build-system ocaml-build-system)
     (arguments
      `(#:make-flags
@@ -2911,14 +2975,20 @@ and 4 (random based) according to RFC 4122.")
                             "/bin/sh"))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure))))
+         (add-after 'unpack 'make-files-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
+         (delete 'configure))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
      `(("which" ,which)
        ("protobuf" ,protobuf))) ; for tests
     (propagated-inputs
-     `(("ocaml-num" ,ocaml-num)
-       ("ocaml-piqilib" ,ocaml-piqilib)
-       ("ocaml-stdlib-shims" ,ocaml-stdlib-shims)))
+     `(("ocaml-num" ,(package-with-ocaml4.07 ocaml-num))
+       ("ocaml-piqilib" ,ocaml4.07-piqilib)
+       ("ocaml-stdlib-shims" ,(package-with-ocaml4.07 ocaml-stdlib-shims))))
     (home-page "https://github.com/alavrik/piqi-ocaml")
     (synopsis "Protocol serialization system for OCaml")
     (description "Piqi is a multi-format data serialization system for OCaml.
@@ -2929,7 +2999,7 @@ XML and Protocol Buffers formats.")
 (define-public bap
   (package
     (name "bap")
-    (version "1.6.0")
+    (version "2.0.0")
     (home-page "https://github.com/BinaryAnalysisPlatform/bap")
     (source (origin
               (method git-fetch)
@@ -2939,34 +3009,41 @@ XML and Protocol Buffers formats.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0ryf2xb37pj2f9mc3p5prqgqrylph9qgq7q9jnbx8b03nzzpa6h6"))))
+                "0lb9xkfp67wjjqr75p6krivmjra7l5673236v9ny4gp0xi0755bk"))))
    (build-system ocaml-build-system)
    (native-inputs
-    `(("ocaml-oasis" ,ocaml-oasis)
+    `(("ocaml-oasis" ,(package-with-ocaml4.07 ocaml-oasis))
       ("clang" ,clang-3.8)
-      ("ocaml-ounit" ,ocaml-ounit)))
+      ("ocaml-ounit" ,(package-with-ocaml4.07 ocaml-ounit))))
    (propagated-inputs
-    `(("camlzip" ,camlzip)
-      ("ocaml-bitstring" ,ocaml-bitstring)
-      ("ocaml-cmdliner" ,ocaml-cmdliner)
-      ("ocaml-core-kernel" ,ocaml-core-kernel)
-      ("ocaml-ezjsonm" ,ocaml-ezjsonm)
-      ("ocaml-fileutils" ,ocaml-fileutils)
-      ("ocaml-frontc" ,ocaml-frontc)
-      ("ocaml-graph" ,ocaml-graph)
-      ("ocaml-ocurl" ,ocaml-ocurl)
-      ("ocaml-piqi" ,ocaml-piqi)
-      ("ocaml-ppx-jane" ,ocaml-ppx-jane)
-      ("ocaml-uuidm" ,ocaml-uuidm)
-      ("ocaml-uri" ,ocaml-uri)
-      ("ocaml-zarith" ,ocaml-zarith)))
+    `(("camlzip" ,(package-with-ocaml4.07 camlzip))
+      ("ocaml-bitstring" ,(package-with-ocaml4.07 ocaml-bitstring))
+      ("ocaml-cmdliner" ,(package-with-ocaml4.07 ocaml-cmdliner))
+      ("ocaml-core-kernel" ,ocaml4.07-core-kernel)
+      ("ocaml-ezjsonm" ,ocaml4.07-ezjsonm)
+      ("ocaml-fileutils" ,(package-with-ocaml4.07 ocaml-fileutils))
+      ("ocaml-frontc" ,(package-with-ocaml4.07 ocaml-frontc))
+      ("ocaml-graph" ,(package-with-ocaml4.07 ocaml-graph))
+      ("ocaml-ocurl" ,(package-with-ocaml4.07 ocaml-ocurl))
+      ("ocaml-piqi" ,ocaml4.07-piqi)
+      ("ocaml-ppx-jane" ,ocaml4.07-ppx-jane)
+      ("ocaml-utop" ,ocaml4.07-utop)
+      ("ocaml-uuidm" ,(package-with-ocaml4.07 ocaml-uuidm))
+      ("ocaml-uri" ,ocaml4.07-uri)
+      ("ocaml-zarith" ,(package-with-ocaml4.07 ocaml-zarith))))
    (inputs
-    `(("llvm" ,llvm-3.8)
-      ("gmp" ,gmp)))
+    `(("gmp" ,gmp)
+      ("llvm" ,llvm-3.8)
+      ("ncurses" ,ncurses)))
    (arguments
     `(#:use-make? #t
       #:phases
       (modify-phases %standard-phases
+        (add-before 'configure 'fix-ncurses
+          (lambda _
+            (substitute* "oasis/llvm"
+              (("-lcurses") "-lncurses"))
+            #t))
         (replace 'configure
           (lambda* (#:key outputs inputs #:allow-other-keys)
             ;; add write for user, to prevent a failure in the install phase
@@ -2983,7 +3060,9 @@ XML and Protocol Buffers formats.")
                       "/lib/ocaml/site-lib")
                     "--with-llvm-version=3.8"
                     "--with-llvm-config=llvm-config"
-                    "--enable-everything"))))))
+                    "--enable-everything"))))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
    (synopsis "Binary Analysis Platform")
    (description "Binary Analysis Platform is a framework for writing program
 analysis tools, that target binary files.  The framework consists of a plethora
@@ -3023,9 +3102,9 @@ library is currently designed for Unicode Standard 3.2.")
     ;; with an exception for linked libraries to use a different license
     (license license:lgpl2.0+)))
 
-(define-public ocaml-charinfo-width
+(define-public ocaml4.07-charinfo-width
   (package
-    (name "ocaml-charinfo-width")
+    (name "ocaml4.07-charinfo-width")
     (version "1.1.0")
     (source (origin
               (method url-fetch)
@@ -3036,11 +3115,14 @@ library is currently designed for Unicode Standard 3.2.")
                (base32
                 "00bv4p1yqs8y0z4z07wd9w9yyv669dikp9b04dcjbwpiy2wy0086"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-     `(("ocaml-result" ,ocaml-result)
-       ("ocaml-camomile" ,ocaml-camomile)))
+     `(("ocaml-result" ,(package-with-ocaml4.07 ocaml-result))
+       ("ocaml-camomile" ,(package-with-ocaml4.07 ocaml-camomile))))
     (native-inputs
-     `(("ocaml-ppx-expect" ,ocaml-ppx-expect)))
+     `(("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)))
     (properties
      `((upstream-name . "charInfo_width")))
     (home-page "https://bitbucket.org/zandoye/charinfo_width/")
@@ -3049,15 +3131,15 @@ library is currently designed for Unicode Standard 3.2.")
 function that follows the prototype of POSIX's wcwidth.")
     (license license:expat)))
 
-(define-public ocaml-zed
+(define-public ocaml4.07-zed
   (package
-    (name "ocaml-zed")
+    (name "ocaml4.07-zed")
     (version "2.0.3")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/diml/zed.git")
+             (url "https://github.com/diml/zed")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -3065,11 +3147,13 @@ function that follows the prototype of POSIX's wcwidth.")
     (build-system dune-build-system)
     (arguments
      `(#:jbuild? #t
-       #:test-target "."))
+       #:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-     `(("ocaml-camomile" ,ocaml-camomile)
-       ("ocaml-charinfo-width" ,ocaml-charinfo-width)
-       ("ocaml-react" ,ocaml-react)))
+     `(("ocaml-camomile" ,(package-with-ocaml4.07 ocaml-camomile))
+       ("ocaml-charinfo-width" ,ocaml4.07-charinfo-width)
+       ("ocaml-react" ,(package-with-ocaml4.07 ocaml-react))))
     (home-page "https://github.com/diml/zed")
     (synopsis "Abstract engine for text editing in OCaml")
     (description "Zed is an abstract engine for text edition.  It can be used
@@ -3077,15 +3161,15 @@ to write text editors, edition widgets, readlines, etc.  You just have to
 connect an engine to your inputs and rendering functions to get an editor.")
     (license license:bsd-3)))
 
-(define-public ocaml-lambda-term
+(define-public ocaml4.07-lambda-term
   (package
-    (name "ocaml-lambda-term")
+    (name "ocaml4.07-lambda-term")
     (version "2.0.2")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/diml/lambda-term.git")
+             (url "https://github.com/diml/lambda-term")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -3093,11 +3177,16 @@ connect an engine to your inputs and rendering functions to get an editor.")
     (build-system dune-build-system)
     (arguments
      `(#:build-flags (list "--profile" "release")
-       #:tests? #f))
+       #:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-     `(("lwt" ,ocaml-lwt)
-       ("lwt-log" ,ocaml-lwt-log)
-       ("zed" ,ocaml-zed)))
+     `(("ocaml-lwt" ,(package-with-ocaml4.07 ocaml-lwt))
+       ("ocaml-lwt-log" ,(package-with-ocaml4.07 ocaml-lwt-log))
+       ("ocaml-lwt-react" ,(package-with-ocaml4.07 ocaml-lwt-react))
+       ("ocaml-zed" ,ocaml4.07-zed)))
+    (inputs
+     `(("libev" ,libev)))
     (home-page "https://github.com/diml/lambda-term")
     (synopsis "Terminal manipulation library for OCaml")
     (description "Lambda-Term is a cross-platform library for manipulating the
@@ -3108,15 +3197,15 @@ manipulation than, for example, ncurses, by providing a native OCaml interface
 instead of bindings to a C library.")
     (license license:bsd-3)))
 
-(define-public ocaml-utop
+(define-public ocaml4.07-utop
   (package
-    (name "ocaml-utop")
+    (name "ocaml4.07-utop")
     (version "2.4.3")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocaml-community/utop.git")
+             (url "https://github.com/ocaml-community/utop")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -3124,15 +3213,17 @@ instead of bindings to a C library.")
     (build-system dune-build-system)
     (arguments
      `(#:jbuild? #t
-       #:test-target "."))
+       #:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
-     `(("cppo" ,ocaml-cppo)))
+     `(("cppo" ,(package-with-ocaml4.07 ocaml-cppo))))
     (propagated-inputs
-     `(("lambda-term" ,ocaml-lambda-term)
-       ("lwt" ,ocaml-lwt)
-       ("react" ,ocaml-react)
-       ("camomile" ,ocaml-camomile)
-       ("zed" ,ocaml-zed)))
+     `(("lambda-term" ,ocaml4.07-lambda-term)
+       ("lwt" ,(package-with-ocaml4.07 ocaml-lwt))
+       ("react" ,(package-with-ocaml4.07 ocaml-react))
+       ("camomile" ,(package-with-ocaml4.07 ocaml-camomile))
+       ("zed" ,ocaml4.07-zed)))
     (home-page "https://github.com/ocaml-community/utop")
     (synopsis "Improved interface to the OCaml toplevel")
     (description "UTop is an improved toplevel for OCaml.  It can run in a
@@ -3178,12 +3269,14 @@ long and size_t whose sizes depend on the host platform.")
    (version "0.14.0")
    (home-page "https://github.com/ocamllabs/ocaml-ctypes")
    (source (origin
-             (method url-fetch)
-             (uri (string-append home-page "/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))
              (sha256
               (base32
-               "0zrsd42q2nciyg9375g2kydqax6ay299rhyfgms59qiw7d9ylyp9"))))
+               "1b2q3h63ngf4x9qp65qwapf2dg9q0mcdah6qjm2q0c7v2p5vysv9"))))
    (build-system ocaml-build-system)
    (arguments
     `(#:tests? #f; require an old lwt
@@ -3191,6 +3284,14 @@ long and size_t whose sizes depend on the host platform.")
       (list (string-append "INSTALL_HEADERS = $(wildcard $($(PROJECT).dir)/*.h)"))
       #:phases
       (modify-phases %standard-phases
+        (add-after 'unpack 'make-writable
+          (lambda _
+            (for-each
+              (lambda (file)
+                (let ((stat (stat file)))
+                  (chmod file (+ #o200 (stat:mode stat)))))
+              (find-files "." "."))
+            #t))
         (delete 'configure))))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
@@ -3254,8 +3355,8 @@ OCaml projects that contain C stubs.")
 (define-public ocaml-tsdl
   (package
     (name "ocaml-tsdl")
-    (version "0.9.6")
-    (home-page "http://erratique.ch/software/tsdl")
+    (version "0.9.7")
+    (home-page "https://erratique.ch/software/tsdl")
     (source (origin
               (method url-fetch)
               (uri (string-append home-page "/releases/tsdl-"
@@ -3263,7 +3364,7 @@ OCaml projects that contain C stubs.")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "00krjhmnchsnz33h9zhh0v69xbvi86l0xf0dvy7iivylb7f7x3n4"))))
+                "1zwv0ixkigh1gzk5n49rwvz2f2m62jdkkqg40j7dclg4gri7691f"))))
     (build-system ocaml-build-system)
     (arguments
      `(#:build-flags '("build")
@@ -3274,12 +3375,10 @@ OCaml projects that contain C stubs.")
     (native-inputs
      `(("ocamlbuild" ,ocamlbuild)
        ("ocaml-astring" ,ocaml-astring)
-       ("ocaml-ocb-stubblr" ,ocaml-ocb-stubblr)
        ("opam" ,opam)
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("topkg" ,ocaml-topkg)
-       ("result" ,ocaml-result)
        ("sdl2" ,sdl2)
        ("integers" ,ocaml-integers)
        ("ctypes" ,ocaml-ctypes)))
@@ -3297,7 +3396,7 @@ cross-platform SDL C library.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/deducteam/dedukti.git")
+             (url "https://github.com/deducteam/dedukti")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -3398,9 +3497,9 @@ Dedukti files.")
 syntax checking on dedukti files.")
       (license license:cecill-b))))
 
-(define-public ocaml-ppx-inline-test
+(define-public ocaml4.07-ppx-inline-test
   (package
-    (name "ocaml-ppx-inline-test")
+    (name "ocaml4.07-ppx-inline-test")
     (version "0.12.0")
     (home-page "https://github.com/janestreet/ppx_inline_test")
     (source
@@ -3416,14 +3515,17 @@ syntax checking on dedukti files.")
     (build-system dune-build-system)
     (arguments
      ;see home page README for further information
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (inputs
-     `(("ocaml-base" ,ocaml-base)
-       ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-       ("ocaml-compiler-libs" ,ocaml-compiler-libs)
-       ("ocaml-sexplib0" ,ocaml-sexplib0)
-       ("ocaml-stdio" ,ocaml-stdio)
-       ("ocaml-ppxlib" ,ocaml-ppxlib)))
+     `(("ocaml-base" ,ocaml4.07-base)
+       ("ocaml-migrate-parsetree"
+        ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+       ("ocaml-compiler-libs" ,(package-with-ocaml4.07 ocaml-compiler-libs))
+       ("ocaml-sexplib0" ,ocaml4.07-sexplib0)
+       ("ocaml-stdio" ,ocaml4.07-stdio)
+       ("ocaml-ppxlib" ,ocaml4.07-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
@@ -3439,7 +3541,7 @@ collection.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/rlepigre/ocaml-bindlib.git")
+             (url "https://github.com/rlepigre/ocaml-bindlib")
              (commit (string-append "ocaml-bindlib_" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -3469,9 +3571,9 @@ for programming languages, but also for manipulating terms of the λ-calculus
 or quantified formulas.")
     (license license:gpl3+)))
 
-(define-public ocaml-earley
+(define-public ocaml4.07-earley
   (package
-    (name "ocaml-earley")
+    (name "ocaml4.07-earley")
     (version "2.0.0")
     (home-page "https://github.com/rlepigre/ocaml-earley")
     (source
@@ -3486,7 +3588,9 @@ or quantified formulas.")
          "18k7bi7krc4bvqnhijz1q0pfr0nfahghfjifci8rh1q4i5zd0xz5"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."))
+     `(#:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (synopsis "Parsing library based on Earley Algorithm")
     (description "Earley is a parser combinator library base on Earley's
 algorithm.  It is intended to be used in conjunction with an OCaml syntax
@@ -3636,16 +3740,16 @@ Mercurial's @code{https://www.selenic.com/blog/?p=663, unified test
 format}.  @code{craml} is released as a single binary (called @code{craml}).")
     (license license:isc)))
 
-(define-public ocaml-merlin
+(define-public ocaml4.07-merlin
   (package
-    (name "ocaml-merlin")
+    (name "ocaml4.07-merlin")
     (version "3.2.2")
     (home-page "https://ocaml.github.io/merlin/")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocaml/merlin.git")
+             (url "https://github.com/ocaml/merlin")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -3653,14 +3757,16 @@ format}.  @code{craml} is released as a single binary (called @code{craml}).")
          "15ssgmwdxylbwhld9p1cq8x6kadxyhll5bfyf11dddj6cldna3hb"))))
     (build-system dune-build-system)
     (inputs
-     `(("ocaml-biniou" ,ocaml-biniou)
-       ("ocaml-yojson" ,ocaml-yojson)
-       ("ocaml-easy-format" ,ocaml-easy-format)))
+     `(("ocaml-biniou" ,(package-with-ocaml4.07 ocaml-biniou))
+       ("ocaml-yojson" ,(package-with-ocaml4.07 ocaml-yojson))
+       ("ocaml-easy-format" ,(package-with-ocaml4.07 ocaml-easy-format))))
     (native-inputs
      `(("ocaml-findlib" ,ocaml-findlib)))
     (arguments
-     '(#:jbuild? #t
-       #:tests? #f)) ;; Errors in tests in version 3.2.2
+     `(#:jbuild? #t
+       #:tests? #f ;; Errors in tests in version 3.2.2
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (synopsis "Context sensitive completion for OCaml in Vim and Emacs")
     (description "Merlin is an editor service that provides modern IDE
 features for OCaml.  Emacs and Vim support is provided out-of-the-box.
@@ -3668,9 +3774,9 @@ External contributors added support for Visual Studio Code, Sublime Text and
 Atom.")
     (license license:expat)))
 
-(define-public ocaml-gsl
+(define-public ocaml4.07-gsl
   (package
-    (name "ocaml-gsl")
+    (name "ocaml4.07-gsl")
     (version "1.24.0")
     (source
      (origin
@@ -3691,12 +3797,15 @@ Atom.")
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "src/config/discover.ml"
                (("/usr") (assoc-ref inputs "gsl")))
-             #t)))))
+             #t)))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib
+       #:dune ,ocaml4.07-dune))
     (inputs
      `(("gsl" ,gsl)))
     (propagated-inputs
-     `(("ocaml-base" ,ocaml-base)
-       ("ocaml-stdio" ,ocaml-stdio)))
+     `(("ocaml-base" ,ocaml4.07-base)
+       ("ocaml-stdio" ,ocaml4.07-stdio)))
     (home-page "https://mmottl.github.io/gsl-ocaml")
     (synopsis "Bindings to the GNU Scientific Library")
     (description
@@ -3704,9 +3813,9 @@ Atom.")
 the OCaml language.")
     (license license:gpl3+)))
 
-(define-public ocaml-gsl-1
+(define-public ocaml4.07-gsl-1
   (package
-    (inherit ocaml-gsl)
+    (inherit ocaml4.07-gsl)
     (version "1.19.3")
     (source (origin
               (method url-fetch)
@@ -3720,8 +3829,10 @@ the OCaml language.")
     (inputs
      `(("gsl" ,gsl)))
     (native-inputs
-     `(("ocamlbuild" ,ocamlbuild)))
-    (arguments '())
+     `(("ocamlbuild" ,(package-with-ocaml4.07 ocamlbuild))))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs '())))
 
 (define-public cubicle
@@ -3782,9 +3893,9 @@ an arbitrary number of processes.  Cache coherence protocols and mutual
 exclusion algorithms are typical examples of such systems.")
     (license license:asl2.0)))
 
-(define-public ocaml-sexplib0
+(define-public ocaml4.07-sexplib0
   (package
-    (name "ocaml-sexplib0")
+    (name "ocaml4.07-sexplib0")
     (version "0.11.0")
     (home-page "https://github.com/janestreet/sexplib0")
     (source
@@ -3799,7 +3910,9 @@ exclusion algorithms are typical examples of such systems.")
          "07v3ggyss7xhfv14bjk1n87sr42iqwj4cgjiv2lcdfkqk49i2bmi"))))
     (build-system dune-build-system)
     (arguments
-     '(#:tests? #f)) ;no tests
+     `(#:tests? #f ;no tests
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (synopsis "Library containing the definition of S-expressions and some
 base converters")
     (description "Part of Jane Street's Core library The Core suite of
@@ -3807,9 +3920,9 @@ libraries is an industrial strength alternative to OCaml's standard library
 that was developed by Jane Street, the largest industrial user of OCaml.")
 (license license:expat)))
 
-(define-public ocaml-parsexp
+(define-public ocaml4.07-parsexp
   (package
-    (name "ocaml-parsexp")
+    (name "ocaml4.07-parsexp")
     (version "0.11.0")
     (home-page "https://github.com/janestreet/parsexp")
     (source
@@ -3823,8 +3936,11 @@ that was developed by Jane Street, the largest industrial user of OCaml.")
         (base32
          "1nyq23s5igd8cf3n4qxprjvhbmb6ighb3fy5mw7hxl0mdgsw5fvz"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (inputs
-     `(("ocaml-sexplib0" ,ocaml-sexplib0)))
+     `(("ocaml-sexplib0" ,ocaml4.07-sexplib0)))
     (synopsis "S-expression parsing library")
     (description
      "This library provides generic parsers for parsing S-expressions from
@@ -3853,9 +3969,9 @@ s-expressions from files or other external sources, you should use
 parsexp_io.")
     (license license:expat)))
 
-(define-public ocaml-sexplib
+(define-public ocaml4.07-sexplib
   (package
-    (name "ocaml-sexplib")
+    (name "ocaml4.07-sexplib")
     (version "0.11.0")
     (home-page "https://github.com/janestreet/sexplib")
     (source
@@ -3869,10 +3985,13 @@ parsexp_io.")
         (base32
          "1qfl0m04rpcjvc4yw1hzh6r16jpwmap0sa9ax6zjji67dz4szpyb"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-     `(("ocaml-num" ,ocaml-num)
-       ("ocaml-parsexp" ,ocaml-parsexp)
-       ("ocaml-sexplib0" ,ocaml-sexplib0)))
+     `(("ocaml-num" ,(package-with-ocaml4.07 ocaml-num))
+       ("ocaml-parsexp" ,ocaml4.07-parsexp)
+       ("ocaml-sexplib0" ,ocaml4.07-sexplib0)))
     (synopsis
      "Library for serializing OCaml values to and from S-expressions")
     (description
@@ -3880,9 +3999,9 @@ parsexp_io.")
 functionality for parsing and pretty-printing s-expressions.")
     (license license:expat)))
 
-(define-public ocaml-base
+(define-public ocaml4.07-base
   (package
-    (name "ocaml-base")
+    (name "ocaml4.07-base")
     (version "0.11.1")
     (home-page "https://github.com/janestreet/base")
     (source
@@ -3897,14 +4016,16 @@ functionality for parsing and pretty-printing s-expressions.")
          "0j6xb4265jr41vw4fjzak6yr8s30qrnzapnc6rl1dxy8bjai0nir"))))
     (build-system dune-build-system)
     (propagated-inputs
-     `(("ocaml-sexplib0" ,ocaml-sexplib0)))
+     `(("ocaml-sexplib0" ,ocaml4.07-sexplib0)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (replace 'build
            ;; make warnings non fatal (jbuilder behaviour)
            (lambda _
-             (invoke "dune" "build" "@install" "--profile=release"))))))
+             (invoke "dune" "build" "@install" "--profile=release"))))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
   (synopsis
     "Full standard library replacement for OCaml")
   (description
@@ -3944,9 +4065,9 @@ 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 ocaml-stdio
+(define-public ocaml4.07-stdio
   (package
-    (name "ocaml-stdio")
+    (name "ocaml4.07-stdio")
     (version "0.11.0")
     (home-page "https://github.com/janestreet/stdio")
     (source
@@ -3961,10 +4082,12 @@ is now @code{Ocaml_common.Ast_helper}.")
          "1facajqhvq34g2wrg368y0ajxd6lrj5b3lyzyj0jhdmraxajjcwn"))))
     (build-system dune-build-system)
     (propagated-inputs
-     `(("ocaml-base" ,ocaml-base)
-       ("ocaml-sexplib0" ,ocaml-sexplib0)))
+     `(("ocaml-base" ,ocaml4.07-base)
+       ("ocaml-sexplib0" ,ocaml4.07-sexplib0)))
     (arguments
-     '(#:tests? #f)) ;no tests
+     `(#:tests? #f ;no tests
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (synopsis "Standard IO library for OCaml")
     (description
      "Stdio implements simple input/output functionalities for OCaml.  It
@@ -3999,9 +4122,9 @@ 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 ocaml-ppxlib
+(define-public ocaml4.07-ppxlib
   (package
-    (name "ocaml-ppxlib")
+    (name "ocaml4.07-ppxlib")
     (version "0.6.0")
     (home-page "https://github.com/ocaml-ppx/ppxlib")
     (source
@@ -4016,15 +4139,16 @@ as part of the same ocaml-migrate-parsetree driver.")
          "0my9x7sxb329h0lzshppdaawiyfbaw6g5f41yiy7bhl071rnlvbv"))))
     (build-system dune-build-system)
     (propagated-inputs
-     `(("ocaml-base" ,ocaml-base)
-       ("ocaml-compiler-libs" ,ocaml-compiler-libs)
-       ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-       ("ocaml-ppx-derivers" ,ocaml-ppx-derivers)
-       ("ocaml-stdio" ,ocaml-stdio)
-       ("ocaml-result" ,ocaml-result)
-       ("ocaml-sexplib0" ,ocaml-sexplib0)))
+     `(("ocaml-base" ,ocaml4.07-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" ,ocaml4.07-stdio)
+       ("ocaml-result" ,(package-with-ocaml4.07 ocaml-result))
+       ("ocaml-sexplib0" ,ocaml4.07-sexplib0)))
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-before 'check 'set-topfind
            (lambda* (#:key inputs #:allow-other-keys)
@@ -4042,7 +4166,9 @@ as part of the same ocaml-migrate-parsetree driver.")
                  (("#use \"topfind\";;" all)
                   (string-append "#directory \"" findlib-libdir "\"\n"
                                  all))))
-             #t)))))
+             #t)))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (synopsis
      "Base library and tools for ppx rewriters")
     (description
@@ -4060,14 +4186,14 @@ OCaml AST in the OCaml syntax;
 @end itemize")
     (license license:expat)))
 
-(define-public ocaml-ppx-compare
+(define-public ocaml4.07-ppx-compare
   (package
-    (name "ocaml-ppx-compare")
+    (name "ocaml4.07-ppx-compare")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_compare.git")
+                     (url "https://github.com/janestreet/ppx_compare")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4075,9 +4201,13 @@ OCaml AST in the OCaml syntax;
                 "06bq4m1bsm4jlx4g7wh5m99qky7xm4c2g52kaz6pv25hdn5agi2m"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "ppx_compare")))
     (home-page "https://github.com/janestreet/ppx_compare")
     (synopsis "Generation of comparison functions from types")
@@ -4089,9 +4219,9 @@ flexibility by allowing you to override them for a specific type and more safety
 by making sure that you only compare comparable values.")
     (license license:asl2.0)))
 
-(define-public ocaml-fieldslib
+(define-public ocaml4.07-fieldslib
   (package
-    (name "ocaml-fieldslib")
+    (name "ocaml4.07-fieldslib")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4104,11 +4234,14 @@ by making sure that you only compare comparable values.")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "fieldslib")))
     (home-page "https://github.com/janestreet/fieldslib")
     (synopsis "Syntax extension to record fields")
@@ -4117,9 +4250,9 @@ record fields, to get and set record fields, iterate and fold over all fields
 of a record and create new record values.")
     (license license:asl2.0)))
 
-(define-public ocaml-variantslib
+(define-public ocaml4.07-variantslib
   (package
-    (name "ocaml-variantslib")
+    (name "ocaml4.07-variantslib")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4132,11 +4265,14 @@ of a record and create new record values.")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "variantslib")))
     (home-page "https://github.com/janestreet/variantslib")
     (synopsis "OCaml variants as first class values")
@@ -4144,9 +4280,9 @@ of a record and create new record values.")
 standard library.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-fields-conv
+(define-public ocaml4.07-ppx-fields-conv
   (package
-    (name "ocaml-ppx-fields-conv")
+    (name "ocaml4.07-ppx-fields-conv")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4158,10 +4294,14 @@ standard library.")
                 "07zrd3qky2ppbfl55gpm90rvqa5860xgwcsvihrjmkrw6d0jirkc"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-fieldslib" ,ocaml-fieldslib)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-fieldslib" ,ocaml4.07-fieldslib)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "ppx_fields_conv")))
     (home-page "https://github.com/janestreet/ppx_fields_conv")
     (synopsis "Generation of accessor and iteration functions for ocaml records")
@@ -4171,14 +4311,14 @@ and set record fields, iterate and fold over all fields of a record and create
 new record values.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-sexp-conv
+(define-public ocaml4.07-ppx-sexp-conv
   (package
-    (name "ocaml-ppx-sexp-conv")
+    (name "ocaml4.07-ppx-sexp-conv")
     (version "0.11.2")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_sexp_conv.git")
+                     (url "https://github.com/janestreet/ppx_sexp_conv")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4186,9 +4326,13 @@ new record values.")
                 "0pqwnqy1xp309wvdcaax4lg02yk64lq2w03mbgfvf6ps5ry4gis9"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "ppx_sexp_conv")))
     (home-page "https://github.com/janestreet/ppx_sexp_conv")
     (synopsis "Generation of S-expression conversion functions from type definitions")
@@ -4196,14 +4340,14 @@ new record values.")
 definitions.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-variants-conv
+(define-public ocaml4.07-ppx-variants-conv
   (package
-    (name "ocaml-ppx-variants-conv")
+    (name "ocaml4.07-ppx-variants-conv")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_variants_conv.git")
+                     (url "https://github.com/janestreet/ppx_variants_conv")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4211,10 +4355,14 @@ definitions.")
                 "1yc0gsds5m2nv39zga8nnrca2n75rkqy5dz4xj1635ybz20hhbjd"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-variantslib" ,ocaml-variantslib)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-variantslib" ,ocaml4.07-variantslib)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties
       `((upstream-name . "ppx_variants_conv")))
     (home-page
@@ -4225,9 +4373,9 @@ definitions.")
 variant types.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-custom-printf
+(define-public ocaml4.07-ppx-custom-printf
   (package
-    (name "ocaml-ppx-custom-printf")
+    (name "ocaml4.07-ppx-custom-printf")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4239,10 +4387,14 @@ variant types.")
                 "11b73smf3g3bpd9lg014pr4rx285nk9mnk6g6464ph51jv0sqzhj"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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)))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "ppx_custom_printf")))
     (home-page "https://github.com/janestreet/ppx_custom_printf")
     (synopsis "Printf-style format-strings for user-defined string conversion")
@@ -4250,9 +4402,9 @@ variant types.")
 string conversion.")
     (license license:asl2.0)))
 
-(define-public ocaml-bin-prot
+(define-public ocaml4.07-bin-prot
   (package
-    (name "ocaml-bin-prot")
+    (name "ocaml4.07-bin-prot")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4264,13 +4416,17 @@ string conversion.")
                 "1rsd91gx36prj4whi76nsiz1bzpgal9nzyw3pxdz1alv4ilk2il6"))))
     (build-system dune-build-system)
     (inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-compare" ,ocaml-ppx-compare)
-        ("ocaml-ppx-custom-printf" ,ocaml-ppx-custom-printf)
-        ("ocaml-ppx-fields-conv" ,ocaml-ppx-fields-conv)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-ppx-variants-conv" ,ocaml-ppx-variants-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("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-sexp-conv" ,ocaml4.07-ppx-sexp-conv)
+        ("ocaml-ppx-variants-conv" ,ocaml4.07-ppx-variants-conv)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "bin_prot")))
     (home-page "https://github.com/janestreet/bin_prot")
     (synopsis "Binary protocol generator")
@@ -4287,7 +4443,7 @@ storage of large amounts of data.")
 (define-public ocaml-octavius
   (package
     (name "ocaml-octavius")
-    (version "1.2.1")
+    (version "1.2.2")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -4296,22 +4452,31 @@ storage of large amounts of data.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1ck6yj6z5rvqyl39rz87ca1bnk0f1dpgvlk115631hjh8bwpfvfq"))))
+                "1c5m51xcn2jv42kjjpklr6g63sgx1k885wfdp1yr4wrmiaj9cbpx"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'make-writable
+           (lambda _
+             (for-each (lambda (file)
+                         (chmod file #o644))
+                       (find-files "." "."))
+             #t)))))
     (properties `((upstream-name . "octavius")))
     (home-page "https://github.com/ocaml-doc/octavius")
     (synopsis "Ocamldoc comment syntax parser")
     (description "Octavius is a library to parse the `ocamldoc` comment syntax.")
     (license license:isc)))
 
-(define-public ocaml-ppx-hash
+(define-public ocaml4.07-ppx-hash
   (package
-    (name "ocaml-ppx-hash")
+    (name "ocaml4.07-ppx-hash")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_hash.git")
+                     (url "https://github.com/janestreet/ppx_hash")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4319,11 +4484,15 @@ storage of large amounts of data.")
                 "1p0ic6aijxlrdggpmycj12q3cy9xksbq2vq727215maz4snvlf5p"))))
     (build-system dune-build-system)
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-compare" ,ocaml-ppx-compare)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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)))
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (properties `((upstream-name . "ppx_hash")))
     (home-page "https://github.com/janestreet/ppx_hash")
     (synopsis "Generation of hash functions from type expressions and definitions")
@@ -4331,14 +4500,14 @@ storage of large amounts of data.")
 hash functions from type exrpessions and definitions.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-enumerate
+(define-public ocaml4.07-ppx-enumerate
   (package
-    (name "ocaml-ppx-enumerate")
+    (name "ocaml4.07-ppx-enumerate")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_enumerate.git")
+                     (url "https://github.com/janestreet/ppx_enumerate")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4346,11 +4515,14 @@ hash functions from type exrpessions and definitions.")
                 "0spx9k1v7vjjb6sigbfs69yndgq76v114jhxvzjmffw7q989cyhr"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f))                    ; no test suite
+     `(#:tests? #f; no test suite
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-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")
@@ -4359,9 +4531,9 @@ for the list of all values of a type (for a type which only has finitely
 many values).")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-bench
+(define-public ocaml4.07-ppx-bench
   (package
-    (name "ocaml-ppx-bench")
+    (name "ocaml4.07-ppx-bench")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4374,20 +4546,23 @@ many values).")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-ppx-inline-test" ,ocaml-ppx-inline-test)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-ppx-inline-test" ,ocaml4.07-ppx-inline-test)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-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")
     (description "Syntax extension for writing in-line benchmarks in ocaml code.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-here
+(define-public ocaml4.07-ppx-here
   (package
-    (name "ocaml-ppx-here")
+    (name "ocaml4.07-ppx-here")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4400,11 +4575,14 @@ many values).")
     (build-system dune-build-system)
     (arguments
      ;; broken tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_here")))
     (home-page "https://github.com/janestreet/ppx_here")
     (synopsis "Expands [%here] into its location")
@@ -4412,9 +4590,9 @@ many values).")
       "Part of the Jane Street's PPX rewriters collection.")
     (license license:asl2.0)))
 
-(define-public ocaml-typerep
+(define-public ocaml4.07-typerep
   (package
-    (name "ocaml-typerep")
+    (name "ocaml4.07-typerep")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4426,16 +4604,18 @@ many values).")
                 "1zi7hy0prpgzqhr4lkacr04wvlvbp21jfbdfvffhrm6cd400rb5v"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f))
-    (propagated-inputs `(("ocaml-base" ,ocaml-base)))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
+    (propagated-inputs `(("ocaml-base" ,ocaml4.07-base)))
     (home-page "https://github.com/janestreet/typerep")
     (synopsis "Typerep is a library for runtime types")
     (description "Typerep is a library for runtime types.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-sexp-value
+(define-public ocaml4.07-ppx-sexp-value
   (package
-    (name "ocaml-ppx-sexp-value")
+    (name "ocaml4.07-ppx-sexp-value")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4446,12 +4626,16 @@ many values).")
                (base32
                 "1xnalfrln6k5khsyxvxkg6v32q8fpr4cqamsjqfih29jdv486xrs"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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)))
     (properties `((upstream-name . "ppx_sexp_value")))
     (home-page "https://github.com/janestreet/ppx_sexp_value")
     (synopsis "Simplify building s-expressions from ocaml values")
@@ -4459,9 +4643,9 @@ many values).")
 ocaml values.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-sexp-message
+(define-public ocaml4.07-ppx-sexp-message
   (package
-    (name "ocaml-ppx-sexp-message")
+    (name "ocaml4.07-ppx-sexp-message")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4472,12 +4656,16 @@ ocaml values.")
                (base32
                 "1yh440za0w9cvrbxbmqacir8715kdaw6sw24ys9xj80av9nqpiw7"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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)))
     (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")
@@ -4487,9 +4675,9 @@ where one needs to construct a s-expression based on various element of the
 context such as function arguments.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-pipebang
+(define-public ocaml4.07-ppx-pipebang
   (package
-    (name "ocaml-ppx-pipebang")
+    (name "ocaml4.07-ppx-pipebang")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4502,10 +4690,13 @@ context such as function arguments.")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_pipebang")))
     (home-page "https://github.com/janestreet/ppx_pipebang")
     (synopsis "Inline reverse application operators `|>` and `|!`")
@@ -4513,9 +4704,9 @@ context such as function arguments.")
 @code{|>} and @code{|!}.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-optional
+(define-public ocaml4.07-ppx-optional
   (package
-    (name "ocaml-ppx-optional")
+    (name "ocaml4.07-ppx-optional")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4528,11 +4719,14 @@ context such as function arguments.")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_optional")))
     (home-page "https://github.com/janestreet/ppx_optional")
     (synopsis "Pattern matching on flat options")
@@ -4541,9 +4735,9 @@ context such as function arguments.")
 else expression.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-optcomp
+(define-public ocaml4.07-ppx-optcomp
   (package
-    (name "ocaml-ppx-optcomp")
+    (name "ocaml4.07-ppx-optcomp")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4554,10 +4748,13 @@ else expression.")
                (base32
                 "1bb52p2j2h4s9f06vrcpla80rj93jinnzq6jzilapyx9q068929i"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-stdio" ,ocaml-stdio)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-stdio" ,ocaml4.07-stdio)
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_optcomp")))
     (home-page "https://github.com/janestreet/ppx_optcomp")
     (synopsis "Optional compilation for OCaml")
@@ -4566,9 +4763,9 @@ used to handle optional compilations of pieces of code depending of the word
 size, the version of the compiler, ...")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-let
+(define-public ocaml4.07-ppx-let
   (package
-    (name "ocaml-ppx-let")
+    (name "ocaml4.07-ppx-let")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4579,10 +4776,14 @@ size, the version of the compiler, ...")
                (base32
                 "1wdfw6w4xbg97a35yg6bif9gggxniy9ddnrjfw1a0inkl2yamxkj"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_let")))
     (home-page "https://github.com/janestreet/ppx_let")
     (synopsis "Monadic let-bindings")
@@ -4590,9 +4791,9 @@ size, the version of the compiler, ...")
 match expressions, and if expressions.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-fail
+(define-public ocaml4.07-ppx-fail
   (package
-    (name "ocaml-ppx-fail")
+    (name "ocaml4.07-ppx-fail")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4603,11 +4804,15 @@ match expressions, and if expressions.")
                (base32
                 "07plqsvljiwvngggfypwq55g46s5my55y45mvlmalrxyppzr03s8"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-ppx-here" ,ocaml4.07-ppx-here)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_fail")))
     (home-page "https://github.com/janestreet/ppx_fail")
     (synopsis "Add location to calls to failwiths")
@@ -4615,9 +4820,9 @@ match expressions, and if expressions.")
 position.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-assert
+(define-public ocaml4.07-ppx-assert
   (package
-    (name "ocaml-ppx-assert")
+    (name "ocaml4.07-ppx-assert")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4628,13 +4833,17 @@ position.")
                (base32
                 "17kd311n0l9f72gblf9kv8i5rghr106w37x4f0m5qwh6nlgl0j9k"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-compare" ,ocaml-ppx-compare)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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)))
     (properties `((upstream-name . "ppx_assert")))
     (home-page "https://github.com/janestreet/ppx_assert")
     (synopsis "Assert-like extension nodes that raise useful errors on failure")
@@ -4642,14 +4851,14 @@ position.")
 useful errors on failure.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-expect
+(define-public ocaml4.07-ppx-expect
   (package
-    (name "ocaml-ppx-expect")
+    (name "ocaml4.07-ppx-expect")
     (version "0.12.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_expect.git")
+                     (url "https://github.com/janestreet/ppx_expect")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4657,21 +4866,24 @@ useful errors on failure.")
                 "1wawsbjfkri4sw52n8xqrzihxc3xfpdicv3ahz83a1rsn4lb8j5q"))))
     (build-system dune-build-system)
     (arguments
-     `(#:jbuild? #t))
+     `(#:jbuild? #t
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-assert" ,ocaml-ppx-assert)
-        ("ocaml-ppx-compare" ,ocaml-ppx-compare)
-        ("ocaml-ppx-custom-printf" ,ocaml-ppx-custom-printf)
-        ("ocaml-ppx-fields-conv" ,ocaml-ppx-fields-conv)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-ppx-inline-test" ,ocaml-ppx-inline-test)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-ppx-variants-conv" ,ocaml-ppx-variants-conv)
-        ("ocaml-stdio" ,ocaml-stdio)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)
-        ("ocaml-re" ,ocaml-re)))
+      `(("ocaml-base" ,ocaml4.07-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))))
     (properties `((upstream-name . "ppx_expect")))
     (home-page "https://github.com/janestreet/ppx_expect")
     (synopsis "Cram like framework for OCaml")
@@ -4682,9 +4894,9 @@ output-generating code, interleaved with @code{%expect} extension expressions
 to denote the expected output.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-js-style
+(define-public ocaml4.07-ppx-js-style
   (package
-    (name "ocaml-ppx-js-style")
+    (name "ocaml4.07-ppx-js-style")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4697,12 +4909,15 @@ to denote the expected output.")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-octavius" ,ocaml-octavius)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-octavius" ,(package-with-ocaml4.07 ocaml-octavius))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_js_style")))
     (home-page "https://github.com/janestreet/ppx_js_style")
     (synopsis "Code style checker for Jane Street Packages")
@@ -4711,14 +4926,14 @@ to denote the expected output.")
 packages.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-typerep-conv
+(define-public ocaml4.07-ppx-typerep-conv
   (package
-    (name "ocaml-ppx-typerep-conv")
+    (name "ocaml4.07-ppx-typerep-conv")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_typerep_conv.git")
+                     (url "https://github.com/janestreet/ppx_typerep_conv")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4726,12 +4941,15 @@ packages.")
                 "0a13dpfrrg0rsm8qni1bh7pqcda30l70z8r6yzi5a64bmwk7g5ah"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."))
+     `(#:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-typerep" ,ocaml-typerep)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-typerep" ,ocaml4.07-typerep)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))
+        ("ocaml-ppxlib" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_typerep_conv")))
     (home-page "https://github.com/janestreet/ppx_typerep_conv")
     (synopsis "Generation of runtime types from type declarations")
@@ -4739,9 +4957,9 @@ packages.")
 from type definitions.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-base
+(define-public ocaml4.07-ppx-base
   (package
-    (name "ocaml-ppx-base")
+    (name "ocaml4.07-ppx-base")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4753,15 +4971,18 @@ from type definitions.")
                 "0aq206pg330jmj7lhcagiiwm3a0b3gsqm801m8ajd4ysyw7idkym"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."))
+     `(#:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-ppx-compare" ,ocaml-ppx-compare)
-        ("ocaml-ppx-enumerate" ,ocaml-ppx-enumerate)
-        ("ocaml-ppx-hash" ,ocaml-ppx-hash)
-        ("ocaml-ppx-js-style" ,ocaml-ppx-js-style)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-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" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_base")))
     (home-page "https://github.com/janestreet/ppx_base")
     (synopsis "Base set of ppx rewriters")
@@ -4771,14 +4992,14 @@ Note that Base doesn't need ppx to build, it is only used as a
 verification tool.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-bin-prot
+(define-public ocaml4.07-ppx-bin-prot
   (package
-    (name "ocaml-ppx-bin-prot")
+    (name "ocaml4.07-ppx-bin-prot")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/ppx_bin_prot.git")
+                     (url "https://github.com/janestreet/ppx_bin_prot")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4787,13 +5008,16 @@ verification tool.")
     (build-system dune-build-system)
     (arguments
      ;; Cyclic dependency with ocaml-ppx-jane
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-bin-prot" ,ocaml-bin-prot)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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)))
     (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")
@@ -4801,9 +5025,9 @@ verification tool.")
 functions from type definitions.")
     (license license:asl2.0)))
 
-(define-public ocaml-ppx-jane
+(define-public ocaml4.07-ppx-jane
   (package
-    (name "ocaml-ppx-jane")
+    (name "ocaml4.07-ppx-jane")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4815,28 +5039,31 @@ functions from type definitions.")
                 "0lgppkw3aixrfnixihrsz2ipafv8fpvkdpy3pw8n0r615gg8x8la"))))
     (build-system dune-build-system)
     (arguments
-     `(#:test-target "."))
+     `(#:test-target "."
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-ppx-assert" ,ocaml-ppx-assert)
-        ("ocaml-ppx-base" ,ocaml-ppx-base)
-        ("ocaml-ppx-bench" ,ocaml-ppx-bench)
-        ("ocaml-ppx-bin-prot" ,ocaml-ppx-bin-prot)
-        ("ocaml-ppx-custom-printf" ,ocaml-ppx-custom-printf)
-        ("ocaml-ppx-expect" ,ocaml-ppx-expect)
-        ("ocaml-ppx-fail" ,ocaml-ppx-fail)
-        ("ocaml-ppx-fields-conv" ,ocaml-ppx-fields-conv)
-        ("ocaml-ppx-here" ,ocaml-ppx-here)
-        ("ocaml-ppx-inline-test" ,ocaml-ppx-inline-test)
-        ("ocaml-ppx-let" ,ocaml-ppx-let)
-        ("ocaml-ppx-optcomp" ,ocaml-ppx-optcomp)
-        ("ocaml-ppx-optional" ,ocaml-ppx-optional)
-        ("ocaml-ppx-pipebang" ,ocaml-ppx-pipebang)
-        ("ocaml-ppx-sexp-message" ,ocaml-ppx-sexp-message)
-        ("ocaml-ppx-sexp-value" ,ocaml-ppx-sexp-value)
-        ("ocaml-ppx-typerep-conv" ,ocaml-ppx-typerep-conv)
-        ("ocaml-ppx-variants-conv" ,ocaml-ppx-variants-conv)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-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" ,ocaml4.07-ppxlib)))
     (properties `((upstream-name . "ppx_jane")))
     (home-page "https://github.com/janestreet/ppx_jane")
     (synopsis "Standard Jane Street ppx rewriters")
@@ -4844,9 +5071,9 @@ functions from type definitions.")
 driver including all standard Jane Street ppx rewriters.")
     (license license:asl2.0)))
 
-(define-public ocaml-splittable-random
+(define-public ocaml4.07-splittable-random
   (package
-    (name "ocaml-splittable-random")
+    (name "ocaml4.07-splittable-random")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4857,10 +5084,14 @@ driver including all standard Jane Street ppx rewriters.")
                (base32
                 "0l1wbd881mymlnpzlq5q53mmdz3g5d7qjhyc7lfaq1x0iaccn5lc"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-ppx-jane" ,ocaml-ppx-jane)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-ppx-jane" ,ocaml4.07-ppx-jane)
+        ("ocaml-migrate-parsetree"
+         ,(package-with-ocaml4.07 ocaml-migrate-parsetree))))
     (properties `((upstream-name . "splittable_random")))
     (home-page "https://github.com/janestreet/splittable_random")
     (synopsis "PRNG that can be split into independent streams")
@@ -4894,9 +5125,9 @@ cryptographic-quality randomness in favor of performance.")
 various Jane Street packages.")
     (license license:asl2.0)))
 
-(define-public ocaml-configurator
+(define-public ocaml4.07-configurator
   (package
-    (name "ocaml-configurator")
+    (name "ocaml4.07-configurator")
     (version "0.11.0")
     (source (origin
               (method url-fetch)
@@ -4909,10 +5140,12 @@ various Jane Street packages.")
     (build-system dune-build-system)
     (arguments
      ;; No tests
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-stdio" ,ocaml-stdio)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-stdio" ,ocaml4.07-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
@@ -4928,14 +5161,14 @@ Configurator allows one to:
 @end itemize")
     (license license:asl2.0)))
 
-(define-public ocaml-spawn
+(define-public ocaml4.07-spawn
   (package
-    (name "ocaml-spawn")
+    (name "ocaml4.07-spawn")
     (version "0.13.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/spawn.git")
+                     (url "https://github.com/janestreet/spawn")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4950,9 +5183,11 @@ Configurator allows one to:
              (substitute* "test/tests.ml"
                (("/bin/pwd") (which "pwd"))
                (("/bin/echo") (which "echo")))
-             #t)))))
+             #t)))
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (native-inputs
-     `(("ocaml-ppx-expect" ,ocaml-ppx-expect)))
+     `(("ocaml-ppx-expect" ,ocaml4.07-ppx-expect)))
     (home-page "https://github.com/janestreet/spawn")
     (synopsis "Spawning sub-processes")
     (description
@@ -4974,14 +5209,14 @@ thousands of times faster than fork.
 @end itemize")
     (license license:asl2.0)))
 
-(define-public ocaml-core
+(define-public ocaml4.07-core
   (package
-    (name "ocaml-core")
+    (name "ocaml4.07-core")
     (version "0.11.3")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/core.git")
+                     (url "https://github.com/janestreet/core")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4991,18 +5226,21 @@ thousands of times faster than fork.
     (arguments
      `(#:jbuild? #t
        ;; Require a cyclic dependency: core_extended
-       #:tests? #f))
+       #:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-configurator" ,ocaml-configurator)
-        ("ocaml-core-kernel" ,ocaml-core-kernel)
-        ("ocaml-ppx-assert" ,ocaml-ppx-assert)
-        ("ocaml-ppx-jane" ,ocaml-ppx-jane)
-        ("ocaml-sexplib" ,ocaml-sexplib)
-        ("ocaml-spawn" ,ocaml-spawn)
-        ("ocaml-stdio" ,ocaml-stdio)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)
-        ("ocaml-ppxlib" ,ocaml-ppxlib)))
+      `(("ocaml-base" ,ocaml4.07-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" ,ocaml4.07-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)))
     (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
@@ -5011,14 +5249,14 @@ standard library that was developed by Jane Street.")
     ;; by OCaml's license for consortium members (see THIRD-PARTY.txt).
     (license license:asl2.0)))
 
-(define-public ocaml-core-kernel
+(define-public ocaml4.07-core-kernel
   (package
-    (name "ocaml-core-kernel")
+    (name "ocaml4.07-core-kernel")
     (version "0.11.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/janestreet/core_kernel.git")
+                     (url "https://github.com/janestreet/core_kernel")
                      (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -5027,26 +5265,30 @@ standard library that was developed by Jane Street.")
     (build-system dune-build-system)
     (arguments
      ;; Cyclic dependency with ocaml-core
-     `(#:tests? #f))
+     `(#:tests? #f
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib))
     (propagated-inputs
-      `(("ocaml-base" ,ocaml-base)
-        ("ocaml-bin-prot" ,ocaml-bin-prot)
-        ("ocaml-configurator" ,ocaml-configurator)
-        ("ocaml-fieldslib" ,ocaml-fieldslib)
-        ("ocaml-jane-street-headers" ,ocaml-jane-street-headers)
-        ("ocaml-ppx-assert" ,ocaml-ppx-assert)
-        ("ocaml-ppx-base" ,ocaml-ppx-base)
-        ("ocaml-ppx-hash" ,ocaml-ppx-hash)
-        ("ocaml-ppx-inline-test" ,ocaml-ppx-inline-test)
-        ("ocaml-ppx-jane" ,ocaml-ppx-jane)
-        ("ocaml-ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
-        ("ocaml-ppx-sexp-message" ,ocaml-ppx-sexp-message)
-        ("ocaml-sexplib" ,ocaml-sexplib)
-        ("ocaml-splittable-random" ,ocaml-splittable-random)
-        ("ocaml-stdio" ,ocaml-stdio)
-        ("ocaml-typerep" ,ocaml-typerep)
-        ("ocaml-variantslib" ,ocaml-variantslib)
-        ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree)))
+      `(("ocaml-base" ,ocaml4.07-base)
+        ("ocaml-bin-prot" ,ocaml4.07-bin-prot)
+        ("ocaml-configurator" ,ocaml4.07-configurator)
+        ("ocaml-fieldslib" ,ocaml4.07-fieldslib)
+        ("ocaml-jane-street-headers"
+         ,(package-with-ocaml4.07 ocaml-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" ,ocaml4.07-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))))
     (properties `((upstream-name . "core_kernel")))
     (home-page "https://github.com/janestreet/core_kernel")
     (synopsis "Portable standard library for OCaml")
@@ -5063,7 +5305,7 @@ the full Core is not available, such as in Javascript.")
 (define-public ocaml-markup
   (package
     (name "ocaml-markup")
-    (version "0.8.1")
+    (version "0.8.2")
     (home-page "https://github.com/aantron/markup.ml")
     (source
      (origin
@@ -5074,14 +5316,20 @@ the full Core is not available, such as in Javascript.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0gzdjfnkv56vhmpvi9xpv1p05z50y55izhn156bkmb35s6izxds3"))))
+         "13zcrwzjmifniv3bvjbkd2ah8wwa3ld75bxh1d8hrzdvfxzh9szn"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:package "markup"))
+    (inputs
+     `(("libev" ,libev)))
     (propagated-inputs
      `(("ocaml-bisect-ppx" ,ocaml-bisect-ppx)
        ("ocaml-uchar" ,ocaml-uchar)
        ("ocaml-uutf" ,ocaml-uutf)
        ("ocaml-lwt" ,ocaml-lwt)))
-    (native-inputs `(("ocaml-ounit" ,ocaml-ounit)))
+    (native-inputs
+     `(("ocaml-ounit" ,ocaml-ounit)
+       ("pkg-config" ,pkg-config)))
     (synopsis "Error-recovering functional HTML5 and XML parsers and writers")
     (description "Markup.ml provides an HTML parser and an XML parser.  The
 parsers are wrapped in a simple interface: they are functions that transform
@@ -5111,7 +5359,7 @@ stream, and convert everything to UTF-8.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/ocsigen/tyxml.git")
+             (url "https://github.com/ocsigen/tyxml")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -5146,7 +5394,7 @@ combinators.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/aantron/bisect_ppx.git")
+             (url "https://github.com/aantron/bisect_ppx")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -5180,9 +5428,9 @@ Usage is simple - add package bisect_ppx when building tests, run your tests,
 then run the Bisect_ppx report tool on the generated visitation files.")
     (license license:mpl2.0)))
 
-(define-public ocaml-odoc
+(define-public ocaml4.07-odoc
   (package
-    (name "ocaml-odoc")
+    (name "ocaml4.07-odoc")
     (version "1.4.2")
     (source
      (origin
@@ -5194,20 +5442,24 @@ then run the Bisect_ppx report tool on the generated visitation files.")
        (sha256
         (base32 "0rvhx139jx6wmlfz355mja6mk03x4swq1xxvk5ky6jzhalq3cf5i"))))
     (build-system dune-build-system)
+    (arguments
+     `(#:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib
+       #:dune ,ocaml4.07-dune))
     (inputs
-     `(("ocaml-alcotest" ,ocaml-alcotest)
-       ("ocaml-markup" ,ocaml-markup)
-       ("ocaml-sexplib" ,ocaml-sexplib)
-       ("ocaml-re" ,ocaml-re)
-       ("ocaml-uutf" ,ocaml-uutf)))
+     `(("ocaml-alcotest" ,(package-with-ocaml4.07 ocaml-alcotest))
+       ("ocaml-markup" ,(package-with-ocaml4.07 ocaml-markup))
+       ("ocaml-sexplib" ,ocaml4.07-sexplib)
+       ("ocaml-re" ,(package-with-ocaml4.07 ocaml-re))
+       ("ocaml-uutf" ,(package-with-ocaml4.07 ocaml-uutf))))
     (native-inputs
-     `(("ocaml-astring" ,ocaml-astring)
-       ("ocaml-cmdliner" ,ocaml-cmdliner)
-       ("ocaml-cppo" ,ocaml-cppo)
-       ("ocaml-fpath" ,ocaml-fpath)
-       ("ocaml-result" ,ocaml-result)
-       ("ocaml-tyxml" ,ocaml-tyxml)
-       ("ocaml-bisect-ppx" ,ocaml-bisect-ppx)))
+     `(("ocaml-astring" ,(package-with-ocaml4.07 ocaml-astring))
+       ("ocaml-cmdliner" ,(package-with-ocaml4.07 ocaml-cmdliner))
+       ("ocaml-cppo" ,(package-with-ocaml4.07 ocaml-cppo))
+       ("ocaml-fpath" ,(package-with-ocaml4.07 ocaml-fpath))
+       ("ocaml-result" ,(package-with-ocaml4.07 ocaml-result))
+       ("ocaml-tyxml" ,(package-with-ocaml4.07 ocaml-tyxml))
+       ("ocaml-bisect-ppx" ,(package-with-ocaml4.07 ocaml-bisect-ppx))))
     (home-page "https://github.com/ocaml/odoc")
     (synopsis "OCaml documentation generator")
     (description "Odoc is a documentation generator for OCaml.  It reads
@@ -5219,15 +5471,15 @@ advantage over ocamldoc is an accurate cross-referencer, which handles the
 complexity of the OCaml module system.")
     (license license:isc)))
 
-(define-public ocaml-fftw3
+(define-public ocaml4.07-fftw3
   (package
-    (name "ocaml-fftw3")
+    (name "ocaml4.07-fftw3")
     (version "0.8.4")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/Chris00/fftw-ocaml.git")
+             (url "https://github.com/Chris00/fftw-ocaml")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -5236,13 +5488,16 @@ complexity of the OCaml module system.")
     (build-system dune-build-system)
     (arguments
      `(#:tests? #t
-       #:test-target "tests"))
+       #:test-target "tests"
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib
+       #:dune ,ocaml4.07-dune))
     (propagated-inputs
      `(("fftw" ,fftw)
        ("fftwf" ,fftwf)))
     (native-inputs
-     `(("ocaml-cppo" ,ocaml-cppo)
-       ("ocaml-lacaml" ,ocaml-lacaml)))
+     `(("ocaml-cppo" ,(package-with-ocaml4.07 ocaml-cppo))
+       ("ocaml-lacaml" ,ocaml4.07-lacaml)))
     (home-page
      "https://github.com/Chris00/fftw-ocaml")
     (synopsis
@@ -5252,15 +5507,15 @@ complexity of the OCaml module system.")
 library FFTW.")
     (license license:lgpl2.1))) ; with static linking exception.
 
-(define-public ocaml-lacaml
+(define-public ocaml4.07-lacaml
   (package
-    (name "ocaml-lacaml")
+    (name "ocaml4.07-lacaml")
     (version "11.0.5")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/mmottl/lacaml.git")
+             (url "https://github.com/mmottl/lacaml")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
@@ -5268,12 +5523,15 @@ library FFTW.")
          "180yb79a3qgx067qcpm50q12hrimjygf06rgkzbish9d1zfm670c"))))
     (build-system dune-build-system)
     (arguments
-     `(#:tests? #f)) ; No test target.
+     `(#:tests? #f ; No test target.
+       #:ocaml ,ocaml-4.07
+       #:findlib ,ocaml4.07-findlib
+       #:dune ,ocaml4.07-dune))
     (native-inputs
      `(("openblas" ,openblas)
        ("lapack" ,lapack)
-       ("ocaml-base" ,ocaml-base)
-       ("ocaml-stdio" ,ocaml-stdio)))
+       ("ocaml-base" ,ocaml4.07-base)
+       ("ocaml-stdio" ,ocaml4.07-stdio)))
     (home-page "https://mmottl.github.io/lacaml/")
     (synopsis
      "OCaml-bindings to BLAS and LAPACK")
@@ -5290,7 +5548,7 @@ convenience functions for vectors and matrices.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/Chris00/ocaml-cairo.git")
+                    (url "https://github.com/Chris00/ocaml-cairo")
                     (commit version)))
               (file-name (git-file-name name version))
               (sha256
@@ -5320,7 +5578,7 @@ and SVG file output.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/garrigue/lablgtk.git")
+                    (url "https://github.com/garrigue/lablgtk")
                     (commit version)))
               (file-name (git-file-name name version))
               (sha256