2016-12-22 13:56:33 -05: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 11:55:44 -05:00
|
|
|
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
|
2017-01-02 07:23:34 -05:00
|
|
|
;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
|
2022-03-14 04:14:30 -04:00
|
|
|
;;; Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org>
|
2016-12-22 13:56:33 -05: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)
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 14:26:39 -04:00
|
|
|
#:use-module (guix gexp)
|
2016-12-22 13:56:33 -05:00
|
|
|
#: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 07:23:34 -05:00
|
|
|
#:use-module (srfi srfi-1)
|
2016-12-22 13:56:33 -05:00
|
|
|
#:export (%ocaml-build-system-modules
|
2020-01-21 19:12:09 -05:00
|
|
|
package-with-ocaml4.07
|
|
|
|
strip-ocaml4.07-variant
|
2020-10-15 16:34:38 -04:00
|
|
|
package-with-ocaml4.09
|
|
|
|
strip-ocaml4.09-variant
|
2018-12-18 15:43:53 -05:00
|
|
|
default-findlib
|
|
|
|
default-ocaml
|
|
|
|
lower
|
2016-12-22 13:56:33 -05: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 15:43:53 -05: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)))
|
|
|
|
|
2020-01-21 19:12:09 -05:00
|
|
|
(define (default-ocaml4.07)
|
2017-01-02 07:23:34 -05:00
|
|
|
(let ((ocaml (resolve-interface '(gnu packages ocaml))))
|
2020-01-21 19:12:09 -05:00
|
|
|
(module-ref ocaml 'ocaml-4.07)))
|
2017-01-02 07:23:34 -05:00
|
|
|
|
2020-01-21 19:12:09 -05:00
|
|
|
(define (default-ocaml4.07-findlib)
|
2017-01-02 07:23:34 -05:00
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
2020-01-21 19:12:09 -05:00
|
|
|
(module-ref module 'ocaml4.07-findlib)))
|
2017-01-02 07:23:34 -05:00
|
|
|
|
2020-01-22 21:24:01 -05:00
|
|
|
(define (default-ocaml4.07-dune)
|
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref module 'ocaml4.07-dune)))
|
|
|
|
|
2020-10-15 16:34:38 -04:00
|
|
|
(define (default-ocaml4.09)
|
|
|
|
(let ((ocaml (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref ocaml 'ocaml-4.09)))
|
|
|
|
|
|
|
|
(define (default-ocaml4.09-findlib)
|
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref module 'ocaml4.09-findlib)))
|
|
|
|
|
|
|
|
(define (default-ocaml4.09-dune)
|
|
|
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
|
|
|
(module-ref module 'ocaml4.09-dune)))
|
|
|
|
|
2020-01-22 21:24:01 -05:00
|
|
|
(define* (package-with-explicit-ocaml ocaml findlib dune old-prefix new-prefix
|
2017-01-02 07:23:34 -05:00
|
|
|
#: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.
|
|
|
|
|
2020-01-22 21:24:01 -05:00
|
|
|
When the package uses the DUNE-BUILD-SYSTEM, the procedure creates a package
|
|
|
|
with the same fields as P, such that it is compiled with OCAML, FINDLIB and DUNE
|
|
|
|
instead.
|
|
|
|
|
2017-01-02 07:23:34 -05:00
|
|
|
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 15:43:53 -05:00
|
|
|
((or (eq? (package-build-system p) ocaml-build-system)
|
|
|
|
(eq? (package-build-system p) (default-dune-build-system)))
|
2017-01-02 07:23:34 -05: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))
|
2020-01-22 21:24:01 -05:00
|
|
|
(findlib (if (promise? findlib) (force findlib) findlib))
|
|
|
|
(dune (if (promise? dune) (force dune) dune)))
|
2017-01-02 07:23:34 -05:00
|
|
|
(ensure-keyword-arguments (package-arguments p)
|
|
|
|
`(#:ocaml ,ocaml
|
2020-01-22 21:24:01 -05:00
|
|
|
#:findlib ,findlib
|
|
|
|
,@(if (eq? (package-build-system p)
|
|
|
|
(default-dune-build-system))
|
|
|
|
`(#:dune ,dune)
|
|
|
|
'())))))))
|
2017-01-02 07:23:34 -05:00
|
|
|
(else p)))
|
|
|
|
|
|
|
|
(define (cut? p)
|
2018-12-18 15:43:53 -05:00
|
|
|
(or (not (or (eq? (package-build-system p) ocaml-build-system)
|
|
|
|
(eq? (package-build-system p) (default-dune-build-system))))
|
2017-01-02 07:23:34 -05:00
|
|
|
(package-variant p)))
|
|
|
|
|
|
|
|
(package-mapping transform cut?))
|
|
|
|
|
2020-01-21 19:12:09 -05:00
|
|
|
(define package-with-ocaml4.07
|
|
|
|
(package-with-explicit-ocaml (delay (default-ocaml4.07))
|
|
|
|
(delay (default-ocaml4.07-findlib))
|
2020-01-22 21:24:01 -05:00
|
|
|
(delay (default-ocaml4.07-dune))
|
2020-01-21 19:12:09 -05:00
|
|
|
"ocaml-" "ocaml4.07-"
|
|
|
|
#:variant-property 'ocaml4.07-variant))
|
2017-01-02 07:23:34 -05:00
|
|
|
|
2020-01-21 19:12:09 -05:00
|
|
|
(define (strip-ocaml4.07-variant p)
|
|
|
|
"Remove the 'ocaml4.07-variant' property from P."
|
2017-01-02 07:23:34 -05:00
|
|
|
(package
|
|
|
|
(inherit p)
|
2020-01-21 19:12:09 -05:00
|
|
|
(properties (alist-delete 'ocaml4.07-variant (package-properties p)))))
|
2017-01-02 07:23:34 -05:00
|
|
|
|
2020-10-15 16:34:38 -04:00
|
|
|
(define package-with-ocaml4.09
|
|
|
|
(package-with-explicit-ocaml (delay (default-ocaml4.09))
|
|
|
|
(delay (default-ocaml4.09-findlib))
|
|
|
|
(delay (default-ocaml4.09-dune))
|
|
|
|
"ocaml-" "ocaml4.09-"
|
|
|
|
#:variant-property 'ocaml4.09-variant))
|
|
|
|
|
|
|
|
(define (strip-ocaml4.09-variant p)
|
|
|
|
"Remove the 'ocaml4.09-variant' property from P."
|
|
|
|
(package
|
|
|
|
(inherit p)
|
|
|
|
(properties (alist-delete 'ocaml4.09-variant (package-properties p)))))
|
|
|
|
|
2016-12-22 13:56:33 -05: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
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 14:26:39 -04:00
|
|
|
'(#:target #:ocaml #:findlib #:inputs #:native-inputs))
|
2016-12-22 13:56:33 -05:00
|
|
|
|
|
|
|
(and (not target) ;XXX: no cross-compilation
|
|
|
|
(bag
|
|
|
|
(name name)
|
|
|
|
(system system)
|
|
|
|
(host-inputs `(,@(if source
|
|
|
|
`(("source" ,source))
|
|
|
|
'())
|
2022-03-14 04:14:30 -04:00
|
|
|
,@inputs))
|
2016-12-22 13:56:33 -05:00
|
|
|
(build-inputs `(("ocaml" ,ocaml)
|
|
|
|
("findlib" ,findlib)
|
2022-03-14 04:14:30 -04:00
|
|
|
,@native-inputs
|
|
|
|
|
|
|
|
;; Keep the standard inputs of 'gnu-build-system'.
|
|
|
|
,@(standard-packages)))
|
2016-12-22 13:56:33 -05:00
|
|
|
(outputs outputs)
|
|
|
|
(build ocaml-build)
|
|
|
|
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
|
|
|
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 14:26:39 -04:00
|
|
|
(define* (ocaml-build name inputs
|
|
|
|
#:key
|
|
|
|
guile source
|
2016-12-22 13:56:33 -05:00
|
|
|
(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
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 14:26:39 -04:00
|
|
|
(with-imported-modules imported-modules
|
|
|
|
#~(begin
|
|
|
|
(use-modules #$@modules)
|
|
|
|
(ocaml-build #:source #$source
|
|
|
|
#:system #$system
|
2021-02-28 16:40:06 -05:00
|
|
|
#:outputs #$(outputs->gexp outputs)
|
|
|
|
#:inputs #$(input-tuples->gexp inputs)
|
build-system: Rewrite using gexps.
* guix/packages.scm (expand-input): Remove 'store', 'system', and
'cross-system' parameters; add #:native?. Rewrite to return
name/gexp-input tuples.
(bag->derivation): Adjust accordingly. Lower (bag-build bag).
(bag->cross-derivation): Ditto. Instead of #:native-drvs and
#:target-drvs, pass #:build-inputs, #:host-inputs, and #:target-inputs.
(%derivation-cache): Remove.
* gnu/packages/bootstrap.scm (raw-build): Turn into a monadic procedure.
* gnu/packages/commencement.scm (glibc-final)[arguments]: Use
'gexp-input' for the #:allowed-references argument.
* guix/build-system/cmake.scm (cmake-build): Remove 'store' parameter.
Switch to the use of gexps and 'gexp->derivation'.
(lower): Remove #:source from 'private-keywords'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build, lower):
Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/gnu.scm (gnu-build): Likewise, and remove
'canonicalize-reference'.
(gnu-cross-build): Likewise, and expect #:build-inputs, #:host-inputs,
and #:target-inputs instead of #:native-drvs and #:target-drvs.
(lower): Likewise.
* guix/build-system/perl.scm (perl-build, lower): Likewise.
* guix/build-system/python.scm (python-build, lower): Likewise.
* guix/build-system/ruby.scm (ruby-build, lower): Likewise.
* guix/build-system/waf.scm (waf-build, lower): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Remove.
(trivial-build): Remove 'store' parameter, change to gexps.
(trivial-cross-build): Ditto, and change to #:build-inputs & co.
* guix/build-system/cargo.scm (cargo-build): Change to 'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/guile.scm (guile-build, guile-cross-build):
Likewise.
* guix/build-system/meson.scm (meson-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/android-ndk.scm (android-ndk-build): Likewise.
* guix/build-system/ant.scm (ant-build): Likewise.
* guix/build-system/asdf.scm (asdf-build/source, asdf-build): Likewise.
* guix/build-system/chicken.scm (chicken-build): Likewise.
* guix/build-system/clojure.scm (clojure-build): Likewise.
(source->output-path, maybe-guile->guile): Remove.
* guix/build-system/dub.scm (dub-build): Likewise.
* guix/build-system/emacs.scm (emacs-build): Likewise.
* guix/build-system/go.scm (go-build): Likewise.
* guix/build-system/haskell.scm (haskell-build): Likewise.
* guix/build-system/julia.scm (julia-build): Likewise.
* guix/build-system/linux-module.scm (linux-module-build)
(linux-module-build-cross): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/minify.scm (minify-build): Likewise.
* guix/build-system/node.scm (node-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
* guix/build-system/r.scm (r-build): Likewise.
* guix/build-system/rakudo.scm (rakudo-build): Likewise.
* guix/build-system/renpy.scm (renpy-build): Likewise.
* tests/builders.scm ("gnu-build"): Call 'store-lower' on 'gnu-build'.
Pass #:source parameter.
* tests/packages.scm ("search paths"): Use 'abort-to-prompt' instead of
a normal return from the 'build' method.
("package->bag, sensitivity to %current-target-system"): Change 'build'
to match the new build system signature.
squash! build-system: Rewrite using gexps.
squash! build-system: Rewrite using gexps.
2015-03-28 14:26:39 -04:00
|
|
|
#: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))))
|
|
|
|
|
|
|
|
(gexp->derivation name builder
|
|
|
|
#:system system
|
|
|
|
#:target #f
|
|
|
|
#:guile-for-build guile))
|
2016-12-22 13:56:33 -05:00
|
|
|
|
|
|
|
(define ocaml-build-system
|
|
|
|
(build-system
|
|
|
|
(name 'ocaml)
|
|
|
|
(description "The standard OCaml build system")
|
|
|
|
(lower lower)))
|
|
|
|
|
|
|
|
;;; ocaml.scm ends here
|