gnu: gettext, attr, acl: Disable `check' phase twiddling when cross building.

* gnu/packages/gettext.scm (gettext)[arguments]: Disable `check' phase
  manipulations when (%current-target-system) is true.
* gnu/packages/attr.scm (attr)[arguments]: Likewise.
* gnu/packages/acl.scm (acl)[arguments]: Likewise.
This commit is contained in:
Ludovic Courtès 2013-05-25 16:19:06 +02:00
parent a7dc055bb5
commit 2a552f1177
3 changed files with 67 additions and 41 deletions

View File

@ -45,18 +45,30 @@
'configure 'patch-makefile-SHELL 'configure 'patch-makefile-SHELL
(lambda _ (lambda _
(patch-makefile-SHELL "include/buildmacros")) (patch-makefile-SHELL "include/buildmacros"))
(alist-replace ,(if (%current-target-system)
'check '%standard-cross-phases
'(alist-replace 'check
(lambda _ (lambda _
(system* "make" "tests" "-C" "test") (system* "make" "tests" "-C" "test")
;; XXX: Ignore the test result since this is ;; XXX: Ignore the test result since this is
;; dependent on the underlying file system. ;; dependent on the underlying file system.
#t) #t)
%standard-phases)))) %standard-phases)))))
(inputs `(("attr" ,attr) (inputs `(("attr" ,attr)
("gettext" ,guix:gettext)
("perl" ,perl))) ;; Perl is needed to run tests; remove it from cross builds.
,@(if (%current-target-system)
'()
`(("gettext" ,guix:gettext)
("perl" ,perl)))))
(native-inputs
;; FIXME: Upon next core-updates, make gettext a native input
;; unconditionally.
(if (%current-target-system)
`(("gettext" ,guix:gettext))
'()))
(home-page (home-page
"http://savannah.nongnu.org/projects/acl") "http://savannah.nongnu.org/projects/acl")
(synopsis (synopsis

View File

@ -52,8 +52,11 @@
"install" "install"
"install-lib" "install-lib"
"install-dev"))) "install-dev")))
(alist-replace
'check ;; When building natively, adjust the test cases.
,(if (%current-target-system)
'%standard-cross-phases
'(alist-replace 'check
(lambda _ (lambda _
;; Use the right shell. ;; Use the right shell.
(substitute* "test/run" (substitute* "test/run"
@ -62,16 +65,24 @@
(system* "make" "tests" "-C" "test") (system* "make" "tests" "-C" "test")
;; XXX: Ignore the test result since this is dependent on the ;; XXX: Ignore the test result since this is
;; underlying file system. ;; dependent on the underlying file system.
#t) #t)
%standard-phases))))) %standard-phases))))))
(inputs `(("perl" ,perl) (inputs `(;; Perl is needed to run tests; remove it from cross builds.
("gettext" ,guix:gettext))) ,@(if (%current-target-system)
(home-page '()
"http://savannah.nongnu.org/projects/attr/") `(("perl" ,perl)
(synopsis ("gettext" ,guix:gettext)))))
"Library and tools for manipulating extended attributes") (native-inputs
;; FIXME: Upon next core-updates, make gettext a native input
;; unconditionally.
(if (%current-target-system)
`(("gettext" ,guix:gettext))
'()))
(home-page "http://savannah.nongnu.org/projects/attr/")
(synopsis "Library and tools for manipulating extended attributes")
(description (description
"Portable library and tools for manipulating extended attributes.") "Portable library and tools for manipulating extended attributes.")
(license (list gpl2+ lgpl2.1+)))) (license (list gpl2+ lgpl2.1+))))

View File

@ -38,9 +38,12 @@
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:patches (list (assoc-ref %build-inputs "patch/gets")) `(#:patches (list (assoc-ref %build-inputs "patch/gets"))
#:phases (alist-cons-before #:phases ,(if (%current-target-system)
'%standard-cross-phases
'(alist-cons-before
'check 'patch-tests 'check 'patch-tests
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; TODO: Use (which "sh").
(let ((bash (assoc-ref inputs "bash"))) (let ((bash (assoc-ref inputs "bash")))
(substitute* (find-files "gettext-tools/tests" (substitute* (find-files "gettext-tools/tests"
"^msgexec-[0-9]") "^msgexec-[0-9]")
@ -50,7 +53,7 @@
"posix_spawn") "posix_spawn")
(("/bin/sh") (("/bin/sh")
(format #f "~a/bin/bash" bash))))) (format #f "~a/bin/bash" bash)))))
%standard-phases))) %standard-phases))))
(inputs (inputs
`(("patch/gets" `(("patch/gets"
,(search-patch "gettext-gets-undeclared.patch")))) ,(search-patch "gettext-gets-undeclared.patch"))))