distro: libtool: Run test suite in parallel; patch references to /bin/sh.

* distro/packages/autotools.scm (libtool): Add `pre-check' phase.
This commit is contained in:
Ludovic Courtès 2012-12-20 19:00:14 +01:00
parent 530c169561
commit 42ff70e262
1 changed files with 24 additions and 2 deletions

View File

@ -100,8 +100,30 @@ Standards. Automake requires the use of Autoconf.")
(native-inputs `(("m4" ,m4) (native-inputs `(("m4" ,m4)
("perl" ,perl))) ("perl" ,perl)))
(arguments (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" (inputs `(("patch/skip-tests"
,(search-patch "libtool-skip-tests.patch")))) ,(search-patch "libtool-skip-tests.patch"))))
(synopsis "GNU Libtool, a generic library support script") (synopsis "GNU Libtool, a generic library support script")