From dd1a5a152c679ba2d386dc66127a0de924182e26 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 4 Dec 2013 16:07:36 +0100 Subject: derivations: Use more keyword parameters for 'build-expression->derivation'. * guix/derivations.scm (build-expression->derivation): Turn 'system' and 'inputs' into keyword parameters. Adjust callers accordingly. * gnu/system/linux.scm, gnu/system/vm.scm, guix/build-system/cmake.scm, guix/build-system/gnu.scm, guix/build-system/perl.scm, guix/build-system/python.scm, guix/build-system/trivial.scm, guix/download.scm, guix/packages.scm, guix/profiles.scm, guix/scripts/pull.scm, tests/derivations.scm, tests/guix-build.sh, tests/monads.scm, tests/store.scm, tests/union.scm: Adjust users of 'build-expression->derivation' and 'derivation-expression' accordingly. * doc/guix.texi (Derivations): Adjust 'build-expression->derivation' documentation accordingly. (The Store Monad): Likewise for 'derivation-expression'. --- guix/build-system/cmake.scm | 5 +++-- guix/build-system/gnu.scm | 10 ++++++---- guix/build-system/perl.scm | 5 +++-- guix/build-system/python.scm | 5 +++-- guix/build-system/trivial.scm | 13 ++++++++----- guix/derivations.scm | 17 +++++++++++------ guix/download.scm | 10 +++++----- guix/packages.scm | 9 +++++---- guix/profiles.scm | 5 ++--- guix/scripts/pull.scm | 4 ++-- 10 files changed, 48 insertions(+), 35 deletions(-) (limited to 'guix') diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index 1a5f4b6ad1..8c9a32c8ab 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -104,8 +104,9 @@ provides a 'CMakeLists.txt' file as its build system." (package-derivation store guile system))))) (let ((cmake (package-derivation store cmake system))) - (build-expression->derivation store name system - builder + (build-expression->derivation store name builder + #:system system + #:inputs `(,@(if source `(("source" ,source)) '()) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 7725b8b67a..333ae9273e 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -323,8 +323,9 @@ which could lead to gratuitous input divergence." (guile (module-ref distro 'guile-final))) (package-derivation store guile system))))) - (build-expression->derivation store name system - builder + (build-expression->derivation store name builder + #:system system + #:inputs `(,@(if source `(("source" ,source)) '()) @@ -493,8 +494,9 @@ platform." (guile (module-ref distro 'guile-final))) (package-derivation store guile system))))) - (build-expression->derivation store name system - builder + (build-expression->derivation store name builder + #:system system + #:inputs `(,@(if source `(("source" ,source)) '()) diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm index 5dc50d97f3..4e5aea3a2f 100644 --- a/guix/build-system/perl.scm +++ b/guix/build-system/perl.scm @@ -93,8 +93,9 @@ provides a `Makefile.PL' file as its build system." (package-derivation store guile system))))) (let ((perl (package-derivation store perl system))) - (build-expression->derivation store name system - builder + (build-expression->derivation store name builder + #:system system + #:inputs `(,@(if source `(("source" ,source)) '()) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index a97135fe0c..7e26864653 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -146,8 +146,8 @@ provides a 'setup.py' file as its build system." (package-derivation store guile system))))) (let ((python (package-derivation store python system))) - (build-expression->derivation store name system - builder + (build-expression->derivation store name builder + #:inputs `(,@(if source `(("source" ,source)) '()) @@ -158,6 +158,7 @@ provides a 'setup.py' file as its build system." ;; 'gnu-build-system'. ,@(standard-inputs system)) + #:system system #:modules imported-modules #:outputs outputs #:guile-for-build guile-for-build))) diff --git a/guix/build-system/trivial.scm b/guix/build-system/trivial.scm index f91997d1e9..5576d596da 100644 --- a/guix/build-system/trivial.scm +++ b/guix/build-system/trivial.scm @@ -42,10 +42,11 @@ search-paths) "Run build expression BUILDER, an expression, for SYSTEM. SOURCE is ignored." - (build-expression->derivation store name system builder - (if source - `(("source" ,source) ,@inputs) - inputs) + (build-expression->derivation store name builder + #:inputs (if source + `(("source" ,source) ,@inputs) + inputs) + #:system system #:outputs outputs #:modules modules #:guile-for-build @@ -56,7 +57,9 @@ ignored." outputs guile system builder (modules '()) search-paths native-search-paths) "Like `trivial-build', but in a cross-compilation context." - (build-expression->derivation store name system builder + (build-expression->derivation store name builder + #:system system + #:inputs (let ((inputs (append native-inputs inputs))) (if source `(("source" ,source) ,@inputs) diff --git a/guix/derivations.scm b/guix/derivations.scm index 63c1ba4f2b..3d9f0affbf 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -824,8 +824,9 @@ system, imported, and appears under FINAL-PATH in the resulting store path." (mkdir ,tail)))))) `((symlink ,store-path ,final-path))))) files)))) - (build-expression->derivation store name system - builder files + (build-expression->derivation store name builder + #:system system + #:inputs files #:guile-for-build guile))) (define* (imported-modules store modules @@ -889,12 +890,16 @@ they can refer to each other." #:opts %auto-compilation-options))))) files))) - (build-expression->derivation store name system builder - `(("modules" ,module-drv)) + (build-expression->derivation store name builder + #:inputs `(("modules" ,module-drv)) + #:system system #:guile-for-build guile))) -(define* (build-expression->derivation store name system exp inputs - #:key (outputs '("out")) +(define* (build-expression->derivation store name exp + #:key + (system (%current-system)) + (inputs '()) + (outputs '("out")) hash hash-algo (env-vars '()) (modules '()) diff --git a/guix/download.scm b/guix/download.scm index 837ff0e683..8a3e9fd06a 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -228,11 +228,11 @@ must be a list of symbol/URL-list pairs." ;; set it here. `(("GUILE_LOAD_PATH" . ,dir))) '()))) - (build-expression->derivation store (or name file-name) system - builder - (if gnutls-drv - `(("gnutls" ,gnutls-drv)) - '()) + (build-expression->derivation store (or name file-name) builder + #:system system + #:inputs (if gnutls-drv + `(("gnutls" ,gnutls-drv)) + '()) #:hash-algo hash-algo #:hash hash #:modules '((guix build download) diff --git a/guix/packages.scm b/guix/packages.scm index c1247b71ac..daf431f5e4 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -386,10 +386,11 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." system))))) (or inputs (%standard-patch-inputs))))) - (build-expression->derivation store name system builder - `(("source" ,source) - ,@inputs - ,@patch-inputs) + (build-expression->derivation store name builder + #:inputs `(("source" ,source) + ,@inputs + ,@patch-inputs) + #:system system #:modules imported-modules #:guile-for-build guile-for-build))) diff --git a/guix/profiles.scm b/guix/profiles.scm index 1f62099e45..9b5c5f515c 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -246,9 +246,8 @@ the given MANIFEST." (lambda (p) (pretty-print ',(manifest->sexp manifest) p)))))) - (build-expression->derivation store "profile" - (%current-system) - builder + (build-expression->derivation store "profile" builder + #:inputs (append-map (match-lambda (($ name version output path deps (inputs ..1)) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index b910276204..5ff2ce0cc1 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -141,8 +141,8 @@ files." (delete-file (string-append out "/guix/config.scm")) (delete-file (string-append out "/guix/config.go"))))) - (build-expression->derivation store "guix-latest" (%current-system) - builder + (build-expression->derivation store "guix-latest" builder + #:inputs `(("tar" ,(package-derivation store tar)) ("gzip" ,(package-derivation store gzip)) ("gcrypt" ,(package-derivation store -- cgit v1.2.3