haproxy: add lua optional dependency (#22169)

master
Kirill A. Korinsky 2018-01-02 14:10:36 +04:00 committed by ilovezfs
parent 392eb652d9
commit 457a23b628
1 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ class Haproxy < Formula
depends_on "openssl"
depends_on "pcre"
depends_on "lua" => :optional
def install
args = %w[
@ -25,6 +26,14 @@ class Haproxy < Formula
ADDLIB=-lcrypto
]
if build.with?("lua")
lua = Formula["lua"]
args << "USE_LUA=1"
args << "LUA_LIB=#{lua.opt_lib}"
args << "LUA_INC=#{lua.opt_include}"
args << "LUA_LD_FLAGS=-L#{lua.opt_lib}"
end
# We build generic since the Makefile.osx doesn't appear to work
system "make", "CC=#{ENV.cc}", "CFLAGS=#{ENV.cflags}", "LDFLAGS=#{ENV.ldflags}", *args
man1.install "doc/haproxy.1"