gnu: date: Improve style.

* gnu/packages/calendar.scm (date): Improve style.
  [arguments, description]: Run guix style, guix style -S
  arguments.
  {test-target}: Set it.
  {phases}: Improve phase 'patch-bin-bash.

Change-Id: Iee808fcdd00ceb01d142d9ea23a7e71b5196fcc6
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-07-03 15:07:06 +02:00 committed by Sharlatan Hellseher
parent bc62e66b9b
commit cd1f687f5f
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -112,8 +112,8 @@ available in French.")
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/HowardHinnant/date") (url "https://github.com/HowardHinnant/date")
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "1qk7pgnk0bpinja28104qha6f7r1xwh5dy3gra7vjkqwl0jdwa35")) (base32 "1qk7pgnk0bpinja28104qha6f7r1xwh5dy3gra7vjkqwl0jdwa35"))
@ -125,37 +125,35 @@ available in French.")
(inputs (list tzdata)) (inputs (list tzdata))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
'(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON" (list
"-DBUILD_SHARED_LIBS=ON" #:test-target "testit"
"-DBUILD_TZ_LIB=ON" #:configure-flags
"-DENABLE_DATE_TESTING=ON") #~(list "-DUSE_SYSTEM_TZ_DB=ON" "-DBUILD_SHARED_LIBS=ON"
#:phases "-DBUILD_TZ_LIB=ON" "-DENABLE_DATE_TESTING=ON")
(modify-phases %standard-phases #:phases
(add-after 'unpack 'patch-bin-bash #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'patch-bin-bash
(substitute* "compile_fail.sh" (lambda* (#:key inputs #:allow-other-keys)
(("/bin/bash") (which "bash"))) (substitute* "compile_fail.sh"
#t)) (("/bin/bash")
(add-after 'unpack 'patch-zoneinfo-path (search-input-file inputs "bin/bash")))))
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'patch-zoneinfo-path
(substitute* "src/tz.cpp" (lambda* (#:key inputs #:allow-other-keys)
(("/usr/share/zoneinfo") (substitute* "src/tz.cpp"
(search-input-directory inputs (("/usr/share/zoneinfo")
"share/zoneinfo"))))) (search-input-directory inputs "share/zoneinfo")))))
(add-after 'unpack 'skip-failing-tests (add-after 'unpack 'skip-failing-tests
;; Disable test that requires checking timezone that ;; Disable test that requires checking timezone that
;; isn't set in the build environment. ;; isn't set in the build environment.
(lambda _ (lambda _
(for-each delete-file (for-each delete-file
'("test/solar_hijri_test/parse.pass.cpp" '("test/solar_hijri_test/parse.pass.cpp"
"test/tz_test/zoned_time_deduction.pass.cpp")))) "test/tz_test/zoned_time_deduction.pass.cpp")))))))
(replace 'check
(lambda _
(invoke "make" "testit"))))))
(synopsis "Date and time library for C++11 and C++14") (synopsis "Date and time library for C++11 and C++14")
(description "Date is a header only C++ library that extends the chrono (description
date algorithms library for calendar dates and durations. It also provides "Date is a header only C++ library that extends the chrono date
the <tz.h> library for handling time zones and leap seconds.") algorithms library for calendar dates and durations. It also provides the
<tz.h> library for handling time zones and leap seconds.")
(home-page "https://howardhinnant.github.io/date/date.html") (home-page "https://howardhinnant.github.io/date/date.html")
(license license:expat))) (license license:expat)))