Archived
1
0
Fork 0

gnu: libfaketime: Use gexps.

* gnu/packages/check.scm (libfaketime) [arguments]: Use gexps, gexp variables
and search-input-file where appropriate.
This commit is contained in:
Maxim Cournoyer 2023-02-26 20:37:07 -05:00
parent 41da613ba3
commit e5dd816c1c
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -35,7 +35,7 @@
;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com> ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
;;; Copyright © 2020 Vinicius Monego <monego@posteo.net> ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org> ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr> ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be> ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 David Elsing <david.elsing@posteo.net> ;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
@ -3076,38 +3076,36 @@ portable to just about any platform.")
(file-name (git-file-name name version)))) (file-name (git-file-name name version))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases (list
(add-after 'unpack 'embed-date-reference #:test-target "test"
(lambda* (#:key inputs #:allow-other-keys) #:phases
(let ((coreutils (assoc-ref inputs "coreutils"))) #~(modify-phases %standard-phases
(substitute* "src/faketime.c" (add-after 'unpack 'embed-date-reference
(("\"date\"") (lambda* (#:key inputs #:allow-other-keys)
(string-append "\"" coreutils "/bin/date\"")))))) (substitute* "src/faketime.c"
(replace 'configure (("\"date\"")
(lambda* (#:key outputs #:allow-other-keys) (format #f "~s" (search-input-file inputs "bin/date"))))))
(let ((out (assoc-ref outputs "out"))) (replace 'configure
(setenv "CC" ,(cc-for-target)) (lambda* (#:key outputs #:allow-other-keys)
(setenv "PREFIX" out) (setenv "CC" #$(cc-for-target))
(setenv "PREFIX" #$output)
;; XXX: Without this flag, the CLOCK_REALTIME test hangs ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
;; indefinitely. See README.packagers for more information. ;; indefinitely. See README.packagers for more information.
;; There are specific instructions to not enable more flags ;; There are specific instructions to not enable more flags
;; than absolutely needed. ;; than absolutely needed.
,(if (or (target-ppc64le?) #$@(if (or (target-ppc64le?)
(target-riscv64?)) (target-riscv64?))
`(setenv "FAKETIME_COMPILE_CFLAGS" #~((setenv "FAKETIME_COMPILE_CFLAGS"
"-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER") "-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER"))
`(setenv "FAKETIME_COMPILE_CFLAGS" #~((setenv "FAKETIME_COMPILE_CFLAGS"
"-DFORCE_MONOTONIC_FIX"))))) "-DFORCE_MONOTONIC_FIX")))))
(add-before 'check 'pre-check (add-before 'check 'pre-check
(lambda _ (lambda _
(substitute* "test/functests/test_exclude_mono.sh" (substitute* "test/functests/test_exclude_mono.sh"
(("/bin/bash") (which "bash")))))) (("/bin/bash") (which "bash"))))))))
#:test-target "test")) (native-inputs (list perl)) ;for tests
(native-inputs (inputs (list coreutils))
(list perl)) ;for tests
(inputs
(list coreutils))
(synopsis "Fake the system time for single applications") (synopsis "Fake the system time for single applications")
(description (description
"The libfaketime library allows users to modify the system time that an "The libfaketime library allows users to modify the system time that an