gnu: toybox: Use G-expressions.

* gnu/packages/busybox.scm (toybox)[arguments]:
Rewrite as G-expressions.
This commit is contained in:
Tobias Geerinckx-Rice 2022-01-06 01:15:11 +01:00
parent 7a96516f60
commit 24b04f5d4e
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -19,6 +19,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages busybox) (define-module (gnu packages busybox)
#:use-module (guix gexp)
#:use-module (guix licenses) #:use-module (guix licenses)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
@ -133,35 +134,32 @@ (define-public toybox
"0jq3368jps6jg717ikzhlc6whml3k2s9xy69zpj4i0r35c5ck622")))) "0jq3368jps6jg717ikzhlc6whml3k2s9xy69zpj4i0r35c5ck622"))))
(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 'set-environment-variables (add-before 'configure 'set-environment-variables
(lambda _ (lambda _
(setenv "CC" ,(cc-for-target)) (setenv "CC" #$(cc-for-target))
(setenv "HOSTCC" (which "gcc")))) (setenv "HOSTCC" (which "gcc"))))
(replace 'configure (replace 'configure
(lambda _ (invoke "make" "defconfig"))) (lambda _ (invoke "make" "defconfig")))
(add-before 'check 'fix-or-skip-broken-tests (add-before 'check 'fix-or-skip-broken-tests
(lambda _ (lambda _
;; Some tests expects $USER to magically be the current user name. ;; Some tests expect $USER to magically be the current user.
(setenv "USER" (passwd:name (getpwnam (geteuid)))) (setenv "USER" (passwd:name (getpwnam (geteuid))))
;; All these expect directories to be exactly 4K. They aren't! ;; This expects directories to be exactly 4K. They aren't!
(delete-file "tests/du.test") (delete-file "tests/du.test")
;; Delete tests that expect a root or 0 user to exist. ;; Delete tests that expect a root or 0 user to exist.
(substitute* "tests/id.test" (substitute* "tests/id.test"
(("^testing .*[ \\(]root.*") "")) (("^testing .*[ \\(]root.*") ""))))
)) (replace 'install
(replace 'install (lambda* (#:key outputs #:allow-other-keys)
(lambda* (#:key outputs #:allow-other-keys) (invoke "make"
(let ((out (assoc-ref outputs "out"))) (string-append "PREFIX=" #$output)
(invoke "make" "install")))
(string-append "PREFIX=" out) (add-after 'install 'remove-usr-directory
"install")))) (lambda* (#:key outputs #:allow-other-keys)
(add-after 'install 'remove-usr-directory (delete-file-recursively (string-append #$output "/usr")))))
(lambda* (#:key outputs #:allow-other-keys) #:test-target "tests"))
(let ((out (assoc-ref outputs "out")))
(delete-file-recursively (string-append out "/usr"))))))
#:test-target "tests"))
(native-inputs (list bc)) (native-inputs (list bc))
(synopsis "Many common UNIX utilities in a single executable") (synopsis "Many common UNIX utilities in a single executable")
(description "ToyBox combines tiny versions of many common UNIX utilities (description "ToyBox combines tiny versions of many common UNIX utilities