1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 23:20:55 +00:00

Merge pull request #35248 from telent/cross-monit

monit: cross-compile, and make openssl optional
This commit is contained in:
Jörg Thalheim 2018-04-21 08:56:12 +01:00 committed by GitHub
commit 9d7959de31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
{stdenv, fetchurl, openssl, bison, flex, pam, zlib, usePAM ? stdenv.isLinux }:
{stdenv, fetchurl, openssl, bison, flex, pam, zlib, usePAM ? stdenv.isLinux
, buildPlatform, hostPlatform }:
let useSSL = (openssl != null);
isCross = ( buildPlatform != hostPlatform ) ; in
stdenv.mkDerivation rec {
name = "monit-5.25.1";
@ -9,12 +11,19 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ bison flex ];
buildInputs = [ openssl zlib.dev ] ++ stdenv.lib.optionals usePAM [ pam ];
buildInputs = [ zlib.dev ] ++
stdenv.lib.optionals useSSL [ openssl ] ++
stdenv.lib.optionals usePAM [ pam ];
configureFlags = [
"--with-ssl-incl-dir=${openssl.dev}/include"
"--with-ssl-lib-dir=${openssl.out}/lib"
] ++ stdenv.lib.optionals (! usePAM) [ "--without-pam" ];
configureFlags =
if useSSL then [
"--with-ssl-incl-dir=${openssl.dev}/include"
"--with-ssl-lib-dir=${openssl.out}/lib"
] else [ "--without-ssl" ] ++
stdenv.lib.optionals (! usePAM) [ "--without-pam" ] ++
# will need to check both these are true for musl
stdenv.lib.optionals isCross [ "libmonit_cv_setjmp_available=yes"
"libmonit_cv_vsnprintf_c99_conformant=yes"];
meta = {
homepage = http://mmonit.com/monit/;