From 45788aeebed646938f525508bd75ca0319b668d9 Mon Sep 17 00:00:00 2001 From: Thomas Bach Date: Mon, 27 Mar 2017 10:21:19 +0200 Subject: [PATCH] haproxy: Provide LUA and PCRE support as configurable options Both are enabled by default. Except for LUA on Darwin where compilation fails. (See #23901.) --- pkgs/tools/networking/haproxy/default.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/haproxy/default.nix b/pkgs/tools/networking/haproxy/default.nix index 88c750525b26..b7c8111751a6 100644 --- a/pkgs/tools/networking/haproxy/default.nix +++ b/pkgs/tools/networking/haproxy/default.nix @@ -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 = {