Merge pull request #222833 from andyscott/andy/monit-fix-on-darwin

monit: add support for darwin
This commit is contained in:
Weijia Wang 2023-03-24 08:33:04 +02:00 committed by GitHub
commit b41ed471f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
};
}