From 8c67eec66808f992c264cd1eea0d111e5aa54867 Mon Sep 17 00:00:00 2001 From: Adrian Pistol Date: Wed, 9 Oct 2024 19:03:56 +0200 Subject: [PATCH] chrony: correct platform list; fix build on darwin --- pkgs/by-name/ch/chrony/package.nix | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ch/chrony/package.nix b/pkgs/by-name/ch/chrony/package.nix index 231695be6ebe..8a0a47eaea88 100644 --- a/pkgs/by-name/ch/chrony/package.nix +++ b/pkgs/by-name/ch/chrony/package.nix @@ -1,6 +1,7 @@ { lib, stdenv, + overrideSDK, fetchurl, pkg-config, gnutls, @@ -12,7 +13,17 @@ nixosTests, }: -stdenv.mkDerivation rec { +let + stdenv' = + if stdenv.hostPlatform.isDarwin then + overrideSDK stdenv { + darwinSdkVersion = "11.0"; + darwinMinVersion = "10.13"; + } + else + stdenv; +in +stdenv'.mkDerivation rec { pname = "chrony"; version = "4.5"; @@ -55,7 +66,7 @@ stdenv.mkDerivation rec { patchShebangs test ''; - hardeningEnable = [ "pie" ]; + hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ]; passthru.tests = { inherit (nixosTests) chrony chrony-ptp; @@ -65,7 +76,15 @@ stdenv.mkDerivation rec { description = "Sets your computer's clock from time servers on the Net"; homepage = "https://chrony.tuxfamily.org/"; license = lib.licenses.gpl2Only; - platforms = with lib.platforms; linux ++ freebsd ++ openbsd; + platforms = + with lib.platforms; + builtins.concatLists [ + linux + freebsd + netbsd + darwin + illumos + ]; maintainers = with lib.maintainers; [ fpletz thoughtpolice