From 03671375b6eda0d47452780d91fd3af7bde791aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 1 Jul 2012 17:32:03 +0200 Subject: [PATCH] packages: Allow the `arguments' field to be a procedure. * guix/packages.scm (package-derivation): When ARGS is a procedure, call (ARGS SYSTEM). * distro/base.scm (gawk)[arguments]: Turn into a procedure, to disable tests on Cygwin. --- distro/base.scm | 10 +++++++--- guix/packages.scm | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/distro/base.scm b/distro/base.scm index c9d2ae8033..9570b6d684 100644 --- a/distro/base.scm +++ b/distro/base.scm @@ -62,9 +62,13 @@ (define-public gawk (nix-base32-string->bytevector "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0")))) (build-system gnu-build-system) - (arguments '() - ;; TODO: disable tests on Cygwin - ) + (arguments (case-lambda + ((system) + (if (string=? system "i686-cygwin") + '(#:tests? #f) ; work around test failure on Cygwin + '())) + ((system cross-system) + '()))) (inputs `(("libsigsegv" ,libsigsegv) ; headers ("libsigsegv/lib" ,libsigsegv "lib"))) ; library (home-page "http://www.gnu.org/software/gawk/") diff --git a/guix/packages.scm b/guix/packages.scm index 3f8f880b29..0d5823ad5d 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -171,7 +171,9 @@ (define* (package-derivation store package (package-source-derivation store source) inputs #:outputs outputs #:system system - args))))) + (if (procedure? args) + (args system) + args)))))) (define* (package-cross-derivation store package) ;; TODO