[bug#56331] gnu: Graft tzdata to install leap-seconds.list.
Commit Message
* gnu/packages/base.scm (tzdata)[replacement]: New field.
(tzdata-leap-seconds-list): New private variable.
---
gnu/packages/base.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Comments
leap-seconds.list is required by the hare programming language (which is
currently being packaged) for accurate datetime calculations.
It is optionally used by ntpd with the "leapfile" directive in ntpd.conf.
On Fri Jul 1, 2022 at 2:53 AM BST, Antero Mejr via Guix-patches via wrote:
> @@ -1305,6 +1305,7 @@ (define-public tzdata
> ;; This package should be kept in sync with python-pytz in (gnu packages
> ;; time).
> (version "2022a")
> + (replacement tzdata-leap-seconds-list)
> (source (origin
> (method url-fetch)
> (uri (string-append
> @@ -1390,6 +1391,19 @@ (define-public tzdata
> and daylight-saving rules.")
> (license public-domain)))
There's no need to graft it, as long as you make sure tzdata-for-tests
isn't rebuilt.
@@ -1305,6 +1305,7 @@ (define-public tzdata
;; This package should be kept in sync with python-pytz in (gnu packages
;; time).
(version "2022a")
+ (replacement tzdata-leap-seconds-list)
(source (origin
(method url-fetch)
(uri (string-append
@@ -1390,6 +1391,19 @@ (define-public tzdata
and daylight-saving rules.")
(license public-domain)))
+(define tzdata-leap-seconds-list
+ (package
+ (inherit tzdata)
+ (arguments
+ (substitute-keyword-arguments (package-arguments tzdata)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'copy-leap-seconds-list
+ (lambda _
+ (copy-file "leap-seconds.list"
+ (string-append
+ #$output "/share/zoneinfo/leap-seconds.list"))))))))))
+
;;; A "fixed" version of tzdata, which is used in the test suites of glib and R
;;; and a few other places. We can update this whenever we are able to rebuild
;;; thousands of packages (for example, in a core-updates rebuild). This package