Archived
1
0
Fork 0

gnu: xfstests: Update package style.

* gnu/packages/file-systems.scm (xfstests)[arguments]:
Rewrite as G-expressions.  Never refer to inputs by label.
[inputs]: Remove input labels.
This commit is contained in:
Tobias Geerinckx-Rice 2023-08-06 02:00:00 +02:00
parent ef919436f6
commit bf587a2094
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -1217,8 +1217,9 @@ APFS.")
(base32 "1sbkryl04xflrk6jb4fsl3h2whilj5m3vpdkpwwb26idp7ckjjv6")))) (base32 "1sbkryl04xflrk6jb4fsl3h2whilj5m3vpdkpwwb26idp7ckjjv6"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-tool-locations (add-after 'unpack 'patch-tool-locations
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* "common/config" (substitute* "common/config"
@ -1229,8 +1230,7 @@ APFS.")
(substitute* file (substitute* file
(("( -s|#.|[= ])(/bin/sh|/bin/bash)" _ pre match) (("( -s|#.|[= ])(/bin/sh|/bin/bash)" _ pre match)
(string-append pre (string-append pre
(assoc-ref inputs "bash") (search-input-file inputs match)))
match))
(("/bin/(rm|true)" match) (("/bin/(rm|true)" match)
(search-input-file inputs match)) (search-input-file inputs match))
(("/usr(/bin/time)" _ match) (("/usr(/bin/time)" _ match)
@ -1252,30 +1252,26 @@ APFS.")
(add-after 'install 'wrap-xfstests/check (add-after 'install 'wrap-xfstests/check
;; Keep wrapping distinct from 'create-helper-script below: users ;; Keep wrapping distinct from 'create-helper-script below: users
;; must be able to invoke xfstests/check directly if they prefer. ;; must be able to invoke xfstests/check directly if they prefer.
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))) (wrap-program (string-append #$output "/xfstests/check")
(wrap-program (string-append out "/xfstests/check")
;; Prefix the user's PATH with the minimum required tools. ;; Prefix the user's PATH with the minimum required tools.
;; The suite has many other optional dependencies and will ;; The suite has many other optional dependencies and will
;; automatically select tests based on the original PATH. ;; automatically select tests based on the original PATH.
`("PATH" ":" prefix `("PATH" ":" prefix
,(map (lambda (name) ,(map (lambda (file)
(let ((input (assoc-ref inputs name))) (dirname (search-input-file inputs file)))
(string-append input "/bin:" (list "bin/setfacl" ; acl
input "/sbin"))) "bin/attr" ; attr
(list "acl" "bin/ls" ; coreutils
"attr" "bin/hostname" ; inetutils
"coreutils" "sbin/mkfs.xfs")))))) ; xfsprogs
"inetutils"
"xfsprogs")))))))
(add-after 'install 'create-helper (add-after 'install 'create-helper
;; Upstream installs only a check script that's not in $PATH and ;; Upstream installs only a check script that's not in $PATH and
;; would try to write to the store without explaining how to change ;; would try to write to the store without explaining how to change
;; that. Install a simple helper script to make it discoverable. ;; that. Install a simple helper script to make it discoverable.
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((check (string-append #$output "/xfstests/check"))
(check (string-append out "/xfstests/check")) (bin (string-append #$output "/bin"))
(bin (string-append out "/bin"))
(helper (string-append bin "/xfstests-check"))) (helper (string-append bin "/xfstests-check")))
(mkdir-p bin) (mkdir-p bin)
(with-output-to-file helper (with-output-to-file helper
@ -1324,14 +1320,14 @@ xfstest's \"~a\" command (with any OPTIONs) as documented below.\n\n"
(native-inputs (native-inputs
(list autoconf automake libtool)) (list autoconf automake libtool))
(inputs (inputs
`(("acl" ,acl) (list acl
("attr" ,attr) attr
("guile" ,guile-3.0) ; for our xfstests-check helper script guile-3.0 ; for our xfstests-check helper script
("inetutils" ,inetutils) ; for hostname inetutils
("libuuid" ,util-linux "lib") `(,util-linux "lib")
("perl" ,perl) ; to automagically patch shebangs perl
("time" ,time) time
("xfsprogs" ,xfsprogs))) xfsprogs))
(home-page "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git") (home-page "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git")
(synopsis "File system @acronym{QA, Quality Assurance} test suite") (synopsis "File system @acronym{QA, Quality Assurance} test suite")
(description (description