summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2025-07-03 15:07:06 +0200
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-07-04 12:50:27 +0100
commitcd1f687f5f4cbd9eb49a25bd8ec56771c79e7ccf (patch)
treecc56a16e8089ab27447f925cb55816585022c33f
parentbc62e66b9b670e496cf982f7b272f1a05c2c8110 (diff)
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>
-rw-r--r--gnu/packages/calendar.scm62
1 files changed, 30 insertions, 32 deletions
diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm
index 03c9412df3e..faf7779ce73 100644
--- a/gnu/packages/calendar.scm
+++ b/gnu/packages/calendar.scm
@@ -112,8 +112,8 @@ available in French.")
112 (origin 112 (origin
113 (method git-fetch) 113 (method git-fetch)
114 (uri (git-reference 114 (uri (git-reference
115 (url "https://github.com/HowardHinnant/date") 115 (url "https://github.com/HowardHinnant/date")
116 (commit (string-append "v" version)))) 116 (commit (string-append "v" version))))
117 (file-name (git-file-name name version)) 117 (file-name (git-file-name name version))
118 (sha256 118 (sha256
119 (base32 "1qk7pgnk0bpinja28104qha6f7r1xwh5dy3gra7vjkqwl0jdwa35")) 119 (base32 "1qk7pgnk0bpinja28104qha6f7r1xwh5dy3gra7vjkqwl0jdwa35"))
@@ -125,37 +125,35 @@ available in French.")
125 (inputs (list tzdata)) 125 (inputs (list tzdata))
126 (build-system cmake-build-system) 126 (build-system cmake-build-system)
127 (arguments 127 (arguments
128 '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON" 128 (list
129 "-DBUILD_SHARED_LIBS=ON" 129 #:test-target "testit"
130 "-DBUILD_TZ_LIB=ON" 130 #:configure-flags
131 "-DENABLE_DATE_TESTING=ON") 131 #~(list "-DUSE_SYSTEM_TZ_DB=ON" "-DBUILD_SHARED_LIBS=ON"
132 #:phases 132 "-DBUILD_TZ_LIB=ON" "-DENABLE_DATE_TESTING=ON")
133 (modify-phases %standard-phases 133 #:phases
134 (add-after 'unpack 'patch-bin-bash 134 #~(modify-phases %standard-phases
135 (lambda* (#:key inputs #:allow-other-keys) 135 (add-after 'unpack 'patch-bin-bash
136 (substitute* "compile_fail.sh" 136 (lambda* (#:key inputs #:allow-other-keys)
137 (("/bin/bash") (which "bash"))) 137 (substitute* "compile_fail.sh"
138 #t)) 138 (("/bin/bash")
139 (add-after 'unpack 'patch-zoneinfo-path 139 (search-input-file inputs "bin/bash")))))
140 (lambda* (#:key inputs #:allow-other-keys) 140 (add-after 'unpack 'patch-zoneinfo-path
141 (substitute* "src/tz.cpp" 141 (lambda* (#:key inputs #:allow-other-keys)
142 (("/usr/share/zoneinfo") 142 (substitute* "src/tz.cpp"
143 (search-input-directory inputs 143 (("/usr/share/zoneinfo")
144 "share/zoneinfo"))))) 144 (search-input-directory inputs "share/zoneinfo")))))
145 (add-after 'unpack 'skip-failing-tests 145 (add-after 'unpack 'skip-failing-tests
146 ;; Disable test that requires checking timezone that 146 ;; Disable test that requires checking timezone that
147 ;; isn't set in the build environment. 147 ;; isn't set in the build environment.
148 (lambda _ 148 (lambda _
149 (for-each delete-file 149 (for-each delete-file
150 '("test/solar_hijri_test/parse.pass.cpp" 150 '("test/solar_hijri_test/parse.pass.cpp"
151 "test/tz_test/zoned_time_deduction.pass.cpp")))) 151 "test/tz_test/zoned_time_deduction.pass.cpp")))))))
152 (replace 'check
153 (lambda _
154 (invoke "make" "testit"))))))
155 (synopsis "Date and time library for C++11 and C++14") 152 (synopsis "Date and time library for C++11 and C++14")
156 (description "Date is a header only C++ library that extends the chrono 153 (description
157date algorithms library for calendar dates and durations. It also provides 154 "Date is a header only C++ library that extends the chrono date
158the <tz.h> library for handling time zones and leap seconds.") 155algorithms library for calendar dates and durations. It also provides the
156<tz.h> library for handling time zones and leap seconds.")
159 (home-page "https://howardhinnant.github.io/date/date.html") 157 (home-page "https://howardhinnant.github.io/date/date.html")
160 (license license:expat))) 158 (license license:expat)))
161 159