summaryrefslogtreecommitdiff
path: root/gnu/packages/ntp.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/ntp.scm')
-rw-r--r--gnu/packages/ntp.scm43
1 files changed, 39 insertions, 4 deletions
diff --git a/gnu/packages/ntp.scm b/gnu/packages/ntp.scm
index 41d06f7018..fed16fc199 100644
--- a/gnu/packages/ntp.scm
+++ b/gnu/packages/ntp.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2017, 2018, 2022, 2025 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019 Maxim Cournoyer <maxim@guixotic.coop>
;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
@@ -34,11 +34,14 @@
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages build-tools)
#:use-module (gnu packages gps)
+ #:use-module (gnu packages guile)
#:use-module (gnu packages libevent)
#:use-module (gnu packages linux)
#:use-module (gnu packages m4)
#:use-module (gnu packages nettle)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
@@ -46,6 +49,7 @@
#:use-module (gnu packages ruby-check)
#:use-module (gnu packages time)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages web)
#:use-module (guix build-system gnu)
#:use-module (guix build-system waf)
#:use-module (guix download)
@@ -167,7 +171,13 @@ time-stamping or reference clock, sub-microsecond accuracy is possible.")
(rename-file "sntp/libevent:build-aux"
"sntp/libevent/build-aux")))))
(native-inputs (list which pkg-config))
- (inputs (cons* openssl libevent
+ (inputs (cons* guile-3.0 ; for wrap-script
+ libevent
+ openssl
+ perl
+ perl-http-tiny
+ perl-io-socket-ssl
+ perl-net-ssleay
;; Build with POSIX capabilities support on GNU/Linux. This allows
;; 'ntpd' to run as non-root (when invoked with '-u'.)
(if (target-linux?)
@@ -187,7 +197,32 @@ time-stamping or reference clock, sub-microsecond accuracy is possible.")
(lambda _
(substitute* "tests/libntp/Makefile.in"
(("test-decodenetnum\\$\\(EXEEXT\\) ")
- "")))))))
+ ""))))
+ (add-after 'unpack 'update-leap-file-source
+ ;; Follow the text redirect from the IETF.
+ (lambda _
+ (substitute* '("scripts/update-leap/invoke-update-leap.texi"
+ "scripts/update-leap/update-leap.in")
+ (("https://www.ietf.org/timezones/data/leap-seconds.list")
+ "https://data.iana.org/time-zones/data/leap-seconds.list"))))
+ (add-after 'unpack 'use-absolute-path-in-files
+ (lambda _
+ (substitute* "scripts/lib/NTP/Util.pm"
+ (("(ntpq_path = ')ntpq(';)" _ first last)
+ (string-append first #$output "/bin/ntpq" last))
+ (("(sntp_path = ')sntp(';)" _ first last)
+ (string-append first #$output "/bin/sntp" last)))
+ (substitute* "scripts/calc_tickadj/calc_tickadj.in"
+ (("`tickadj`")
+ (string-append "`" #$output "/bin/tickadj`")))))
+ (add-after 'install 'adjust-scripts
+ (lambda _
+ (substitute* (string-append #$output "/bin/calc_tickadj")
+ (("/etc/ntp/drift")
+ "/var/run/ntpd/ntp.drift"))
+ (wrap-script (string-append #$output "/bin/update-leap")
+ `("PERL5LIB" ":" prefix
+ (,(getenv "PERL5LIB")))))))))
(build-system gnu-build-system)
(synopsis "Real time clock synchronization system")
(description "NTP is a system designed to synchronize the clocks of
@@ -215,7 +250,7 @@ computers over a network.")
m4
pkg-config
pps-tools
- python-waf
+ waf
ruby-asciidoctor/minimal))
(inputs (cons* gpsd openssl
;; Build with POSIX capabilities and syscall filtering