gnu: fio: Use G-expressions.

* gnu/packages/benchmark.scm (fio)[arguments]:
Rewrite as G-expressions.
This commit is contained in:
Tobias Geerinckx-Rice 2022-05-01 02:00:00 +02:00
parent 140d4f2101
commit 3d84a72966
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -73,36 +73,37 @@
"1qjivkisn7dxk8irrb0rglmmdpbnai6n7vindf18ln0j24cc1x56")))) "1qjivkisn7dxk8irrb0rglmmdpbnai6n7vindf18ln0j24cc1x56"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:modules (,@%gnu-build-system-modules (list #:modules
(ice-9 textual-ports)) `(,@%gnu-build-system-modules
#:test-target "test" (ice-9 textual-ports))
#:configure-flags '("--disable-native") ;don't generate code for the build CPU #:test-target "test"
#:phases #:configure-flags
(modify-phases %standard-phases #~(list "--disable-native") ;don't generate code for the build CPU
(replace 'configure #:phases
(lambda* (#:key (configure-flags ''()) outputs #:allow-other-keys) #~(modify-phases %standard-phases
;; The configure script doesn't understand some of the (replace 'configure
;; GNU options, so we can't use the stock phase. (lambda* (#:key (configure-flags ''()) #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) ;; The configure script doesn't understand some of the
(apply invoke "./configure" ;; GNU options, so we can't use the stock phase.
(string-append "--prefix=" out) (apply invoke "./configure"
configure-flags)))) (string-append "--prefix=" #$output)
;; The main `fio` executable is fairly small and self contained. configure-flags)))
;; Moving the auxiliary scripts to a separate output saves ~100 MiB ;; The main `fio` executable is fairly small and self contained.
;; on the closure. ;; Moving the auxiliary scripts to a separate output saves ~100 MiB
(add-after 'install 'move-outputs ;; on the closure.
(lambda* (#:key outputs #:allow-other-keys) (add-after 'install 'move-outputs
(let ((oldbin (string-append (assoc-ref outputs "out") "/bin")) (lambda _
(newbin (string-append (assoc-ref outputs "utils") "/bin")) (let ((oldbin (string-append #$output "/bin"))
(script? (lambda* (file #:rest _) (newbin (string-append #$output:utils "/bin"))
(call-with-input-file file (script? (lambda* (file #:rest _)
(lambda (port) (call-with-input-file file
(char=? #\# (peek-char port))))))) (lambda (port)
(mkdir-p newbin) (char=? #\# (peek-char port)))))))
(for-each (lambda (file) (mkdir-p newbin)
(link file (string-append newbin "/" (basename file))) (for-each (lambda (file)
(delete-file file)) (link file (string-append newbin "/" (basename file)))
(find-files oldbin script?)))))))) (delete-file file))
(find-files oldbin script?))))))))
(outputs '("out" "utils")) (outputs '("out" "utils"))
(inputs (inputs
(list libaio python zlib)) (list libaio python zlib))