From 2146bad5d5b5c604b65936810bad5dfb4ff51797 Mon Sep 17 00:00:00 2001 From: Andy Scott Date: Thu, 23 Mar 2023 19:46:17 -0700 Subject: [PATCH] monit: add support for darwin. Updates the monit package to build on recent (2023) darwin machines. --- pkgs/tools/system/monit/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/monit/default.nix b/pkgs/tools/system/monit/default.nix index 68766c10d218..ded057d6babd 100644 --- a/pkgs/tools/system/monit/default.nix +++ b/pkgs/tools/system/monit/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, darwin , bison , flex , zlib @@ -20,11 +21,19 @@ stdenv.mkDerivation rec { sha256 = "sha256-Gs6InAGDRzqdcBYN9lM7tuEzjcE1T1koUHgD4eKoY7U="; }; - nativeBuildInputs = [ bison flex ]; + nativeBuildInputs = [ bison flex ] ++ + lib.optional stdenv.hostPlatform.isDarwin [ + darwin.apple_sdk.frameworks.DiskArbitration + ]; + buildInputs = [ zlib.dev libxcrypt ] ++ lib.optionals useSSL [ openssl ] ++ lib.optionals usePAM [ pam ]; + preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure --replace "-framework System" "-lSystem" + ''; + configureFlags = [ (lib.withFeature usePAM "pam") ] ++ (if useSSL then [ @@ -43,6 +52,6 @@ stdenv.mkDerivation rec { description = "Monitoring system"; license = lib.licenses.agpl3; maintainers = with lib.maintainers; [ raskin wmertens ryantm ]; - platforms = with lib.platforms; linux; + platforms = with lib; platforms.linux ++ platforms.darwin; }; }