From 564cf93f2aca60171b4b97559ffc6c952e73e8ed Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 17 Nov 2018 17:55:44 +0100 Subject: 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. --- guix/build-system/ocaml.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'guix/build-system') diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm index 34a22ecffa..e5b715f55d 100644 --- a/guix/build-system/ocaml.scm +++ b/guix/build-system/ocaml.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017 Julien Lepiller +;;; Copyright © 2016, 2017, 2018 Julien Lepiller ;;; Copyright © 2017 Ben Woodcroft ;;; ;;; This file is part of GNU Guix. @@ -28,7 +28,9 @@ #:use-module (srfi srfi-1) #:export (%ocaml-build-system-modules package-with-ocaml4.01 + package-with-ocaml4.02 strip-ocaml4.01-variant + strip-ocaml4.02-variant ocaml-build ocaml-build-system)) @@ -82,6 +84,14 @@ (let ((module (resolve-interface '(gnu packages ocaml)))) (module-ref module 'ocaml4.01-findlib))) +(define (default-ocaml4.02) + (let ((ocaml (resolve-interface '(gnu packages ocaml)))) + (module-ref ocaml 'ocaml-4.02))) + +(define (default-ocaml4.02-findlib) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml4.02-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 @@ -139,12 +149,24 @@ pre-defined variants." "ocaml-" "ocaml4.01-" #:variant-property 'ocaml4.01-variant)) +(define package-with-ocaml4.02 + (package-with-explicit-ocaml (delay (default-ocaml4.02)) + (delay (default-ocaml4.02-findlib)) + "ocaml-" "ocaml4.02-" + #:variant-property 'ocaml4.02-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))))) +(define (strip-ocaml4.02-variant p) + "Remove the 'ocaml4.02-variant' property from P." + (package + (inherit p) + (properties (alist-delete 'ocaml4.02-variant (package-properties p))))) + (define* (lower name #:key source inputs native-inputs outputs system target (ocaml (default-ocaml)) -- cgit v1.2.3 From df730f675753e0a892ef0f1f1c346efc1053d78e Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Mon, 19 Nov 2018 12:07:44 +0100 Subject: build-system: Add 'clojure-build-system'. * guix/build-system/clojure.scm, guix/build/clojure-build-system.scm: New files. * guix/build/clojure-utils.scm (@*, @@*): New macros. (%source-dirs, %test-dirs, %compile-dir, %main-class, %omit-source?, %aot-include, %aot-exclude, %tests?, %test-include, %test-exclude, %clojure-regex): New variables. (package-name->jar-names, canonicalize-relative-path, find-files*, file-sans-extension, relative-path->clojure-lib-string, find-clojure-libs, compiled-from?, include-list\exclude-list, eval-with-clojure, create-jar): New procedures. * Makefile.am (MODULES): Add them. * doc/guix.texi (Build Systems): Document 'clojure-build-system'. --- guix/build-system/clojure.scm | 195 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 guix/build-system/clojure.scm (limited to 'guix/build-system') diff --git a/guix/build-system/clojure.scm b/guix/build-system/clojure.scm new file mode 100644 index 0000000000..5a91bcba00 --- /dev/null +++ b/guix/build-system/clojure.scm @@ -0,0 +1,195 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Alex Vong +;;; +;;; 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 . + +(define-module (guix build-system clojure) + #:use-module (guix build clojure-utils) + #:use-module (guix build-system) + #:use-module (guix build-system ant) + #:use-module ((guix build-system gnu) + #:select (standard-packages) + #:prefix gnu:) + + #:use-module (guix derivations) + #:use-module (guix packages) + #:use-module ((guix search-paths) + #:select + ((search-path-specification->sexp . search-path-spec->sexp))) + #:use-module (guix utils) + + #:use-module (ice-9 match) + #:export (%clojure-build-system-modules + clojure-build + clojure-build-system)) + +;; Commentary: +;; +;; Standard build procedure for Clojure packages. +;; +;; Code: + +(define-with-docs %clojure-build-system-modules + "Build-side modules imported and used by default." + `((guix build clojure-build-system) + (guix build clojure-utils) + (guix build guile-build-system) + ,@%ant-build-system-modules)) + +(define-with-docs %default-clojure + "The default Clojure package." + (delay (@* (gnu packages lisp) clojure))) + +(define-with-docs %default-jdk + "The default JDK package." + (delay (@* (gnu packages java) icedtea))) + +(define-with-docs %default-zip + "The default ZIP package." + (delay (@* (gnu packages compression) zip))) + +(define* (lower name + #:key + source target + inputs native-inputs + (clojure (force %default-clojure)) + (jdk (force %default-jdk)) + (zip (force %default-zip)) + outputs system + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (let ((private-keywords '(#:source #:target + #:inputs #:native-inputs + #:clojure #:jdk #:zip))) + + (if target + (error "No cross-compilation for clojure-build-system yet: LOWER" + target) ; FIXME + (bag (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + ,@(gnu:standard-packages))) + (build-inputs `(("clojure" ,clojure) + ("jdk" ,jdk "jdk") + ("zip" ,zip) + ,@native-inputs)) + (outputs outputs) + (build clojure-build) + (arguments (strip-keyword-arguments private-keywords + arguments)))))) + +(define-with-docs source->output-path + "Convert source input to output path." + (match-lambda + (((? derivation? source)) + (derivation->output-path source)) + ((source) + source) + (source + source))) + +(define-with-docs maybe-guile->guile + "Find the right guile." + (match-lambda + ((and maybe-guile (? package?)) + maybe-guile) + (#f ; default + (@* (gnu packages commencement) guile-final)))) + +(define* (clojure-build store name inputs + #:key + (source-dirs `',%source-dirs) + (test-dirs `',%test-dirs) + (compile-dir %compile-dir) + + (jar-names `',(package-name->jar-names name)) + (main-class %main-class) + (omit-source? %omit-source?) + + (aot-include `',%aot-include) + (aot-exclude `',%aot-exclude) + + doc-dirs ; no sensible default + (doc-regex %doc-regex) + + (tests? %tests?) + (test-include `',%test-include) + (test-exclude `',%test-exclude) + + (phases '(@ (guix build clojure-build-system) + %standard-phases)) + (outputs '("out")) + (search-paths '()) + (system (%current-system)) + (guile #f) + + (imported-modules %clojure-build-system-modules) + (modules %clojure-build-system-modules)) + "Build SOURCE with INPUTS." + (let ((builder `(begin + (use-modules ,@modules) + (clojure-build #:name ,name + #:source ,(source->output-path + (assoc-ref inputs "source")) + + #:source-dirs ,source-dirs + #:test-dirs ,test-dirs + #:compile-dir ,compile-dir + + #:jar-names ,jar-names + #:main-class ,main-class + #:omit-source? ,omit-source? + + #:aot-include ,aot-include + #:aot-exclude ,aot-exclude + + #:doc-dirs ,doc-dirs + #:doc-regex ,doc-regex + + #:tests? ,tests? + #:test-include ,test-include + #:test-exclude ,test-exclude + + #:phases ,phases + #:outputs %outputs + #:search-paths ',(map search-path-spec->sexp + search-paths) + #:system ,system + #:inputs %build-inputs))) + + (guile-for-build (package-derivation store + (maybe-guile->guile guile) + system + #:graft? #f))) + + (build-expression->derivation store name builder + #:inputs inputs + #:system system + #:modules imported-modules + #:outputs outputs + #:guile-for-build guile-for-build))) + +(define clojure-build-system + (build-system + (name 'clojure) + (description "Simple Clojure build system using plain old 'compile'") + (lower lower))) + +;;; clojure.scm ends here -- cgit v1.2.3