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'.
This commit is contained in:
Ludovic Courtès 2021-02-28 21:30:50 +01:00
parent da86e90efe
commit f95fc73248
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
34 changed files with 278 additions and 232 deletions

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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)))))

View File

@ -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))

View File

@ -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)))

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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))))

View File

@ -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

View File

@ -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)))

View File

@ -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)))

View File

@ -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))

View File

@ -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))

View File

@ -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?

View File

@ -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)))))

View File

@ -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)

View File

@ -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))

View File

@ -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?

View File

@ -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))

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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))

View File

@ -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