diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-02-26 20:37:07 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-02-26 23:41:41 -0500 |
commit | e5dd816c1c0f4aa1bc230b27ebcf5f907f8ffaa6 (patch) | |
tree | 12cb757c5744258bb1cf44e5b4de3ca52e0f32ae /gnu/packages/check.scm | |
parent | 41da613ba3f880475c783da4925caeb2395631d7 (diff) | |
download | guix-e5dd816c1c0f4aa1bc230b27ebcf5f907f8ffaa6.tar guix-e5dd816c1c0f4aa1bc230b27ebcf5f907f8ffaa6.tar.gz |
gnu: libfaketime: Use gexps.
* gnu/packages/check.scm (libfaketime) [arguments]: Use gexps, gexp variables
and search-input-file where appropriate.
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r-- | gnu/packages/check.scm | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index cb9fa6fa6d..f82b01def1 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -35,7 +35,7 @@ ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com> ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net> ;;; 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 © 2022 Maxime Devos <maximedevos@telenet.be> ;;; 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)))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'embed-date-reference - (lambda* (#:key inputs #:allow-other-keys) - (let ((coreutils (assoc-ref inputs "coreutils"))) - (substitute* "src/faketime.c" - (("\"date\"") - (string-append "\"" coreutils "/bin/date\"")))))) - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (setenv "CC" ,(cc-for-target)) - (setenv "PREFIX" out) - - ;; XXX: Without this flag, the CLOCK_REALTIME test hangs - ;; indefinitely. See README.packagers for more information. - ;; There are specific instructions to not enable more flags - ;; than absolutely needed. - ,(if (or (target-ppc64le?) - (target-riscv64?)) - `(setenv "FAKETIME_COMPILE_CFLAGS" - "-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER") - `(setenv "FAKETIME_COMPILE_CFLAGS" - "-DFORCE_MONOTONIC_FIX"))))) - (add-before 'check 'pre-check - (lambda _ - (substitute* "test/functests/test_exclude_mono.sh" - (("/bin/bash") (which "bash")))))) - #:test-target "test")) - (native-inputs - (list perl)) ;for tests - (inputs - (list coreutils)) + (list + #:test-target "test" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'embed-date-reference + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/faketime.c" + (("\"date\"") + (format #f "~s" (search-input-file inputs "bin/date")))))) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (setenv "CC" #$(cc-for-target)) + (setenv "PREFIX" #$output) + + ;; XXX: Without this flag, the CLOCK_REALTIME test hangs + ;; indefinitely. See README.packagers for more information. + ;; There are specific instructions to not enable more flags + ;; than absolutely needed. + #$@(if (or (target-ppc64le?) + (target-riscv64?)) + #~((setenv "FAKETIME_COMPILE_CFLAGS" + "-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER")) + #~((setenv "FAKETIME_COMPILE_CFLAGS" + "-DFORCE_MONOTONIC_FIX"))))) + (add-before 'check 'pre-check + (lambda _ + (substitute* "test/functests/test_exclude_mono.sh" + (("/bin/bash") (which "bash")))))))) + (native-inputs (list perl)) ;for tests + (inputs (list coreutils)) (synopsis "Fake the system time for single applications") (description "The libfaketime library allows users to modify the system time that an |