diff options
| author | Giacomo Leidi <goodoldpaul@autistici.org> | 2025-10-01 16:47:19 +0200 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-11-09 19:56:46 +0000 |
| commit | 3dab48ccbb7123ec37507311e5100c6928a7750d (patch) | |
| tree | d86a6828f6266d83aca70282b18218adbc09cff6 | |
| parent | 80554b297bf56fe03579ebecb24536b0e76ee5e7 (diff) | |
doc: Add mix-build-system.
* doc/guix.texi: Document mix-build-system and its most common keyword
arguments.
* gnu/build-system/mix.scm: Update links to documentation without hard
coding an Elixir version.
Change-Id: I68eb76efaaf5639f0eac2d9b674cdb05008e15a4
Reviewed-by: Hartmut Goebel <h.goebel@crazy-compilers.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
| -rw-r--r-- | doc/guix.texi | 28 | ||||
| -rw-r--r-- | guix/build-system/mix.scm | 8 |
2 files changed, 32 insertions, 4 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 8ce1492a3b4..95e9ebb35bb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10116,6 +10116,34 @@ directory, the parameter @code{#:javascript-files} can be used to specify a list of file names to feed to the minifier. @end defvar +@defvar mix-build-system +This is a variable exported by @code{guix build-system mix}. It implements +the standard build procedure used by Elixr programs with +@url{https://hexdocs.pm/mix/Mix.html,Mix}, which consists +of running @command{mix compile}, thereby creating bytecode. + +The API is similar to the @var{gnu-build-system}, with some specifics for +Elixir: +@itemize +@item +@code{#:tests?} is a boolean, @code{#true} by default, determining whether tests +for the current build have to be run or not. +@item +@code{#:test-flags} is a list of arguments append to the @command{mix test} +invocation. It defaults to @code{'()}. +@item +@code{#:mix-exs}, changes the full path to the @code{mix.exs} +file. It defaults to @code{"mix.exs"}. Please refer to +@url{https://hexdocs.pm/mix/Mix.html#module-environment-variables,upstream} +documentation for more details. +@item +@code{#:mix-path}, appends extra code paths. It +defaults to @code{#f}. Please refer to +@url{https://hexdocs.pm/mix/Mix.html#module-environment-variables,upstream} +documentation for more details. +@end itemize +@end defvar + @defvar mozilla-build-system This variable is exported by @code{(guix build-system mozilla)}. It sets the @code{--target} and @code{--host} configuration flags to what diff --git a/guix/build-system/mix.scm b/guix/build-system/mix.scm index 4bfa4dcf0cb..e929e1df526 100644 --- a/guix/build-system/mix.scm +++ b/guix/build-system/mix.scm @@ -66,9 +66,9 @@ See: https://github.com/hexpm/specifications/blob/main/endpoints.md" ;; A number of environment variables specific to the Mix build system are ;; reflected here. They are documented at -;; https://hexdocs.pm/mix/1.15.7/Mix.html#module-environment-variables. Other +;; https://hexdocs.pm/mix/Mix.html#module-environment-variables. Other ;; parameters located in mix.exs are defined at -;; https://hexdocs.pm/mix/1.15.7/Mix.Project.html#module-configuration +;; https://hexdocs.pm/mix/Mix.Project.html#module-configuration (define* (mix-build name inputs #:key @@ -90,9 +90,9 @@ See: https://github.com/hexpm/specifications/blob/main/endpoints.md" "Build SOURCE using Elixir, and with INPUTS." ;; Check the documentation of :build_per_environment here: - ;; https://hexdocs.pm/mix/1.15.7/Mix.Project.html#module-configuration And + ;; https://hexdocs.pm/mix/Mix.Project.html#module-configuration And ;; "Environments" here: - ;; https://hexdocs.pm/mix/1.15.7/Mix.html#module-environments + ;; https://hexdocs.pm/mix/Mix.html#module-environments (define mix-environments (if build-per-environment `("prod" ,@(if tests? '("test") '())) |
