Skip to content

Commit

Permalink
universal prefix selection #407
Browse files Browse the repository at this point in the history
  • Loading branch information
denji committed Feb 22, 2023
1 parent eb3a903 commit 19599aa
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Formula/nginx-full.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class NginxFull < Formula
depends_on "libxslt" if build.with?("xsltproc-module") ||
build.with?("xslt")
depends_on "libzip" if build.with?("unzip")
depends_on "luajit" if build.with?("lua-module")
depends_on "pcre"
depends_on "valgrind" if build.with?("no-pool-nginx")
depends_on "gd" => :optional
Expand Down Expand Up @@ -243,6 +244,10 @@ def install

cc_opt += " -I#{Formula["libzip"].opt_lib}/libzip/include" if build.with?("unzip")

# https://github.com/openresty/lua-nginx-module/issues/1984
# module do not support with PCRE2 on nginx 1.21.5
ld_opt += " -lpcre" if build.with?("lua-module")

args = %W[
--prefix=#{prefix}
--with-http_ssl_module
Expand Down Expand Up @@ -292,15 +297,11 @@ def install
args << "--add-module=#{nginx_ext}"
end

# Install LuaJit
# Install lua-module with juaJit
if build.with?("lua-module")
if(File.exist?('/usr/local/bin/brew'))
luajit_path = `/usr/local/bin/brew --prefix luajit`.chomp
else
luajit_path = `/opt/homebrew/bin/brew --prefix luajit`.chomp
end
ENV["LUAJIT_INC"] = "#{luajit_path}/include/luajit-2.1"
ENV["LUAJIT_LIB"] = "#{luajit_path}/lib"
luajit_version = Formula["luajit"].pkg_version.to_s.sub(/^(\d+\.\d+).*/, '\1')
ENV["LUAJIT_INC"] = "#{Formula["luajit"].opt_include}/luajit-#{luajit_version}"
ENV["LUAJIT_LIB"] = "#{Formula["luajit"].opt_lib}"
end

if build.head?
Expand Down

0 comments on commit 19599aa

Please sign in to comment.