chrony: update build configuration

This commit is contained in:
Izorkin 2023-01-02 15:12:47 +03:00
parent 409c646eeb
commit 53cbb123f5
No known key found for this signature in database
GPG Key ID: 1436C1B3F3679F09
2 changed files with 46 additions and 10 deletions

View File

@ -1,5 +1,7 @@
{ lib, stdenv, fetchurl, pkg-config, libcap, readline, texinfo, nss, nspr
, libseccomp, pps-tools, gnutls }:
{ lib, stdenv, fetchurl, pkg-config
, gnutls, libedit, nspr, nss, readline, texinfo
, libcap, libseccomp, pps-tools
}:
stdenv.mkDerivation rec {
pname = "chrony";
@ -7,22 +9,33 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://download.tuxfamily.org/chrony/${pname}-${version}.tar.gz";
sha256 = "sha256-nQ2oiahl8ImlohYQ/7ZxPjyUOM4wOmO0nC+26v9biAQ=";
hash = "sha256-nQ2oiahl8ImlohYQ/7ZxPjyUOM4wOmO0nC+26v9biAQ=";
};
outputs = [ "out" "man" ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ gnutls libedit nspr nss readline texinfo ]
++ lib.optionals stdenv.isLinux [ libcap libseccomp pps-tools ];
configureFlags = [
"--enable-ntp-signd"
"--sbindir=$(out)/bin"
"--chronyrundir=/run/chrony"
] ++ lib.optional stdenv.isLinux "--enable-scfilter";
patches = [
# Cleanup the installation script
./makefile.patch
];
postPatch = ''
patchShebangs test
'';
buildInputs = [ readline texinfo nss nspr gnutls ]
++ lib.optionals stdenv.isLinux [ libcap libseccomp pps-tools ];
nativeBuildInputs = [ pkg-config ];
hardeningEnable = [ "pie" ];
configureFlags = [ "--chronyvardir=$(out)/var/lib/chrony" "--enable-ntp-signd" ]
++ lib.optional stdenv.isLinux "--enable-scfilter";
meta = with lib; {
description = "Sets your computer's clock from time servers on the Net";
homepage = "https://chrony.tuxfamily.org/";

View File

@ -0,0 +1,23 @@
diff --git a/Makefile.in b/Makefile.in
index ef100a4..47f54f4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -23,7 +23,7 @@
SYSCONFDIR = @SYSCONFDIR@
BINDIR = @BINDIR@
-SBINDIR = @SBINDIR@
+SBINDIR = @BINDIR@
LOCALSTATEDIR = @LOCALSTATEDIR@
CHRONYVARDIR = @CHRONYVARDIR@
DESTDIR =
@@ -86,9 +86,7 @@ getdate :
install: chronyd chronyc
[ -d $(DESTDIR)$(SYSCONFDIR) ] || mkdir -p $(DESTDIR)$(SYSCONFDIR)
- [ -d $(DESTDIR)$(SBINDIR) ] || mkdir -p $(DESTDIR)$(SBINDIR)
[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
- [ -d $(DESTDIR)$(CHRONYVARDIR) ] || mkdir -p $(DESTDIR)$(CHRONYVARDIR)
if [ -f $(DESTDIR)$(SBINDIR)/chronyd ]; then rm -f $(DESTDIR)$(SBINDIR)/chronyd ; fi
if [ -f $(DESTDIR)$(BINDIR)/chronyc ]; then rm -f $(DESTDIR)$(BINDIR)/chronyc ; fi
cp chronyd $(DESTDIR)$(SBINDIR)/chronyd