about summary refs log tree commit diff
path: root/pkgs/tools/networking/haproxy
diff options
context:
space:
mode:
authorThomas Bach <t.bach@ilexius.de>2017-03-27 10:21:19 +0200
committerThomas Bach <t.bach@ilexius.de>2017-03-29 12:23:05 +0200
commit45788aeebed646938f525508bd75ca0319b668d9 (patch)
treee2d01d3d4c0a8e3b2b8b3cfbdd1d570ed39d60d5 /pkgs/tools/networking/haproxy
parente58e681d9f1407142409c6414769d21df9ff4bd7 (diff)
haproxy: Provide LUA and PCRE support as configurable options
Both are enabled by default. Except for LUA on Darwin where
compilation fails. (See #23901.)
Diffstat (limited to 'pkgs/tools/networking/haproxy')
-rw-r--r--pkgs/tools/networking/haproxy/default.nix20
1 files changed, 18 insertions, 2 deletions
diff --git a/pkgs/tools/networking/haproxy/default.nix b/pkgs/tools/networking/haproxy/default.nix
index 88c750525b26b..b7c8111751a67 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 = {