summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-02-28 21:30:50 +0100
committerLudovic Courtès <ludo@gnu.org>2021-03-30 22:48:44 +0200
commitf95fc73248e81a65e84798a344e0c781c1121f76 (patch)
tree05bcef6f526ca38e3e1879f8fd6149c25b1c6f47
parentda86e90efe796ee68ee0a5ccaf46f45cadb52336 (diff)
build-system: Use 'sexp->gexp' for plain sexps.
This reduces memory allocations and list traversals during 'gexp->sexp', 'gexp-inputs', etc. * guix/build-system/cargo.scm (cargo-build): Use 'sexp->gexp' for sexps known to not contain file-like objects. Change default #:phases to a symbol. * guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Likewise. * guix/build-system/copy.scm (copy-build): Likewise. * guix/build-system/font.scm (font-build): Likewise. * guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise. * guix/build-system/gnu.scm (%strip-flags, %strip-directories): New variables. (gnu-build): Use them. Use 'sexp->gexp' where appropriate. (gnu-cross-build): Likewise. * guix/build-system/meson.scm (meson-build): Likewise. * guix/build-system/perl.scm (perl-build): Likewise. * guix/build-system/python.scm (python-build): Likewise. * guix/build-system/ruby.scm (ruby-build): Likewise. * guix/build-system/scons.scm (scons-build): Likewise. * guix/build-system/texlive.scm (texlive-build): Likewise. * guix/build-system/trivial.scm (trivial-build): Likewise. * guix/build-system/waf.scm (waf-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. * guix/packages.scm (patch-and-repack): Use 'sexp->gexp' when SNIPPET is a pair. * guix/svn-download.scm (svn-multi-fetch): Use 'sexp->gexp' for 'svn-multi-reference-locations'.
-rw-r--r--guix/build-system/android-ndk.scm10
-rw-r--r--guix/build-system/ant.scm10
-rw-r--r--guix/build-system/asdf.scm20
-rw-r--r--guix/build-system/cargo.scm22
-rw-r--r--guix/build-system/chicken.scm10
-rw-r--r--guix/build-system/clojure.scm7
-rw-r--r--guix/build-system/cmake.scm25
-rw-r--r--guix/build-system/copy.scm17
-rw-r--r--guix/build-system/dub.scm10
-rw-r--r--guix/build-system/emacs.scm10
-rw-r--r--guix/build-system/font.scm12
-rw-r--r--guix/build-system/glib-or-gtk.scm16
-rw-r--r--guix/build-system/gnu.scm53
-rw-r--r--guix/build-system/go.scm8
-rw-r--r--guix/build-system/haskell.scm10
-rw-r--r--guix/build-system/julia.scm10
-rw-r--r--guix/build-system/linux-module.scm20
-rw-r--r--guix/build-system/maven.scm14
-rw-r--r--guix/build-system/meson.scm29
-rw-r--r--guix/build-system/minify.scm10
-rw-r--r--guix/build-system/node.scm10
-rw-r--r--guix/build-system/perl.scm13
-rw-r--r--guix/build-system/python.scm14
-rw-r--r--guix/build-system/qt.scm20
-rw-r--r--guix/build-system/r.scm10
-rw-r--r--guix/build-system/rakudo.scm10
-rw-r--r--guix/build-system/renpy.scm10
-rw-r--r--guix/build-system/ruby.scm14
-rw-r--r--guix/build-system/scons.scm20
-rw-r--r--guix/build-system/texlive.scm36
-rw-r--r--guix/build-system/trivial.scm10
-rw-r--r--guix/build-system/waf.scm12
-rw-r--r--guix/packages.scm4
-rw-r--r--guix/svn-download.scm4
34 files changed, 278 insertions, 232 deletions
diff --git a/guix/build-system/android-ndk.scm b/guix/build-system/android-ndk.scm
index d8896e2305..fa8b1e2f12 100644
--- a/guix/build-system/android-ndk.scm
+++ b/guix/build-system/android-ndk.scm
@@ -41,8 +41,7 @@
source
(tests? #t)
(test-target #f)
- (phases '(@ (guix build android-ndk-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(make-flags #~'())
(search-paths '())
@@ -55,7 +54,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(android-ndk-build #:name #$name
#:source #+source
@@ -70,8 +69,9 @@
"/share/android/build/core/main.mk")
#$make-flags)
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm
index cb48c4226c..08a4c996f9 100644
--- a/guix/build-system/ant.scm
+++ b/guix/build-system/ant.scm
@@ -110,8 +110,7 @@
(test-exclude (list "**/Abstract*.java"))
(source-dir "src")
(test-dir "src/test")
- (phases '(@ (guix build ant-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -124,7 +123,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(ant-build #:name #$name
#:source #+source
#:make-flags #$make-flags
@@ -141,8 +140,9 @@
#:test-dir #$test-dir
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index 5f01d7ccce..7bf2f97992 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -96,8 +96,7 @@
(define* (asdf-build/source name inputs
#:key source outputs
- (phases '(@ (guix build asdf-build-system)
- %standard-phases/source))
+ (phases '%standard-phases/source)
(search-paths '())
(system (%current-system))
(guile #f)
@@ -106,14 +105,15 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(asdf-build/source #:name #$name
#:source #+source
#:system #$system
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
@@ -272,8 +272,7 @@ set up using CL source package conventions."
(asd-files ''())
(asd-systems ''())
(test-asd-file #f)
- (phases '(@ (guix build asdf-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(search-paths '())
(system (%current-system))
(guile #f)
@@ -295,7 +294,7 @@ set up using CL source package conventions."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(parameterize ((%lisp (string-append
(assoc-ref %build-inputs #$lisp-type)
"/bin/" #$lisp-type))
@@ -309,8 +308,9 @@ set up using CL source package conventions."
#:tests? #$tests?
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs))))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index d29265de7d..0af0ce0233 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -84,8 +84,7 @@ to NAME and VERSION."
(features ''())
(skip-build? #f)
(install-source? #t)
- (phases '(@ (guix build cargo-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -98,21 +97,23 @@ to NAME and VERSION."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(cargo-build #:name #$name
#:source #+source
#:system #$system
#:test-target #$test-target
#:vendor-dir #$vendor-dir
- #:cargo-build-flags #$cargo-build-flags
- #:cargo-test-flags #$cargo-test-flags
- #:cargo-package-flags #$cargo-package-flags
- #:features #$features
+ #:cargo-build-flags #$(sexp->gexp cargo-build-flags)
+ #:cargo-test-flags #$(sexp->gexp cargo-test-flags)
+ #:cargo-package-flags #$(sexp->gexp cargo-package-flags)
+ #:features #$(sexp->gexp features)
#:skip-build? #$skip-build?
#:install-source? #$install-source?
#:tests? #$(and tests? (not skip-build?))
- #:phases #$phases
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:outputs (list #$@(map (lambda (name)
#~(cons #$name
(ungexp output name)))
@@ -120,8 +121,9 @@ to NAME and VERSION."
#:inputs (map (lambda (tuple)
(apply cons tuple))
'#$inputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)))))
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))))))
(gexp->derivation name builder
#:system system
diff --git a/guix/build-system/chicken.scm b/guix/build-system/chicken.scm
index 0989e7a79f..c6978266fc 100644
--- a/guix/build-system/chicken.scm
+++ b/guix/build-system/chicken.scm
@@ -75,8 +75,7 @@
(define* (chicken-build name inputs
#:key
source
- (phases '(@ (guix build chicken-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(egg-name "")
@@ -92,14 +91,15 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(chicken-build #:name #$name
#:source #+source
#:system #$system
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:egg-name #$egg-name
#:unpack-path #$unpack-path
#:build-flags #$build-flags
diff --git a/guix/build-system/clojure.scm b/guix/build-system/clojure.scm
index e2ad67e3b6..39b7f44e89 100644
--- a/guix/build-system/clojure.scm
+++ b/guix/build-system/clojure.scm
@@ -137,7 +137,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(clojure-build #:name #$name
#:source #+source
@@ -162,8 +162,9 @@
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-spec->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-spec->sexp
+ search-paths))
#:system #$system
#:inputs #$(input-tuples->gexp inputs)))))
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index f9ac2befc9..80059217c2 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -113,8 +113,7 @@
(strip-flags ''("--strip-debug"))
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
- (phases '(@ (guix build cmake-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(system (%current-system))
(substitutable? #t)
(imported-modules %cmake-build-system-modules)
@@ -125,17 +124,22 @@ provides a 'CMakeLists.txt' file as its build system."
(define build
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(cmake-build #:source #+source
#:system #$system
#:outputs %outputs
#:inputs %build-inputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
- #:phases #$phases
- #:configure-flags #$configure-flags
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
+ #:configure-flags #$(if (pair? configure-flags)
+ (sexp->gexp configure-flags)
+ configure-flags)
#:make-flags #$make-flags
#:out-of-source? #$out-of-source?
#:build-type #$build-type
@@ -146,8 +150,8 @@ provides a 'CMakeLists.txt' file as its build system."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories)))))
+ #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-directories #$(sexp->gexp strip-directories))))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
@@ -184,8 +188,7 @@ provides a 'CMakeLists.txt' file as its build system."
"--enable-deterministic-archives"))
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
- (phases '(@ (guix build cmake-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(substitutable? #t)
(system (%current-system))
(build (nix-system->gnu-triplet system))
diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm
index 8dea0b4c6b..4894ba46fb 100644
--- a/guix/build-system/copy.scm
+++ b/guix/build-system/copy.scm
@@ -108,16 +108,21 @@
#:system #$system
#:outputs %outputs
#:inputs %build-inputs
- #:install-plan #$install-plan
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
- #:phases #$phases
+ #:install-plan #$(if (pair? install-plan)
+ (sexp->gexp install-plan)
+ install-plan)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:out-of-source? #$out-of-source?
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories)))))
+ #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-directories #$(sexp->gexp strip-directories))))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
diff --git a/guix/build-system/dub.scm b/guix/build-system/dub.scm
index 58a72fe828..55ad7decb8 100644
--- a/guix/build-system/dub.scm
+++ b/guix/build-system/dub.scm
@@ -63,8 +63,7 @@
(tests? #t)
(test-target #f)
(dub-build-flags ''())
- (phases '(@ (guix build dub-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -76,7 +75,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(dub-build #:name #$name
#:source #+source
#:system #$system
@@ -85,8 +84,9 @@
#:tests? #$tests?
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
index 0a8f828b3d..3df68789ff 100644
--- a/guix/build-system/emacs.scm
+++ b/guix/build-system/emacs.scm
@@ -87,8 +87,7 @@
(tests? #f)
(parallel-tests? #t)
(test-command ''("make" "check"))
- (phases '(@ (guix build emacs-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(include (quote %default-include))
(exclude (quote %default-exclude))
@@ -103,7 +102,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(emacs-build #:name #$name
#:source #+source
#:system #$system
@@ -114,8 +113,9 @@
#:outputs #$(outputs->gexp outputs)
#:include #$include
#:exclude #$exclude
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/font.scm b/guix/build-system/font.scm
index e7160ff426..74dc80b5db 100644
--- a/guix/build-system/font.scm
+++ b/guix/build-system/font.scm
@@ -77,8 +77,7 @@
(tests? #t)
(test-target "test")
(configure-flags ''())
- (phases '(@ (guix build font-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -99,10 +98,13 @@
#:system #$system
#:test-target #$test-target
#:tests? #$tests?
- #:phases #$phases
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:outputs %outputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs %build-inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm
index 6c09b5a3b7..2df49a2495 100644
--- a/guix/build-system/glib-or-gtk.scm
+++ b/guix/build-system/glib-or-gtk.scm
@@ -137,16 +137,19 @@
(define build
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(glib-or-gtk-build #:source #+source
#:system #$system
#:outputs %outputs
#:inputs %build-inputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
- #:phases #$phases
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:glib-or-gtk-wrap-excluded-outputs
#$glib-or-gtk-wrap-excluded-outputs
#:configure-flags #$configure-flags
@@ -159,8 +162,9 @@
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories)))))
+ #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-directories
+ #$(sexp->gexp strip-directories))))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index 613deb7bb0..3fb1a241dd 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -330,6 +330,12 @@ standard packages used as implicit inputs of the GNU build system."
;; Typical names of Autotools "bootstrap" scripts.
'("bootstrap" "bootstrap.sh" "autogen.sh"))
+(define %strip-flags
+ #~'("--strip-unneeded" "--enable-deterministic-archives"))
+
+(define %strip-directories
+ #~'("lib" "lib64" "libexec" "bin" "sbin"))
+
(define* (gnu-build name inputs
#:key
guile source
@@ -345,10 +351,8 @@ standard packages used as implicit inputs of the GNU build system."
(parallel-tests? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-unneeded"
- "--enable-deterministic-archives"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(validate-runpath? #t)
(make-dynamic-linker-cache? #t)
(license-file-regexp %license-file-regexp)
@@ -381,7 +385,7 @@ are allowed to refer to."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(gnu-build #:source #+source
@@ -389,13 +393,20 @@ are allowed to refer to."
#:build #$build
#:outputs %outputs
#:inputs %build-inputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
- #:phases #$phases
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:locale #$locale
- #:bootstrap-scripts #$bootstrap-scripts
- #:configure-flags #$configure-flags
- #:make-flags #$make-flags
+ #:bootstrap-scripts #$(sexp->gexp bootstrap-scripts)
+ #:configure-flags #$(if (pair? configure-flags)
+ (sexp->gexp configure-flags)
+ configure-flags)
+ #:make-flags #$(if (pair? make-flags)
+ (sexp->gexp make-flags)
+ make-flags)
#:out-of-source? #$out-of-source?
#:tests? #$tests?
#:test-target #$test-target
@@ -472,10 +483,8 @@ is one of `host' or `target'."
(parallel-build? #t) (parallel-tests? #t)
(patch-shebangs? #t)
(strip-binaries? #t)
- (strip-flags ''("--strip-unneeded"
- "--enable-deterministic-archives"))
- (strip-directories ''("lib" "lib64" "libexec"
- "bin" "sbin"))
+ (strip-flags %strip-flags)
+ (strip-directories %strip-directories)
(validate-runpath? #t)
;; We run 'ldconfig' to generate ld.so.cache and it
@@ -498,7 +507,7 @@ cross-built inputs, and NATIVE-INPUTS are inputs that run on the build
platform."
(define builder
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(define %build-host-inputs
(map (lambda (tuple)
@@ -523,11 +532,13 @@ platform."
#:outputs %outputs
#:inputs %build-target-inputs
#:native-inputs %build-host-inputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
- #:native-search-paths '#$(map
- search-path-specification->sexp
- native-search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:native-search-paths '#$(sexp->gexp
+ (map
+ search-path-specification->sexp
+ native-search-paths))
#:phases #$phases
#:locale #$locale
#:bootstrap-scripts #$bootstrap-scripts
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 4c8156e73c..392f2d9b7b 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -113,8 +113,7 @@ it, defaulting to full VERSION if a pseudo-version pattern is not recognized."
(define* (go-build name inputs
#:key
source
- (phases '(@ (guix build go-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(install-source? #t)
@@ -138,8 +137,9 @@ it, defaulting to full VERSION if a pseudo-version pattern is not recognized."
#:system #$system
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:install-source? #$install-source?
#:import-path #$import-path
#:unpack-path #$unpack-path
diff --git a/guix/build-system/haskell.scm b/guix/build-system/haskell.scm
index b7ee72557c..67c8593cf6 100644
--- a/guix/build-system/haskell.scm
+++ b/guix/build-system/haskell.scm
@@ -129,8 +129,7 @@ version REVISION."
(parallel-build? #f)
(configure-flags ''())
(extra-directories ''())
- (phases '(@ (guix build haskell-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out" "static"))
(search-paths '())
(system (%current-system))
@@ -143,7 +142,7 @@ provides a 'Setup.hs' file as its build system."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(haskell-build #:name #$name
#:source #+source
@@ -159,8 +158,9 @@ provides a 'Setup.hs' file as its build system."
#:haddock? #$haddock?
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/julia.scm b/guix/build-system/julia.scm
index 6e006af527..5b824d7f0a 100644
--- a/guix/build-system/julia.scm
+++ b/guix/build-system/julia.scm
@@ -78,8 +78,7 @@
(define* (julia-build name inputs
#:key source
(tests? #t)
- (phases '(@ (guix build julia-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -92,15 +91,16 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(julia-build #:name #$name
#:source #+source
#:system #$system
#:tests? #$tests?
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)
#:julia-package-name #$julia-package-name))))
diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm
index 3a29a93bd7..84570b923a 100644
--- a/guix/build-system/linux-module.scm
+++ b/guix/build-system/linux-module.scm
@@ -155,8 +155,7 @@
source target
(search-paths '())
(tests? #t)
- (phases '(@ (guix build linux-module-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(make-flags ''())
(system (%current-system))
@@ -170,11 +169,12 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(linux-module-build #:name #$name
#:source #+source
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:phases #$phases
#:system #$system
#:target #$target
@@ -202,8 +202,7 @@
(search-paths '())
(native-search-paths '())
(tests? #f)
- (phases '(@ (guix build linux-module-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(system (%current-system))
(substitutable? #t)
(imported-modules
@@ -213,7 +212,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(define %build-host-inputs
'#+(input-tuples->gexp build-inputs))
@@ -232,8 +231,9 @@
#:inputs %build-target-inputs
#:native-inputs %build-host-inputs
#:search-paths
- '#$(map search-path-specification->sexp
- search-paths)
+ '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:native-search-paths
'#$(map
search-path-specification->sexp
diff --git a/guix/build-system/maven.scm b/guix/build-system/maven.scm
index 04358e6240..0af5922692 100644
--- a/guix/build-system/maven.scm
+++ b/guix/build-system/maven.scm
@@ -157,8 +157,7 @@
(strip-flags ''("--strip-debug"))
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
- (phases '(@ (guix build maven-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(system (%current-system))
(imported-modules %maven-build-system-modules)
(modules '((guix build maven-build-system)
@@ -169,13 +168,14 @@ provides its own binaries."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(maven-build #:source #+source
#:system #$system
#:outputs #$(outputs->gexp outputs)
#:inputs #$(input-tuples->gexp inputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:phases #$phases
#:exclude '#$exclude
#:local-packages '#$local-packages
@@ -184,8 +184,8 @@ provides its own binaries."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories))))
+ #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-directories #$(sexp->gexp strip-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index 19fbe54758..5adc0f92c8 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -107,8 +107,7 @@
"bin" "sbin"))
(elf-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
- (phases '(@ (guix build meson-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(system (%current-system))
(imported-modules %meson-build-system-modules)
(modules '((guix build meson-build-system)
@@ -120,24 +119,26 @@ has a 'meson.build' file."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(define build-phases
- #$(if glib-or-gtk?
- phases
- #~(modify-phases #$phases
- (delete 'glib-or-gtk-compile-schemas)
- (delete 'glib-or-gtk-wrap))))
+ #$(let ((phases (if (pair? phases) (sexp->gexp phases) phases)))
+ (if glib-or-gtk?
+ phases
+ #~(modify-phases #$phases
+ (delete 'glib-or-gtk-compile-schemas)
+ (delete 'glib-or-gtk-wrap)))))
#$(with-build-variables inputs outputs
#~(meson-build #:source #+source
#:system #$system
#:outputs %outputs
#:inputs %build-inputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:phases build-phases
- #:configure-flags #$configure-flags
+ #:configure-flags #$(sexp->gexp configure-flags)
#:build-type #$build-type
#:tests? #$tests?
#:test-target #$test-target
@@ -146,9 +147,9 @@ has a 'meson.build' file."
#:validate-runpath? #$validate-runpath?
#:patch-shebangs? #$patch-shebangs?
#:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories
- #:elf-directories #$elf-directories)))))
+ #:strip-flags #$(sexp->gexp strip-flags)
+ #:strip-directories #$(sexp->gexp strip-directories)
+ #:elf-directories #$(sexp->gexp elf-directories))))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
diff --git a/guix/build-system/minify.scm b/guix/build-system/minify.scm
index 751312a523..3256b5d30b 100644
--- a/guix/build-system/minify.scm
+++ b/guix/build-system/minify.scm
@@ -76,8 +76,7 @@
#:key
source
(javascript-files #f)
- (phases '(@ (guix build minify-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(system (%current-system))
search-paths
@@ -89,14 +88,15 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(minify-build #:name #$name
#:source #+source
#:javascript-files #$javascript-files
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/node.scm b/guix/build-system/node.scm
index c174da98aa..73a6f152dd 100644
--- a/guix/build-system/node.scm
+++ b/guix/build-system/node.scm
@@ -81,8 +81,7 @@ registry."
source
(npm-flags ''())
(tests? #t)
- (phases '(@ (guix build node-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -96,7 +95,7 @@ registry."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(node-build #:name #$name
#:source #+source
#:system #$system
@@ -104,8 +103,9 @@ registry."
#:tests? #$tests?
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm
index 32045ef6de..db0a916fb2 100644
--- a/guix/build-system/perl.scm
+++ b/guix/build-system/perl.scm
@@ -100,17 +100,20 @@ provides a `Makefile.PL' file as its build system."
(define build
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(perl-build #:name #$name
#:source #+source
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:make-maker? #$make-maker?
#:make-maker-flags #$make-maker-flags
- #:module-build-flags #$module-build-flags
- #:phases #$phases
+ #:module-build-flags #$(sexp->gexp module-build-flags)
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:system #$system
#:test-target "test"
#:tests? #$tests?
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index 018fda9b20..efade6f74b 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -175,8 +175,7 @@ pre-defined variants."
(test-target "test")
(use-setuptools? #t)
(configure-flags ''())
- (phases '(@ (guix build python-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -189,7 +188,7 @@ provides a 'setup.py' file as its build system."
(define build
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(python-build #:name #$name
@@ -199,10 +198,13 @@ provides a 'setup.py' file as its build system."
#:system #$system
#:test-target #$test-target
#:tests? #$tests?
- #:phases #$phases
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:outputs %outputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs %build-inputs)))))
diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
index 7df431a68d..063fa7bedc 100644
--- a/guix/build-system/qt.scm
+++ b/guix/build-system/qt.scm
@@ -123,8 +123,7 @@
(strip-flags ''("--strip-debug"))
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
- (phases '(@ (guix build qt-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(qt-wrap-excluded-outputs ''())
(system (%current-system))
(imported-modules %qt-build-system-modules)
@@ -135,13 +134,14 @@ provides a 'CMakeLists.txt' file as its build system."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(qt-build #:source #+source
#:system #$system
#:outputs #$(outputs->gexp outputs)
#:inputs #$(input-tuples->gexp inputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:phases #$phases
#:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
#:configure-flags #$configure-flags
@@ -191,8 +191,7 @@ provides a 'CMakeLists.txt' file as its build system."
"--enable-deterministic-archives"))
(strip-directories ''("lib" "lib64" "libexec"
"bin" "sbin"))
- (phases '(@ (guix build qt-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(system (%current-system))
(build (nix-system->gnu-triplet system))
(imported-modules %qt-build-system-modules)
@@ -204,7 +203,7 @@ build system."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(define %build-host-inputs
#+(input-tuples->gexp build-inputs))
@@ -223,8 +222,9 @@ build system."
#:outputs %outputs
#:inputs %build-target-inputs
#:native-inputs %build-host-inputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:native-search-paths '#$(map
search-path-specification->sexp
native-search-paths)
diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm
index 12b7df66a6..c4425e0a12 100644
--- a/guix/build-system/r.scm
+++ b/guix/build-system/r.scm
@@ -109,8 +109,7 @@ release corresponding to NAME and VERSION."
(tests? #t)
(test-target "tests")
(configure-flags ''())
- (phases '(@ (guix build r-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -123,7 +122,7 @@ release corresponding to NAME and VERSION."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(r-build #:name #$name
#:source #+source
#:configure-flags #$configure-flags
@@ -132,8 +131,9 @@ release corresponding to NAME and VERSION."
#:test-target #$test-target
#:phases #$phases
#:outputs #$(outputs->gexp outputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/rakudo.scm b/guix/build-system/rakudo.scm
index eab41e2cb9..05a4d9c2ad 100644
--- a/guix/build-system/rakudo.scm
+++ b/guix/build-system/rakudo.scm
@@ -103,8 +103,7 @@
source
(search-paths '())
(tests? #t)
- (phases '(@ (guix build rakudo-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(system (%current-system))
(guile #f)
@@ -117,11 +116,12 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(rakudo-build #:name #$name
#:source #+source
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:phases #$phases
#:system #$system
#:tests? #$tests?
diff --git a/guix/build-system/renpy.scm b/guix/build-system/renpy.scm
index 5c65f55455..0ee73ec969 100644
--- a/guix/build-system/renpy.scm
+++ b/guix/build-system/renpy.scm
@@ -77,8 +77,7 @@
(define* (renpy-build name inputs
#:key
source
- (phases '(@ (guix build renpy-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(configure-flags ''())
(outputs '("out"))
(output "out")
@@ -93,7 +92,7 @@
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(renpy-build #:name #$name
#:source #+source
#:configure-flags #$configure-flags
@@ -102,8 +101,9 @@
#:outputs #$(outputs->gexp outputs)
#:output #$output
#:game #$game
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs #$(input-tuples->gexp inputs)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm
index 8b02e0ff52..342daf7978 100644
--- a/guix/build-system/ruby.scm
+++ b/guix/build-system/ruby.scm
@@ -80,8 +80,7 @@ NAME and VERSION."
(gem-flags ''())
(test-target "test")
(tests? #t)
- (phases '(@ (guix build ruby-build-system)
- %standard-phases))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -92,7 +91,7 @@ NAME and VERSION."
"Build SOURCE using RUBY and INPUTS."
(define build
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(ruby-build #:name #$name
@@ -101,10 +100,13 @@ NAME and VERSION."
#:gem-flags #$gem-flags
#:test-target #$test-target
#:tests? #$tests?
- #:phases #$phases
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:outputs %outputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs %build-inputs))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/build-system/scons.scm b/guix/build-system/scons.scm
index 6af6998d26..07fd008d0d 100644
--- a/guix/build-system/scons.scm
+++ b/guix/build-system/scons.scm
@@ -79,11 +79,10 @@
(source #f)
(tests? #t)
(scons-flags ''())
- (build-targets ''())
+ (build-targets #~'())
(test-target "test")
- (install-targets ''("install"))
- (phases '(@ (guix build scons-build-system)
- %standard-phases))
+ (install-targets #~'("install"))
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -96,17 +95,19 @@ provides a 'SConstruct' file as its build system."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
(scons-build #:name ,name
#:source #+source
- #:scons-flags #$scons-flags
+ #:scons-flags #$(sexp->gexp scons-flags)
#:system #$system
#:build-targets #$build-targets
#:test-target #$test-target
#:tests? #$tests?
#:install-targets #$install-targets
- #:phases #$phases
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
#:outputs (list #$@(map (lambda (name)
#~(cons #$name
(ungexp output name)))
@@ -114,8 +115,9 @@ provides a 'SConstruct' file as its build system."
#:inputs (map (lambda (tuple)
(apply cons tuple))
'#$inputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)))))
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))))))
(gexp->derivation name builder
#:system system
diff --git a/guix/build-system/texlive.scm b/guix/build-system/texlive.scm
index 0a69d1f328..c7fa2e3add 100644
--- a/guix/build-system/texlive.scm
+++ b/guix/build-system/texlive.scm
@@ -144,24 +144,24 @@ level package ID."
(define builder
(with-imported-modules imported-modules
#~(begin
- (use-modules #$@modules)
- (texlive-build #:name #$name
- #:source #+source
- #:tex-directory #$tex-directory
- #:build-targets #$build-targets
- #:tex-format #$tex-format
- #:system #$system
- #:tests? #$tests?
- #:phases #$phases
- #:outputs (list #$@(map (lambda (name)
- #~(cons #$name
- (ungexp output name)))
- outputs))
- #:inputs (map (lambda (tuple)
- (apply cons tuple))
- '#$inputs)
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)))))
+ (use-modules #$@(sexp->gexp modules))
+
+ #$(with-build-variables inputs outputs
+ #~(texlive-build #:name #$name
+ #:source #+source
+ #:tex-directory #$tex-directory
+ #:build-targets #$build-targets
+ #:tex-format #$tex-format
+ #:system #$system
+ #:tests? #$tests?
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
+ #:outputs %outputs
+ #:inputs %build-inputs
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths)))))))
(gexp->derivation name builder
#:system system
diff --git a/guix/build-system/trivial.scm b/guix/build-system/trivial.scm
index 0f89524231..73d452aea2 100644
--- a/guix/build-system/trivial.scm
+++ b/guix/build-system/trivial.scm
@@ -54,7 +54,10 @@
"Run build expression BUILDER, an expression, for SYSTEM. SOURCE is
ignored."
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
- system #:graft? #f)))
+ system #:graft? #f))
+ (builder -> (if (pair? builder)
+ (sexp->gexp builder)
+ builder)))
(gexp->derivation name (with-build-variables inputs outputs builder)
#:system system
#:target #f
@@ -72,7 +75,10 @@ ignored."
"Run build expression BUILDER, an expression, for SYSTEM. SOURCE is
ignored."
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
- system #:graft? #f)))
+ system #:graft? #f))
+ (builder -> (if (pair? builder)
+ (sexp->gexp builder)
+ builder)))
(gexp->derivation name (with-build-variables
(append build-inputs target-inputs)
outputs
diff --git a/guix/build-system/waf.scm b/guix/build-system/waf.scm
index db604e6ecf..e8cd5520b8 100644
--- a/guix/build-system/waf.scm
+++ b/guix/build-system/waf.scm
@@ -77,9 +77,8 @@
#:key source
(tests? #t)
(test-target "check")
- (configure-flags ''())
- (phases '(@ (guix build waf-build-system)
- %standard-phases))
+ (configure-flags #~'())
+ (phases '%standard-phases)
(outputs '("out"))
(search-paths '())
(system (%current-system))
@@ -91,7 +90,7 @@
as its build system."
(define build
#~(begin
- (use-modules #$@modules)
+ (use-modules #$@(sexp->gexp modules))
#$(with-build-variables inputs outputs
#~(waf-build #:name #$name
@@ -102,8 +101,9 @@ as its build system."
#:tests? #$tests?
#:phases #$phases
#:outputs %outputs
- #:search-paths '#$(map search-path-specification->sexp
- search-paths)
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
#:inputs %build-inputs))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
diff --git a/guix/packages.scm b/guix/packages.scm
index cbe8004888..8b40c06000 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -769,7 +769,9 @@ specifies modules in scope when evaluating SNIPPET."
module
(map resolve-interface '#+modules))
((@ (system base compile) compile)
- '#+snippet
+ '#+(if (pair? snippet)
+ (sexp->gexp snippet)
+ snippet)
#:to 'value
#:opts %auto-compilation-options
#:env module))
diff --git a/guix/svn-download.scm b/guix/svn-download.scm
index b96151234c..28ad49977b 100644
--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
;;; Copyright © 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
;;;
@@ -134,7 +134,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
#$(svn-multi-reference-recursive? ref)
#:user-name #$(svn-multi-reference-user-name ref)
#:password #$(svn-multi-reference-password ref)))
- '#$(svn-multi-reference-locations ref)))))
+ '#$(sexp->gexp (svn-multi-reference-locations ref))))))
(mlet %store-monad ((guile (package->derivation guile system)))
(gexp->derivation (or name "svn-checkout") build