diff options
author | Alex Vong <alexvong1995@gmail.com> | 2018-11-19 12:07:44 +0100 |
---|---|---|
committer | Danny Milosavljevic <dannym@scratchpost.org> | 2018-11-19 12:07:44 +0100 |
commit | df730f675753e0a892ef0f1f1c346efc1053d78e (patch) | |
tree | 4ee4b22c3d1cd92f562849ac7d7dc078585c6c7a /doc/guix.texi | |
parent | 53f316ab904196cf20673f34209664b6249cb646 (diff) | |
download | patches-df730f675753e0a892ef0f1f1c346efc1053d78e.tar patches-df730f675753e0a892ef0f1f1c346efc1053d78e.tar.gz |
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'.
Diffstat (limited to 'doc/guix.texi')
-rw-r--r-- | doc/guix.texi | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 53ff744ea7..c2c778a28c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -53,6 +53,7 @@ Copyright @copyright{} 2018 Pierre-Antoine Rouby@* Copyright @copyright{} 2018 Gábor Boskovits@* Copyright @copyright{} 2018 Florian Pelz@* Copyright @copyright{} 2018 Laura Lazzati@* +Copyright @copyright{} 2018 Alex Vong@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -4395,6 +4396,63 @@ The @code{install} phase installs the binaries, and it also installs the source code and @file{Cargo.toml} file. @end defvr +@cindex Clojure (programming language) +@cindex simple Clojure build system +@defvr {Scheme Variable} clojure-build-system +This variable is exported by @code{(guix build-system clojure)}. It implements +a simple build procedure for @uref{https://clojure.org/, Clojure} packages +using plain old @code{compile} in Clojure. Cross-compilation is not supported +yet. + +It adds @code{clojure}, @code{icedtea} and @code{zip} to the set of inputs. +Different packages can be specified with the @code{#:clojure}, @code{#:jdk} and +@code{#:zip} parameters, respectively. + +A list of source directories, test directories and jar names can be specified +with the @code{#:source-dirs}, @code{#:test-dirs} and @code{#:jar-names} +parameters, respectively. Compile directory and main class can be specified +with the @code{#:compile-dir} and @code{#:main-class} parameters, respectively. +Other parameters are documented below. + +This build system is an extension of @var{ant-build-system}, but with the +following phases changed: + +@table @code + +@item build +This phase calls @code{compile} in Clojure to compile source files and runs +@command{jar} to create jars from both source files and compiled files +according to the include list and exclude list specified in +@code{#:aot-include} and @code{#:aot-exclude}, respectively. The exclude list +has priority over the include list. These lists consist of symbols +representing Clojure libraries or the special keyword @code{#:all} representing +all Clojure libraries found under the source directories. The parameter +@code{#:omit-source?} decides if source should be included into the jars. + +@item check +This phase runs tests according to the include list and exclude list specified +in @code{#:test-include} and @code{#:test-exclude}, respectively. Their +meanings are analogous to that of @code{#:aot-include} and +@code{#:aot-exclude}, except that the special keyword @code{#:all} now +stands for all Clojure libraries found under the test directories. The +parameter @code{#:tests?} decides if tests should be run. + +@item install +This phase installs all jars built previously. +@end table + +Apart from the above, this build system also contains an additional phase: + +@table @code + +@item install-doc +This phase installs all top-level files with base name matching +@var{%doc-regex}. A different regex can be specified with the +@code{#:doc-regex} parameter. All files (recursively) inside the documentation +directories specified in @code{#:doc-dirs} are installed as well. +@end table +@end defvr + @defvr {Scheme Variable} cmake-build-system This variable is exported by @code{(guix build-system cmake)}. It implements the build procedure for packages using the |