2016-12-22 19:56:33 +01:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
gnu: ocaml: Update to 4.7.0.
Update ocaml to the latest version and fixes dependent packages by
updating them or by adding new inputs, such as ocaml-num and ocamlbuild,
that were removed from the core ocaml package. Rename packages that
cannot be built with the new compiler with an ocaml4.02 prefix. Add
ocaml4.02 dependencies.
* gnu/packages/ocaml.scm (ocaml): Update to 4.7.0.
(ocaml-4.02, ocamlbuild, camlp4-4.02, ocaml-num, ocaml4.02-menhir)
(ocaml4.02-lablgtk, ocaml4.02-findlib, ocaml4.02-ounit, ocaml4.02-camlzip)
(ocaml4.02-ocamlmod, ocaml4.02-zarith, ocaml4.02-qcheck, ocaml4.02-qtest)
(ocaml4.02-stringext, ocaml4.02-bisect, dune, ocaml-migrate-parsetree)
(ocaml-ppx-tools-versioned, ocaml-ppx-tools-versioned)
(ocaml4.02-bitstring, ocaml4.02-result, ocaml4.02-topkg, ocaml4.02-rresult)
(ocaml4.02-sqlite3, ocaml4.02-csv, ocaml4.02-mtime, ocaml4.02-cmdliner)
(ocaml4.02-fmt, ocaml4.02-astring, ocaml4.02-alcotest, ocaml4.02-ppx-tools)
(ocaml4.02-react, ocaml4.02-ssl, ocaml4.02-lwt, ocaml-lwt-log)
(ocaml4.02-lwt-log, ocaml4.02-logs, ocaml4.02-fpath, ocaml4.02-bos)
(ocaml4.02-xmlm, ocaml4.02-ulex, ocaml4.02-uchar, ocaml4.02-uutf)
(ocaml4.02-jsonm, ocaml4.02-ocurl, ocaml4.02-base64, ocaml4.02-omake)
(ocaml4.02-batteries, ocaml4.02-pcre, ocaml4.02-oasis)
(ocaml4.02-js-build-tools, ocaml4.02-cppo, ocaml-seq, ocaml4.02-seq)
(ocaml4.02-re, ocaml4.02-ocplib-endian, ocaml4.02-easy-format)
(ocaml4.02-piqilib, ocaml4.02-uuidm, ocaml4.02-graph, ocaml4.02-piqi)
(ocaml4.02-camomile, ocaml4.02-zed, ocaml4.02-lambda-term): New packages.
(opam): Update to 2.0.0.
(camlp4): Update to 4.07+1.
(camlp5): Update to 7.06.
(hevea): Update to 2.32.
(coq)[inputs]: Add ocaml-num.
(emacs-tuareg): Update to 2.2.0.
(ocaml-menhir)[native-inputs]: Add ocamlbuild.
(ocaml-lablgtk): Update to 2.18.6.
(unison)[inputs]: Use ocaml-4.02.
(ocaml-findlib): Update to 1.8.0.
(ocaml-ounit)[native-inputs]: Add ocamlbuild.
(ocamlmod): Update to 0.0.9.
(ocaml-frontc)[arguments]: Use ocaml-4.02.
(ocaml-qcheck)[native-inputs]: Add ocamlbuild.
(ocaml-qtest)[native-inputs]: Remove ocaml-findlib and add ocamlbuild.
(ocaml-stringext)[native-inputs]: Add ocamlbuild.
(ocaml-bisect): Update to 1.3.1.
(ocaml4.01-bisect): Downgrade to 1.3.
(ocaml-bitstring): Update to 3.1.0.
(ocaml-topkg)[native-inputs]: Add ocamlbuild.
(ocaml-rresult)[native-inputs]: Add ocamlbuild.
(ocaml-sqlite3)[native-inputs]: Add ocamlbuild.
(ocaml-csv)[native-inputs]: Add ocamlbuild.
(ocaml-mtime)[native-inputs]: Add ocamlbuild.
(ocaml-cmdliner)[native-inputs]: Add ocamlbuild.
(ocaml-fmt)[native-inputs]: Add ocamlbuild.
(ocaml-astring)[native-inputs]: Add ocamlbuild.
(ocaml-alcotest)[native-inputs]: Add ocamlbuild.
(ocaml-ppx-tools)[native-inputs]: Add ocamlbuild.
(ocaml-react)[native-inputs]: Add ocamlbuild.
(ocaml-ssl)[arguments]: Return #t in phases.
(ocaml-lwt): Update to 4.1.0.
(ocaml-logs)[native-inputs]: Add ocamlbuild.
(ocaml-fpath)[native-inputs]: Add ocamlbuild.
(ocaml-bos)[native-inputs]: Add ocamlbuild.
(ocaml-xmlm): Update to 1.3.0.
(ocaml-ulex): Update to 1.2.0.
(ocaml-uchar)[native-inputs]: Add ocamlbuild.
(ocaml-uutf): Update to 1.0.1.
(ocaml-jsonm): Update to 1.0.1.
(ocaml-ocurl): Update to 0.8.2.
(ocaml-base64)[native-inputs]: Add ocamlbuild.
(ocamlify)[native-inputs]: Use ocaml-4.02.
(omake): Update to 0.10.3.
(ocaml-batteries): Update to 2.9.0.
(ocaml-pcre)[native-inputs]: Add ocamlbuild.
(ocaml-expect): Update 0.0.6.
(ocaml4.02-fileutils): Update to 0.5.3.
(ocaml-oasis): Update 0.4.11.
(ocaml-js-build-tools)[native-inputs]: Add ocamlbuild.
(ocaml-bin-prot): Rename to ocaml4.02-bin-prot.
(ocaml-fieldslib): Rename to ocaml4.02-fieldslib.
(ocaml-ppx-core): Rename to ocaml4.02-ppx-core.
(ocaml-ppx-optcomp): Rename to ocaml4.02-ppx-optcomp.
(ocaml-ppx-driver): Rename to ocaml4.02-ppx-driver.
(ocaml-cppo): Update to 1.6.5.
(ocaml-ppx-deriving): Rename to ocaml4.02-ppx-deriving.
(ocaml-ppx-type-conv): Rename to ocaml4.02-ppx-type-conv.
(ocaml-ppx-inline-test): Rename to ocaml4.02-ppx-inline-test.
(ocaml-ppx-bench): Rename to ocaml4.02-ppx-bench.
(ocaml-ppx-compare): Rename to ocaml4.02-ppx-compare.
(ocaml-sexplib): Rename to ocaml4.02-sexplib.
(ocaml-typerep): Rename to ocaml4.02-typerep.
(ocaml-variantslib): Rename to ocaml4.02-variantslib.
(ocaml-ppx-sexp-conv): Rename to ocaml4.02-ppx-sexp-conv.
(ocaml-ppx-variants-conv): Rename to ocaml4.02-ppx-variants-conv.
(ocaml-ppx-here): Rename to ocaml4.02-ppx-here.
(ocaml-ppx-assert): Rename to ocaml4.02-ppx-assert.
(ocaml-ppx-enumerate): Rename to ocaml4.02-ppx-enumerate.
(ocaml-ppx-let): Rename to ocaml4.02-ppx-let.
(ocaml-ppx-typerep-conv): Rename to ocaml4.02-ppx-typerep-conv.
(ocaml-ppx-sexp-value): Rename to ocaml4.02-ppx-sexp-value.
(ocaml-ppx-pipebang): Rename to ocaml4.02-ppx-pipebang.
(ocaml-ppx-bin-prot): Rename to ocaml4.02-ppx-bin-prot.
(ocaml-ppx-fail): Rename to ocaml4.02-ppx-fail.
(ocaml-ppx-custom-printf): Rename to ocaml4.02-ppx-custom-printf.
(ocaml-ppx-sexp-message): Rename to ocaml4.02-ppx-sexp-message.
(ocaml-ppx-fields-conv): Rename to ocaml4.02-ppx-fields-conv.
(ocaml-re): Update to 1.8.0.
(ocaml-ppx-expect): Rename to ocaml4.02-ppx-expect.
(ocaml-ppx-jane): Rename to ocaml4.02-ppx-jane.
(ocaml-core-kernel): Rename to ocaml4.02-core-kernel.
(ocaml-async-kernel): Rename to ocaml4.02-async-kernel.
(ocaml-async-rpc-kernel): Rename to ocaml4.02-async-rpc-kernel.
(ocaml-core): Rename to ocaml4.02-core.
(ocaml-async-unix): Rename to ocaml4.02-async-unix.
(ocaml-async-extra): Rename to ocaml4.02-async-extra.
(ocaml-async): Rename to ocaml4.02-async.
(ocaml-ocplib-endian)[native-inputs]: Update to 1.0.
(ocaml-cstruct): Rename to ocaml4.02-cstruct.
(ocaml-hex): Rename to ocaml4.02-hex.
(ocaml-ezjsonm): Rename to ocaml4.02-ezjsonm.
(ocaml-uri): Rename to ocaml4.02-uri.
(optcomp): Use ocaml-4.02.
(ocaml-piqilib): Update to 0.6.14.
(ocaml-uuidm)[native-inputs]: Add ocamlbuild.
(ocaml-graph): Update to 1.8.8.
(ocaml-piqi): Update to 0.7.6.
(bap): Update to 1.3.0.
(ocaml-camomile): Update to 1.0.1.
(ocaml-jbuilder): Use ocaml-4.02.
(ocaml-lambda-term): Update to 1.13.
(ocaml-utop): Update to 2.2.0.
(ocaml-integers)[native-inputs]: Add ocamlbuild.
(ocaml-ctypes): Update to 0.14.0.
(ocaml-ocb-stubblr)[native-inputs]: Add ocamlbuild.
(ocaml-tsdl)[native-inputs]: Add ocamlbuild.
* gnu/packages/machine-learning.scm (ocaml-mcl): Use ocaml-4.02.
* gnu/packages/maths.scm (cubicle): Update to 1.1.2.
* gnu/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch:
Update patch.
* guix/build-system/ocaml.scm: (default-ocaml4.02, default-ocaml4.02-findlib)
(package-with-ocaml4.02, strip-ocaml4.02-variant): New variables.
2018-11-17 17:55:44 +01:00
|
|
|
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
|
2017-01-02 13:23:34 +01:00
|
|
|
;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
|
2016-12-22 19:56:33 +01:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
(define-module (guix build-system ocaml)
|
|
|
|
#:use-module (guix store)
|
|
|
|
#:use-module (guix utils)
|
|
|
|
#:use-module (guix derivations)
|
|
|
|
#:use-module (guix search-paths)
|
|
|
|
#:use-module (guix build-system)
|
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (ice-9 match)
|
2017-01-02 13:23:34 +01:00
|
|
|
#:use-module (srfi srfi-1)
|
2016-12-22 19:56:33 +01:00
|
|
|
#:export (%ocaml-build-system-modules
|
2017-01-02 13:23:34 +01:00
|
|
|
package-with-ocaml4.01
|
|
|
|
strip-ocaml4.01-variant
|
2018-12-18 21:43:53 +01:00
|
|
|
default-findlib
|
|
|
|
default-ocaml
|
|
|
|
lower
|
2016-12-22 19:56:33 +01:00
|
|
|
ocaml-build
|
|
|
|
ocaml-build-system))
|
|
|
|
|
|
|
|
;; Commentary:
|
|
|
|
;;
|
|
|
|
;; Standard build procedure for packages using ocaml. This is implemented as an
|
|
|
|
;; extension of `gnu-build-system'.
|
|
|
|
;;
|
|
|
|
;; OCaml packages don't use a single standard for their build system. Some use
|
|
|
|
;; autotools, other use custom configure scripts with Makefiles, others use
|
|
|
|
;; oasis to generate the configure script and Makefile and lastly, some use
|
|
|
|
;; custom ocaml scripts.
|
|
|
|
;;
|
|
|
|
;; Each phase in the build system will try to figure out what the build system
|
|
|
|
;; is for that package. Most packages come with a custom configure script and
|
|
|
|
;; a Makefile that in turn call custom build tools. Packages built with oasis
|
|
|
|
;; will have a `setup.ml' file in the top directory, that can be used for all
|
|
|
|
;; phases. In that case the Makefile is here only to call that script. In case
|
|
|
|
;; the setup.ml do not work as expected, the @var{use-make} argument can be
|
|
|
|
;; used to ignore the setup.ml file and run make instead.
|
|
|
|
;;
|
|
|
|
;; Some packages use their own custom scripts, `pkg/pkg.ml' or
|
|
|
|
;; `pkg/build.ml'. They can be used here too.
|
|
|
|
;;
|
|
|
|
;; Code:
|
|
|
|
|
|
|
|
(define %ocaml-build-system-modules
|
|
|
|
;; Build-side modules imported by default.
|
|
|
|
`((guix build ocaml-build-system)
|
|
|
|
,@%gnu-build-system-modules))
|
|
|
|
|
|
|
|
(define (default-ocaml)
|
|
|
|
"Return the default OCaml package."
|
|
|
|
|
|
|
|
;; Do not use `@' to avoid introducing circular dependencies.
|
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref module 'ocaml)))
|
|
|
|
|
|
|
|
(define (default-findlib)
|
|
|
|
"Return the default OCaml-findlib package."
|
|
|
|
|
|
|
|
;; Do not use `@' to avoid introducing circular dependencies.
|
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref module 'ocaml-findlib)))
|
|
|
|
|
2018-12-18 21:43:53 +01:00
|
|
|
(define (default-dune-build-system)
|
|
|
|
"Return the dune-build-system."
|
|
|
|
|
|
|
|
;; Do not use `@' to avoid introducing circular dependencies.
|
|
|
|
(let ((module (resolve-interface '(guix build-system dune))))
|
|
|
|
(module-ref module 'dune-build-system)))
|
|
|
|
|
2017-01-02 13:23:34 +01:00
|
|
|
(define (default-ocaml4.01)
|
|
|
|
(let ((ocaml (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref ocaml 'ocaml-4.01)))
|
|
|
|
|
|
|
|
(define (default-ocaml4.01-findlib)
|
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref module 'ocaml4.01-findlib)))
|
|
|
|
|
|
|
|
(define* (package-with-explicit-ocaml ocaml findlib old-prefix new-prefix
|
|
|
|
#:key variant-property)
|
|
|
|
"Return a procedure of one argument, P. The procedure creates a package
|
|
|
|
with the same fields as P, which is assumed to use OCAML-BUILD-SYSTEM, such
|
|
|
|
that it is compiled with OCAML and FINDLIB instead. The inputs are changed
|
|
|
|
recursively accordingly. If the name of P starts with OLD-PREFIX, this is
|
|
|
|
replaced by NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name.
|
|
|
|
|
|
|
|
When VARIANT-PROPERTY is present, it is used as a key to search for
|
|
|
|
pre-defined variants of this transformation recorded in the 'properties' field
|
|
|
|
of packages. The property value must be the promise of a package. This is a
|
|
|
|
convenient way for package writers to force the transformation to use
|
|
|
|
pre-defined variants."
|
|
|
|
(define package-variant
|
|
|
|
(if variant-property
|
|
|
|
(lambda (package)
|
|
|
|
(assq-ref (package-properties package)
|
|
|
|
variant-property))
|
|
|
|
(const #f)))
|
|
|
|
|
|
|
|
(define (transform p)
|
|
|
|
(cond
|
|
|
|
;; If VARIANT-PROPERTY is present, use that.
|
|
|
|
((package-variant p)
|
|
|
|
=> force)
|
|
|
|
|
|
|
|
;; Otherwise build the new package object graph.
|
2018-12-18 21:43:53 +01:00
|
|
|
((or (eq? (package-build-system p) ocaml-build-system)
|
|
|
|
(eq? (package-build-system p) (default-dune-build-system)))
|
2017-01-02 13:23:34 +01:00
|
|
|
(package
|
|
|
|
(inherit p)
|
|
|
|
(location (package-location p))
|
|
|
|
(name (let ((name (package-name p)))
|
|
|
|
(string-append new-prefix
|
|
|
|
(if (string-prefix? old-prefix name)
|
|
|
|
(substring name
|
|
|
|
(string-length old-prefix))
|
|
|
|
name))))
|
|
|
|
(arguments
|
|
|
|
(let ((ocaml (if (promise? ocaml) (force ocaml) ocaml))
|
|
|
|
(findlib (if (promise? findlib) (force findlib) findlib)))
|
|
|
|
(ensure-keyword-arguments (package-arguments p)
|
|
|
|
`(#:ocaml ,ocaml
|
|
|
|
#:findlib ,findlib))))))
|
|
|
|
(else p)))
|
|
|
|
|
|
|
|
(define (cut? p)
|
2018-12-18 21:43:53 +01:00
|
|
|
(or (not (or (eq? (package-build-system p) ocaml-build-system)
|
|
|
|
(eq? (package-build-system p) (default-dune-build-system))))
|
2017-01-02 13:23:34 +01:00
|
|
|
(package-variant p)))
|
|
|
|
|
|
|
|
(package-mapping transform cut?))
|
|
|
|
|
|
|
|
(define package-with-ocaml4.01
|
|
|
|
(package-with-explicit-ocaml (delay (default-ocaml4.01))
|
|
|
|
(delay (default-ocaml4.01-findlib))
|
|
|
|
"ocaml-" "ocaml4.01-"
|
|
|
|
#:variant-property 'ocaml4.01-variant))
|
|
|
|
|
|
|
|
(define (strip-ocaml4.01-variant p)
|
|
|
|
"Remove the 'ocaml4.01-variant' property from P."
|
|
|
|
(package
|
|
|
|
(inherit p)
|
|
|
|
(properties (alist-delete 'ocaml4.01-variant (package-properties p)))))
|
|
|
|
|
2016-12-22 19:56:33 +01:00
|
|
|
(define* (lower name
|
|
|
|
#:key source inputs native-inputs outputs system target
|
|
|
|
(ocaml (default-ocaml))
|
|
|
|
(findlib (default-findlib))
|
|
|
|
#:allow-other-keys
|
|
|
|
#:rest arguments)
|
|
|
|
"Return a bag for NAME."
|
|
|
|
(define private-keywords
|
|
|
|
'(#:source #:target #:ocaml #:findlib #:inputs #:native-inputs))
|
|
|
|
|
|
|
|
(and (not target) ;XXX: no cross-compilation
|
|
|
|
(bag
|
|
|
|
(name name)
|
|
|
|
(system system)
|
|
|
|
(host-inputs `(,@(if source
|
|
|
|
`(("source" ,source))
|
|
|
|
'())
|
|
|
|
,@inputs
|
|
|
|
|
|
|
|
;; Keep the standard inputs of 'gnu-build-system'.
|
|
|
|
,@(standard-packages)))
|
|
|
|
(build-inputs `(("ocaml" ,ocaml)
|
|
|
|
("findlib" ,findlib)
|
|
|
|
,@native-inputs))
|
|
|
|
(outputs outputs)
|
|
|
|
(build ocaml-build)
|
|
|
|
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
|
|
|
|
|
|
|
(define* (ocaml-build store name inputs
|
|
|
|
#:key (guile #f)
|
|
|
|
(outputs '("out")) (configure-flags ''())
|
|
|
|
(search-paths '())
|
|
|
|
(make-flags ''())
|
|
|
|
(build-flags ''())
|
|
|
|
(out-of-source? #t)
|
|
|
|
(use-make? #f)
|
|
|
|
(tests? #t)
|
|
|
|
(test-flags ''("--enable-tests"))
|
|
|
|
(test-target "test")
|
|
|
|
(install-target "install")
|
|
|
|
(validate-runpath? #t)
|
|
|
|
(patch-shebangs? #t)
|
|
|
|
(strip-binaries? #t)
|
|
|
|
(strip-flags ''("--strip-debug"))
|
|
|
|
(strip-directories ''("lib" "lib64" "libexec"
|
|
|
|
"bin" "sbin"))
|
|
|
|
(phases '(@ (guix build ocaml-build-system)
|
|
|
|
%standard-phases))
|
|
|
|
(system (%current-system))
|
|
|
|
(imported-modules %ocaml-build-system-modules)
|
|
|
|
(modules '((guix build ocaml-build-system)
|
|
|
|
(guix build utils))))
|
|
|
|
"Build SOURCE using OCAML, and with INPUTS. This assumes that SOURCE
|
|
|
|
provides a 'setup.ml' file as its build system."
|
|
|
|
(define builder
|
|
|
|
`(begin
|
|
|
|
(use-modules ,@modules)
|
|
|
|
(ocaml-build #:source ,(match (assoc-ref inputs "source")
|
|
|
|
(((? derivation? source))
|
|
|
|
(derivation->output-path source))
|
|
|
|
((source)
|
|
|
|
source)
|
|
|
|
(source
|
|
|
|
source))
|
|
|
|
#:system ,system
|
|
|
|
#:outputs %outputs
|
|
|
|
#:inputs %build-inputs
|
|
|
|
#:search-paths ',(map search-path-specification->sexp
|
|
|
|
search-paths)
|
|
|
|
#:phases ,phases
|
|
|
|
#:configure-flags ,configure-flags
|
|
|
|
#:test-flags ,test-flags
|
|
|
|
#:make-flags ,make-flags
|
|
|
|
#:build-flags ,build-flags
|
|
|
|
#:out-of-source? ,out-of-source?
|
|
|
|
#:use-make? ,use-make?
|
|
|
|
#:tests? ,tests?
|
|
|
|
#:test-target ,test-target
|
|
|
|
#:install-target ,install-target
|
|
|
|
#:validate-runpath? ,validate-runpath?
|
|
|
|
#:patch-shebangs? ,patch-shebangs?
|
|
|
|
#:strip-binaries? ,strip-binaries?
|
|
|
|
#:strip-flags ,strip-flags
|
|
|
|
#:strip-directories ,strip-directories)))
|
|
|
|
|
|
|
|
(define guile-for-build
|
|
|
|
(match guile
|
|
|
|
((? package?)
|
|
|
|
(package-derivation store guile system #:graft? #f))
|
|
|
|
(#f ; the default
|
|
|
|
(let* ((distro (resolve-interface '(gnu packages commencement)))
|
|
|
|
(guile (module-ref distro 'guile-final)))
|
|
|
|
(package-derivation store guile system #:graft? #f)))))
|
|
|
|
|
|
|
|
(build-expression->derivation store name builder
|
|
|
|
#:system system
|
|
|
|
#:inputs inputs
|
|
|
|
#:modules imported-modules
|
|
|
|
#:outputs outputs
|
|
|
|
#:guile-for-build guile-for-build))
|
|
|
|
|
|
|
|
(define ocaml-build-system
|
|
|
|
(build-system
|
|
|
|
(name 'ocaml)
|
|
|
|
(description "The standard OCaml build system")
|
|
|
|
(lower lower)))
|
|
|
|
|
|
|
|
;;; ocaml.scm ends here
|