mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: busybox: Fix cross-compilation.
* gnu/packages/busybox.scm (busybox)[arguments]: Switch to gexps. Honor #:tests? in 'check' phase. Add #:make-flags. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
75e7c09461
commit
e5fc55493d
1 changed files with 63 additions and 54 deletions
|
@ -2,6 +2,7 @@
|
||||||
;;; Copyright © 2014 John Darrington <jmd@gnu.org>
|
;;; Copyright © 2014 John Darrington <jmd@gnu.org>
|
||||||
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
|
;;; Copyright © 2022 LuHui <luhux76@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -45,8 +46,8 @@
|
||||||
"0jfm9fik7nv4w21zqdg830pddgkdjmplmna9yjn9ck1lwn4vsps1"))))
|
"0jfm9fik7nv4w21zqdg830pddgkdjmplmna9yjn9ck1lwn4vsps1"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases
|
(list #:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-before 'configure 'disable-timestamps
|
(add-before 'configure 'disable-timestamps
|
||||||
(lambda _
|
(lambda _
|
||||||
(setenv "KCONFIG_NOTIMESTAMP" "1")))
|
(setenv "KCONFIG_NOTIMESTAMP" "1")))
|
||||||
|
@ -65,12 +66,13 @@
|
||||||
(("# CONFIG_INSTALL_NO_USR is not set")
|
(("# CONFIG_INSTALL_NO_USR is not set")
|
||||||
"CONFIG_INSTALL_NO_USR=y"))))
|
"CONFIG_INSTALL_NO_USR=y"))))
|
||||||
(replace 'check
|
(replace 'check
|
||||||
(lambda* (#:key make-flags #:allow-other-keys)
|
(lambda* (#:key tests? make-flags #:allow-other-keys)
|
||||||
(substitute* '("testsuite/du/du-s-works"
|
(substitute* '("testsuite/du/du-s-works"
|
||||||
"testsuite/du/du-works")
|
"testsuite/du/du-works")
|
||||||
(("/bin") "/etc")) ; there is no /bin but there is a /etc
|
(("/bin") "/etc")) ; there is no /bin but there is a /etc
|
||||||
|
|
||||||
;; There is no /usr/bin or /bin - replace it with /gnu/store
|
;; There is no /usr/bin or /bin - replace it with
|
||||||
|
;; /gnu/store.
|
||||||
(substitute* "testsuite/cpio.tests"
|
(substitute* "testsuite/cpio.tests"
|
||||||
(("/usr/bin") (%store-directory))
|
(("/usr/bin") (%store-directory))
|
||||||
(("usr") (car (filter (negate string-null?)
|
(("usr") (car (filter (negate string-null?)
|
||||||
|
@ -82,28 +84,35 @@
|
||||||
(substitute* "testsuite/start-stop-daemon.tests"
|
(substitute* "testsuite/start-stop-daemon.tests"
|
||||||
(("/bin/false") (which "false")))
|
(("/bin/false") (which "false")))
|
||||||
|
|
||||||
;; The pidof tests assume that pid 1 is called "init" but that is not
|
;; The pidof tests assume that pid 1 is called "init" but
|
||||||
;; true in guix build environment
|
;; that is not true in guix build environment
|
||||||
(substitute* "testsuite/pidof.tests"
|
(substitute* "testsuite/pidof.tests"
|
||||||
(("-s init") "-s $(cat /proc/1/comm)"))
|
(("-s init") "-s $(cat /proc/1/comm)"))
|
||||||
|
|
||||||
;; This test cannot possibly pass.
|
;; This test cannot possibly pass. It is trying to test
|
||||||
;; It is trying to test that "which ls" returns "/bin/ls" when PATH is not set.
|
;; that "which ls" returns "/bin/ls" when PATH is not set.
|
||||||
;; However, this relies on /bin/ls existing. Which it does not in guix.
|
;; However, this relies on /bin/ls existing. Which it does
|
||||||
|
;; not in guix.
|
||||||
(delete-file "testsuite/which/which-uses-default-path")
|
(delete-file "testsuite/which/which-uses-default-path")
|
||||||
(rmdir "testsuite/which")
|
(rmdir "testsuite/which")
|
||||||
|
|
||||||
|
(when tests?
|
||||||
(apply invoke "make"
|
(apply invoke "make"
|
||||||
;; "V=1"
|
;; "V=1"
|
||||||
"SKIP_KNOWN_BUGS=1"
|
"SKIP_KNOWN_BUGS=1"
|
||||||
"SKIP_INTERNET_TESTS=1"
|
"SKIP_INTERNET_TESTS=1"
|
||||||
"check" make-flags)))
|
"check" make-flags))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(let ((out (assoc-ref outputs "out")))
|
||||||
(apply invoke "make"
|
(apply invoke "make"
|
||||||
(string-append "CONFIG_PREFIX=" out)
|
(string-append "CONFIG_PREFIX=" out)
|
||||||
"install" make-flags)))))))
|
"install" make-flags)))))
|
||||||
|
#:make-flags
|
||||||
|
#~(let ((target #$(%current-target-system)))
|
||||||
|
(if target
|
||||||
|
(list (string-append "CROSS_COMPILE=" target "-"))
|
||||||
|
'()))))
|
||||||
(native-inputs (list perl ; needed to generate the man pages (pod2man)
|
(native-inputs (list perl ; needed to generate the man pages (pod2man)
|
||||||
;; The following are needed by the tests.
|
;; The following are needed by the tests.
|
||||||
inetutils
|
inetutils
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue