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