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

haproxy: Provide LUA and PCRE support as configurable options

Both are enabled by default. Except for LUA on Darwin where
compilation fails. (See #23901.)
This commit is contained in:
Thomas Bach 2017-03-27 10:21:19 +02:00
parent e58e681d9f
commit 45788aeebe

View file

@ -1,4 +1,11 @@
{ stdenv, pkgs, fetchurl, openssl, zlib }:
{ useLua ? false
, usePcre ? false
, stdenv, fetchurl
, openssl, zlib, lua ? null, pcre ? null
}:
assert useLua -> lua != null;
assert usePcre -> pcre != null;
stdenv.mkDerivation rec {
pname = "haproxy";
@ -12,7 +19,9 @@ stdenv.mkDerivation rec {
sha256 = "ebb31550a5261091034f1b6ac7f4a8b9d79a8ce2a3ddcd7be5b5eb355c35ba65";
};
buildInputs = [ openssl zlib ];
buildInputs = [ openssl zlib ]
++ stdenv.lib.optional useLua lua
++ stdenv.lib.optional usePcre pcre;
# TODO: make it work on bsd as well
makeFlags = [
@ -25,6 +34,13 @@ stdenv.mkDerivation rec {
buildFlags = [
"USE_OPENSSL=yes"
"USE_ZLIB=yes"
] ++ stdenv.lib.optionals usePcre [
"USE_PCRE=yes"
"USE_PCRE_JIT=yes"
] ++ stdenv.lib.optionals useLua [
"USE_LUA=yes"
"LUA_LIB=${lua}/lib"
"LUA_INC=${lua}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "CC=cc";
meta = {