summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-08-17 11:19:14 +0200
committerLudovic Courtès <ludo@gnu.org>2026-08-20 18:25:42 +0200
commitf55efecab1db9e8e92f817efc7ac5ebd6dba462b (patch)
tree8537a0efad491f01b02fd0454c20668358a5a14a
parent1cd4083d29612fa0b5b6e32b15bd96a5f710f90d (diff)
doc: Improve documentation of ‘trivial-build-system’.
* doc/guix.texi (Build Systems): Fold the trivial build system intro under ‘trivial-build-system’; refer to gexps instead of ‘build-expression->derivation’; add an example; add cross-reference to ‘copy-build-system’. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #10608
-rw-r--r--doc/guix.texi40
1 files changed, 31 insertions, 9 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index e7f1826542d..d39d4c9aa22 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -10184,6 +10184,7 @@ because CHICKEN doesn't embed absolute references in compiled eggs.
10184Test dependencies should go to @code{native-inputs}, as usual. 10184Test dependencies should go to @code{native-inputs}, as usual.
10185@end defvar 10185@end defvar
10186 10186
10187@anchor{copy-build-system}
10187@defvar copy-build-system 10188@defvar copy-build-system
10188This variable is exported by @code{(guix build-system copy)}. It 10189This variable is exported by @code{(guix build-system copy)}. It
10189supports builds of simple packages that don't require much compiling, 10190supports builds of simple packages that don't require much compiling,
@@ -11275,18 +11276,39 @@ dependencies.
11275 11276
11276@end defvar 11277@end defvar
11277 11278
11278Lastly, for packages that do not need anything as sophisticated, a
11279``trivial'' build system is provided. It is trivial in the sense that
11280it provides basically no support: it does not pull any implicit inputs,
11281and does not have a notion of build phases.
11282
11283@defvar trivial-build-system 11279@defvar trivial-build-system
11284This variable is exported by @code{(guix build-system trivial)}. 11280This variable is exported by @code{(guix build-system trivial)}.
11285 11281
11286This build system requires a @code{#:builder} argument. This argument 11282This build system requires a @code{#:builder} argument; it is
11287must be a Scheme expression that builds the package output(s)---as 11283``trivial'' in the sense that it does nothing but what @code{#:builder}
11288with @code{build-expression->derivation} (@pxref{Derivations, 11284specifies, and in particular it lacks the notion of build phases
11289@code{build-expression->derivation}}). 11285commonly found in other build systems and provides zero implicit inputs.
11286The @code{#:builder} argument must be a gexp that builds the package
11287output(s) (@pxref{G-Expressions}).
11288
11289The example below produces an empty package:
11290
11291@lisp
11292(package
11293 (name "empty")
11294 (version "0")
11295 (source #f) ;no source
11296 (build-system trivial-build-system)
11297 (arguments
11298 ;; Create the output directory and nothing more.
11299 (list #:builder #~(mkdir #$output)))
11300 ;; @dots{}
11301 (license #f))
11302@end lisp
11303
11304@cindex meta-package, with @code{trivial-build-system}
11305This build system is useful to create @dfn{meta-packages} as empty
11306packages that propagate a number of packages---thus installing one such
11307meta-package in a profile also installs all these other packages.
11308
11309@xref{copy-build-system, @code{copy-build-system}}, for a slightly more
11310elaborate build system that makes it easy to copy files from package
11311source to package output.
11290@end defvar 11312@end defvar
11291 11313
11292@defvar channel-build-system 11314@defvar channel-build-system