From 42ff70e26263bfe4c55398a246a3ab0ad2b6200c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 20 Dec 2012 19:00:14 +0100 Subject: distro: libtool: Run test suite in parallel; patch references to /bin/sh. * distro/packages/autotools.scm (libtool): Add `pre-check' phase. --- distro/packages/autotools.scm | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/distro/packages/autotools.scm b/distro/packages/autotools.scm index 238025b540..1c01b3d3db 100644 --- a/distro/packages/autotools.scm +++ b/distro/packages/autotools.scm @@ -100,8 +100,30 @@ Standards. Automake requires the use of Autoconf.") (native-inputs `(("m4" ,m4) ("perl" ,perl))) (arguments - ;; TODO: Use `TESTSUITEFLAGS=-jN' for tests. - `(#:patches (list (assoc-ref %build-inputs "patch/skip-tests")))) + `(#:patches (list (assoc-ref %build-inputs "patch/skip-tests")) + #:phases (alist-cons-before + 'check 'pre-check + (lambda* (#:key inputs #:allow-other-keys) + ;; Run the test suite in parallel, if possible. + (let ((ncores + (cond + ((getenv "NIX_BUILD_CORES") + => + (lambda (n) + (if (zero? (string->number n)) + (number->string (current-processor-count)) + n))) + (else "1")))) + (setenv "TESTSUITEFLAGS" + (string-append "-j" ncores))) + + ;; Path references to /bin/sh. + (patch-shebang "libtoolize") + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "tests/testsuite" + (("/bin/sh") + (string-append bash "/bin/bash"))))) + %standard-phases))) (inputs `(("patch/skip-tests" ,(search-patch "libtool-skip-tests.patch")))) (synopsis "GNU Libtool, a generic library support script") -- cgit v1.2.3