Permalink
Browse files

haproxy: add lua optional dependency (#22169)

  • Loading branch information...
catap authored and ilovezfs committed Jan 2, 2018
1 parent 392eb65 commit 457a23b628d647998687f0a60655173da088ebcc
Showing with 9 additions and 0 deletions.
  1. +9 −0 Formula/haproxy.rb
@@ -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 @@ def install
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"

0 comments on commit 457a23b

Please sign in to comment.