summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhislain Vaillant <ghislain.vaillant@inria.fr>2026-03-06 18:13:14 +0100
committerGhislain Vaillant <ghislain.vaillant@inria.fr>2026-03-12 14:03:32 +0100
commitd4d1d94e4cf9b74ce21c8ede0eb4655d66e5148f (patch)
tree4d49557c12f2ab9d4bc2945af85c7c9c2b2769b2
parent3531631c54d385c530c50a7fad1be01aba3a6429 (diff)
cpp: Add howard-hinnant-date.
* guix-science/packages/cpp.scm (howard-hinnant-date): New variable.
-rw-r--r--guix-science/packages/cpp.scm59
1 files changed, 59 insertions, 0 deletions
diff --git a/guix-science/packages/cpp.scm b/guix-science/packages/cpp.scm
index 78c0979..c30481b 100644
--- a/guix-science/packages/cpp.scm
+++ b/guix-science/packages/cpp.scm
@@ -13,6 +13,7 @@
13 #:use-module (guix-science packages serialization) 13 #:use-module (guix-science packages serialization)
14 #:use-module (gnu packages) 14 #:use-module (gnu packages)
15 #:use-module (gnu packages algebra) 15 #:use-module (gnu packages algebra)
16 #:use-module (gnu packages base)
16 #:use-module (gnu packages bash) 17 #:use-module (gnu packages bash)
17 #:use-module (gnu packages benchmark) 18 #:use-module (gnu packages benchmark)
18 #:use-module (gnu packages boost) 19 #:use-module (gnu packages boost)
@@ -245,6 +246,64 @@ and iterators.")
245 (home-page "https://ddc.mdls.fr/") 246 (home-page "https://ddc.mdls.fr/")
246 (license license:expat))) 247 (license license:expat)))
247 248
249(define-public howard-hinnant-date
250 (package
251 (name "howard-hinnant-date")
252 (version "3.0.4")
253 (source
254 (origin
255 (method git-fetch)
256 (uri (git-reference
257 (url "https://github.com/HowardHinnant/date")
258 (commit (string-append "v" version))))
259 (file-name (git-file-name name version))
260 (sha256
261 (base32 "1hsw6mhhhid80zvl24mql5ahn8pjhyjd31nmj008s64pdv5w78cz"))))
262 (build-system cmake-build-system)
263 (arguments
264 (list
265 #:configure-flags
266 #~(list "-DUSE_SYSTEM_TZ_DB:BOOL=ON"
267 "-DBUILD_SHARED_LIBS:BOOL=ON"
268 "-DCOMPILE_WITH_C_LOCALE:BOOL=ON"
269 "-DBUILD_TZ_LIB:BOOL=ON")
270 #:phases
271 #~(modify-phases %standard-phases
272 (add-after 'unpack 'use-system-zoneinfo
273 (lambda* (#:key inputs #:allow-other-keys)
274 (let ((zoneinfo (search-input-directory inputs "share/zoneinfo")))
275 (substitute* "src/tz.cpp"
276 (("CONSTDATA auto tz_dir_default =.*;")
277 (string-append "CONSTDATA auto tz_dir_default = \""
278 zoneinfo "\";"))))))
279 (add-after 'unpack 'fix-tests
280 (lambda _
281 (with-directory-excursion "test"
282 ;; Exclude tests which rely on timezone discovery.
283 (for-each delete-file
284 (list "solar_hijri_test/parse.pass.cpp"
285 "tz_test/zoned_time_deduction.pass.cpp"))
286 ;; Avoid superfluous linkage with libcurl, since we are using the
287 ;; system's timezone database.
288 (substitute* "testit"
289 (("-lcurl")
290 "")))))
291 (replace 'check
292 (lambda* (#:key tests? #:allow-other-keys)
293 (when tests?
294 (with-directory-excursion "../source/test"
295 (setenv "CXX" "g++")
296 (setenv "OPTIONS" "-DONLY_C_LOCALE=1 -DUSE_OS_TZDB=1")
297 (invoke "./testit"))))))))
298 (inputs (list tzdata))
299 (home-page "https://howardhinnant.github.io/date/")
300 (synopsis "Date and time library based on the C++ chrono header")
301 (description
302 "@code{howardhinnant-date} extends @code{<chrono>} to calendars and
303timezones, focusing on a seamless integration with the existing @code{<chrono>}
304library, type safety, performance and ease of use.")
305 (license license:expat)))
306
248(define-public intervalset 307(define-public intervalset
249 (package 308 (package
250 (name "intervalset") 309 (name "intervalset")