gnu: libtool: Allow cross-compilation.

* gnu/packages/autotools.scm (libtool)[arguments]: Use #:phases argument
  only when building natively.
This commit is contained in:
Ludovic Courtès 2013-05-25 18:00:01 +02:00
parent 3871c9f500
commit 1984b43895
1 changed files with 23 additions and 21 deletions

View File

@ -231,28 +231,30 @@ Standards. Automake requires the use of Autoconf.")
(arguments (arguments
`(#:patches (list (assoc-ref %build-inputs "patch/skip-tests")) `(#:patches (list (assoc-ref %build-inputs "patch/skip-tests"))
#:phases (alist-cons-before ,@(if (%current-target-system)
'check 'pre-check '() ; no `check' phase when cross-building
(lambda* (#:key inputs #:allow-other-keys) '(#:phases (alist-cons-before
;; Run the test suite in parallel, if possible. 'check 'pre-check
(let ((ncores (lambda* (#:key inputs #:allow-other-keys)
(cond ;; Run the test suite in parallel, if possible.
((getenv "NIX_BUILD_CORES") (let ((ncores
=> (cond
(lambda (n) ((getenv "NIX_BUILD_CORES")
(if (zero? (string->number n)) =>
(number->string (current-processor-count)) (lambda (n)
n))) (if (zero? (string->number n))
(else "1")))) (number->string (current-processor-count))
(setenv "TESTSUITEFLAGS" n)))
(string-append "-j" ncores))) (else "1"))))
(setenv "TESTSUITEFLAGS"
(string-append "-j" ncores)))
;; Path references to /bin/sh. ;; Path references to /bin/sh.
(let ((bash (assoc-ref inputs "bash"))) (let ((bash (assoc-ref inputs "bash")))
(substitute* "tests/testsuite" (substitute* "tests/testsuite"
(("/bin/sh") (("/bin/sh")
(string-append bash "/bin/bash"))))) (string-append bash "/bin/bash")))))
%standard-phases))) %standard-phases)))))
(inputs `(("patch/skip-tests" (inputs `(("patch/skip-tests"
,(search-patch "libtool-skip-tests.patch")))) ,(search-patch "libtool-skip-tests.patch"))))
(synopsis "Generic shared library support tools") (synopsis "Generic shared library support tools")