diff options
Diffstat (limited to 'gnu/packages/ocaml.scm')
-rw-r--r-- | gnu/packages/ocaml.scm | 112 |
1 files changed, 95 insertions, 17 deletions
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 30add4f6b4..2121263ab5 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -133,10 +133,10 @@ "/lib/ocaml/site-lib")) #:phases (modify-phases %standard-phases (delete 'configure)))) -(define-public ocaml-4.09 +(define-public ocaml-4.11 (package (name "ocaml") - (version "4.09.0") + (version "4.11.1") (source (origin (method url-fetch) (uri (string-append @@ -145,7 +145,7 @@ "/ocaml-" version ".tar.xz")) (sha256 (base32 - "1v3z5ar326f3hzvpfljg4xj8b9lmbrl53fn57yih1bkbx3gr3yzj")))) + "0k4521c0p10c5ams6vjv5qkkjhmpkb0bfn04llcz46ah0f3r2jpa")))) (build-system gnu-build-system) (native-search-paths (list (search-path-specification @@ -203,6 +203,20 @@ functional, imperative and object-oriented styles of programming.") ;; distributed under lgpl2.0. (license (list license:qpl license:lgpl2.0)))) +(define-public ocaml-4.09 + (package + (inherit ocaml-4.11) + (version "4.09.0") + (source (origin + (method url-fetch) + (uri (string-append + "http://caml.inria.fr/pub/distrib/ocaml-" + (version-major+minor version) + "/ocaml-" version ".tar.xz")) + (sha256 + (base32 + "1v3z5ar326f3hzvpfljg4xj8b9lmbrl53fn57yih1bkbx3gr3yzj")))))) + (define-public ocaml-4.07 (package (inherit ocaml-4.09) @@ -230,7 +244,7 @@ functional, imperative and object-oriented styles of programming.") "--prefix" out "--mandir" mandir)))))))))) -(define-public ocaml ocaml-4.09) +(define-public ocaml ocaml-4.11) (define-public ocamlbuild (package @@ -999,6 +1013,14 @@ compilers that can directly deal with packages.") `(("m4" ,m4) ("ocaml" ,ocaml-4.07))))) +(define-public ocaml4.09-findlib + (package + (inherit ocaml-findlib) + (name "ocaml4.09-findlib") + (native-inputs + `(("m4" ,m4) + ("ocaml" ,ocaml-4.09))))) + ;; note that some tests may hang for no obvious reason. (define-public ocaml-ounit (package @@ -1293,6 +1315,9 @@ release of Jane Street packages. It reads metadata from @file{dune} files following a very simple s-expression syntax.") (license license:expat))) +(define ocaml4.09-dune-bootstrap + (package-with-ocaml4.09 dune-bootstrap)) + (define-public dune-configurator (package (inherit dune-bootstrap) @@ -1305,6 +1330,7 @@ following a very simple s-expression syntax.") #:tests? #f)) (propagated-inputs `(("ocaml-csexp" ,ocaml-csexp))) + (properties `((ocaml4.09-variant . ,(delay ocaml4.09-dune-configurator)))) (synopsis "Dune helper library for gathering system configuration") (description "Dune-configurator is a small library that helps writing OCaml scripts that test features available on the system, in order to generate @@ -1317,12 +1343,32 @@ config.h files for instance. Among other things, dune-configurator allows one t @item generate config.h file @end itemize"))) +(define-public ocaml4.09-dune-configurator + (package + (inherit dune-configurator) + (name "ocaml4.09-dune-configurator") + (arguments + `(#:package "dune-configurator" + #:tests? #f + #:dune ,ocaml4.09-dune-bootstrap + #:ocaml ,ocaml-4.09 + #:findlib ,ocaml4.09-findlib)) + (propagated-inputs + `(("ocaml-csexp" ,ocaml4.09-csexp))))) + (define-public dune (package (inherit dune-bootstrap) (propagated-inputs `(("dune-configurator" ,dune-configurator))) - (properties `((ocaml4.07-variant . ,(delay ocaml4.07-dune)))))) + (properties `((ocaml4.07-variant . ,(delay ocaml4.07-dune)) + (ocaml4.09-variant . ,(delay ocaml4.09-dune)))))) + +(define-public ocaml4.09-dune + (package + (inherit ocaml4.09-dune-bootstrap) + (propagated-inputs + `(("dune-configurator" ,dune-configurator))))) (define-public ocaml4.07-dune (package @@ -1363,6 +1409,7 @@ config.h files for instance. Among other things, dune-configurator allows one t #t))))) (propagated-inputs `(("ocaml-result" ,ocaml-result))) + (properties `((ocaml4.09-variant . ,(delay ocaml4.09-csexp)))) (home-page "https://github.com/ocaml-dune/csexp") (synopsis "Parsing and printing of S-expressions in Canonical form") (description "This library provides minimal support for Canonical @@ -1379,6 +1426,18 @@ To avoid a dependency on a particular S-expression library, the only module of this library is parameterised by the type of S-expressions.") (license license:expat))) +(define-public ocaml4.09-csexp + (package + (inherit ocaml-csexp) + (name "ocaml4.09-csexp") + (arguments + `(#:ocaml ,ocaml-4.09 + #:findlib ,ocaml4.09-findlib + ,@(substitute-keyword-arguments (package-arguments ocaml-csexp) + ((#:dune _) ocaml4.09-dune-bootstrap)))) + (propagated-inputs + `(("ocaml-result" ,ocaml4.09-result))))) + (define-public ocaml-migrate-parsetree (package (name "ocaml-migrate-parsetree") @@ -1423,7 +1482,8 @@ functions to the next and/or previous version.") "07lnj4yzwvwyh5fhpp1dxrys4ddih15jhgqjn59pmgxinbnddi66")))) (build-system dune-build-system) (arguments - `(#:test-target ".")) + `(#:test-target "." + #:package "ppx_tools_versioned")) (propagated-inputs `(("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree))) (properties `((upstream-name . "ppx_tools_versioned"))) @@ -1487,12 +1547,23 @@ powerful.") (arguments `(#:test-target "." #:dune ,dune-bootstrap)) + (properties `((ocaml4.09-variant . ,(delay ocaml4.09-result)))) (home-page "https://github.com/janestreet/result") (synopsis "Compatibility Result module") (description "Uses the new result type defined in OCaml >= 4.03 while staying compatible with older version of OCaml should use the Result module defined in this library.") (license license:bsd-3))) + +(define-public ocaml4.09-result + (package + (inherit ocaml-result) + (name "ocaml4.09-result") + (arguments + `(#:test-target "." + #:dune ,ocaml4.09-dune-bootstrap + #:ocaml ,ocaml-4.09 + #:findlib ,ocaml4.09-findlib)))) (define-public ocaml-topkg (package @@ -2381,21 +2452,28 @@ radix-64 representation. It is specified in RFC 4648.") (base32 "1f0fghvlbfryf5h3j4as7vcqrgfjb4c8abl5y0y5h069vs4kp5ii")))) (build-system ocaml-build-system) (arguments - `(#:phases + `(#:tests? #f; no tests + #:phases (modify-phases %standard-phases - (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. + (delete 'configure) + (replace 'build + ;; This package uses pre-generated setup.ml by oasis, but is + ;; a dependency of oasis. the pre-generated setup.ml is broken + ;; with recent versions of OCaml, so we perform a bootstrap instead. (lambda _ - (setenv "OCAMLPARAM" "safe-string=0,_") + (substitute* "src/OCamlifyConfig.ml.ab" + (("$pkg_version") ,version)) + (rename-file "src/OCamlifyConfig.ml.ab" "src/OCamlifyConfig.ml") + (with-directory-excursion "src" + (invoke "ocamlc" "OCamlifyConfig.ml" "ocamlify.ml" "-o" + "ocamlify")) #t)) - (delete 'check) ; tests are run during the build - (replace 'configure + (replace 'install (lambda* (#:key outputs #:allow-other-keys) - (invoke "ocaml" "setup.ml" "-configure" "--prefix" - (assoc-ref outputs "out"))))))) - (native-inputs - `(("ocamlbuild" ,ocamlbuild))) + (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) + (mkdir-p bin) + (install-file "src/ocamlify" bin) + #t)))))) (home-page "https://forge.ocamlcore.org/projects/ocamlify") (synopsis "Include files in OCaml code") (description "OCamlify creates OCaml source code by including |