From e5dd816c1c0f4aa1bc230b27ebcf5f907f8ffaa6 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 26 Feb 2023 20:37:07 -0500 Subject: gnu: libfaketime: Use gexps. * gnu/packages/check.scm (libfaketime) [arguments]: Use gexps, gexp variables and search-input-file where appropriate. --- gnu/packages/check.scm | 64 ++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) (limited to 'gnu/packages/check.scm') 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 ;;; Copyright © 2020 Vinicius Monego ;;; Copyright © 2020 Tanguy Le Carrour -;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer +;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer ;;; Copyright © 2021 Hugo Lecomte ;;; Copyright © 2022 Maxime Devos ;;; Copyright © 2022 David Elsing @@ -3076,38 +3076,36 @@ (define-public libfaketime (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 -- cgit v1.2.3