summaryrefslogtreecommitdiff
path: root/guix/build-system/meson.scm
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 /guix/build-system/meson.scm
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'.
Diffstat (limited to 'guix/build-system/meson.scm')
-rw-r--r--guix/build-system/meson.scm29
1 files changed, 15 insertions, 14 deletions
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)))