diff options
Diffstat (limited to 'gnu/packages/ocaml.scm')
-rw-r--r-- | gnu/packages/ocaml.scm | 223 |
1 files changed, 161 insertions, 62 deletions
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 4cc530509a..369e819573 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org> ;;; Copyright © 2020 Marius Bakke <marius@gnu.org> +;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -132,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 @@ -144,7 +145,7 @@ "/ocaml-" version ".tar.xz")) (sha256 (base32 - "1v3z5ar326f3hzvpfljg4xj8b9lmbrl53fn57yih1bkbx3gr3yzj")))) + "0k4521c0p10c5ams6vjv5qkkjhmpkb0bfn04llcz46ah0f3r2jpa")))) (build-system gnu-build-system) (native-search-paths (list (search-path-specification @@ -202,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) @@ -229,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 @@ -672,49 +687,54 @@ the OCaml core distribution.") (license license:lgpl2.1+))); with linking exception (define-public emacs-tuareg - (package - (name "emacs-tuareg") - (version "2.2.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/ocaml/tuareg") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 "06zxnn85fk5087iq0zxc5l5n9fz8r0367wylmynbfhc9711vccy6")))) - (build-system gnu-build-system) - (native-inputs `(("emacs" ,emacs-minimal) - ("opam" ,opam))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'make-git-checkout-writable - (lambda _ - (for-each make-file-writable (find-files ".")) - #t)) - (delete 'configure) - (add-before 'install 'fix-install-path - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "Makefile" - (("/emacs/site-lisp") - (string-append (assoc-ref %outputs "out") - "/share/emacs/site-lisp/"))) - #t)) - (add-after 'install 'post-install - (lambda* (#:key outputs #:allow-other-keys) - (symlink "tuareg.el" - (string-append (assoc-ref outputs "out") - "/share/emacs/site-lisp/" - "tuareg-autoloads.el")) - #t))))) - (home-page "https://github.com/ocaml/tuareg") - (synopsis "OCaml programming mode, REPL, debugger for Emacs") - (description "Tuareg helps editing OCaml code, to highlight important + ;; Last upstream release on Sept., 14th, 2018, since then "Package cl + ;; deprecated" or 'lexical-binding' and others had been fixed. + (let ((commit "ccde45bbc292123ec20617f1af7f7e19f7481545") + (revision "0")) + (package + (name "emacs-tuareg") + (version (git-version "2.2.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ocaml/tuareg") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1yxv4bnqarilnpg5j7wywall8170hwvm0q4xx06yqjgcn8pq1lac")))) + (build-system gnu-build-system) + (native-inputs + `(("emacs" ,emacs-minimal) + ("opam" ,opam))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'make-git-checkout-writable + (lambda _ + (for-each make-file-writable (find-files ".")) + #t)) + (delete 'configure) + (add-before 'install 'fix-install-path + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "Makefile" + (("/emacs/site-lisp") + (string-append (assoc-ref %outputs "out") + "/share/emacs/site-lisp/"))) + #t)) + (add-after 'install 'post-install + (lambda* (#:key outputs #:allow-other-keys) + (symlink "tuareg.el" + (string-append (assoc-ref outputs "out") + "/share/emacs/site-lisp/" + "tuareg-autoloads.el")) + #t))))) + (home-page "https://github.com/ocaml/tuareg") + (synopsis "OCaml programming mode, REPL, debugger for Emacs") + (description "Tuareg helps editing OCaml code, to highlight important parts of the code, to run an OCaml REPL, and to run the OCaml debugger within Emacs.") - (license license:gpl2+))) + (license license:gpl2+)))) (define-public ocaml-menhir (package @@ -993,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 @@ -1287,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) @@ -1299,15 +1330,45 @@ following a very simple s-expression syntax.") #:tests? #f)) (propagated-inputs `(("ocaml-csexp" ,ocaml-csexp))) - (synopsis "") - (description ""))) + (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 +config.h files for instance. Among other things, dune-configurator allows one to: + +@itemize +@item test if a C program compiles +@item query pkg-config +@item import #define from OCaml header files +@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 @@ -1348,6 +1409,7 @@ following a very simple s-expression syntax.") #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 @@ -1364,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") @@ -1408,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"))) @@ -1472,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 @@ -2366,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 @@ -5704,6 +5797,12 @@ convenience functions for vectors and matrices.") (url "https://github.com/Chris00/ocaml-cairo") (commit version))) (file-name (git-file-name name version)) + (patches + (search-patches + ;; NOTE: This patch will be obsolete on the + ;; next tagged release. Remove it at that + ;; point. + "ocaml-cairo2-caml_ba_array-fix.patch")) (sha256 (base32 "0wzysis9fa850s68qh8vrvqc6svgllhwra3kzll2ibv0wmdqrich")))) @@ -5727,7 +5826,7 @@ and SVG file output.") (define-public lablgtk3 (package (name "lablgtk") - (version "3.0.beta8") + (version "3.1.1") (source (origin (method git-fetch) (uri (git-reference @@ -5736,7 +5835,7 @@ and SVG file output.") (file-name (git-file-name name version)) (sha256 (base32 - "08pgwnia240i2rw1rbgiahg673kwa7b6bvhsg3z4b47xr5sh9pvz")))) + "11qfc39cmwfwfpwmjh6wh98zwdv6p73bv8hqwcsss869vs1r7gmn")))) (build-system dune-build-system) (arguments `(#:tests? #t |