Skip to content

Commit

Permalink
feat: install libphp with 8.3 ZTS
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored and BrewTestBot committed Dec 14, 2024
1 parent d6b06d5 commit 135ff0e
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def install
fpm_user = OS.mac? ? "_www" : "www-data"
fpm_group = OS.mac? ? "_www" : "www-data"

args = %W[
shared_args = %W[
--prefix=#{prefix}
--localstatedir=#{var}
--sysconfdir=#{config_path}
Expand All @@ -125,7 +125,6 @@ def install
--enable-dba
--enable-exif
--enable-ftp
--enable-fpm
--enable-gd
--enable-intl
--enable-mbregex
Expand All @@ -143,14 +142,11 @@ def install
--enable-sysvsem
--enable-sysvshm
--enable-zts
--with-apxs2=#{Formula["httpd"].opt_bin}/apxs
--with-bz2#{headers_path}
--with-curl
--with-external-gd
--with-external-pcre
--with-ffi
--with-fpm-user=#{fpm_user}
--with-fpm-group=#{fpm_group}
--with-gettext=#{Formula["gettext"].opt_prefix}
--with-gmp=#{Formula["gmp"].opt_prefix}
--with-iconv#{headers_path}
Expand Down Expand Up @@ -183,14 +179,40 @@ def install
]

if OS.mac?
args << "--enable-dtrace"
args << "--with-ldap-sasl"
args << "--with-os-sdkpath=#{MacOS.sdk_path_if_needed}"
shared_args << "--enable-dtrace"
shared_args << "--with-ldap-sasl"
shared_args << "--with-os-sdkpath=#{MacOS.sdk_path_if_needed}"
else
args << "--disable-dtrace"
args << "--without-ldap-sasl"
args << "--without-ndbm"
args << "--without-gdbm"
shared_args << "--disable-dtrace"
shared_args << "--without-ldap-sasl"
shared_args << "--without-ndbm"
shared_args << "--without-gdbm"
end

args = shared_args.map(&:clone)
args << "--with-apxs2=#{Formula["httpd"].opt_bin}/apxs"
args << "--enable-fpm"
args << "--with-fpm-user=#{fpm_user}"
args << "--with-fpm-group=#{fpm_group}"

system "./configure", *args
system "make"
system "make", "install"

# Build libphp in another pass,
# because it's not possible to build Apache and embed at the same time
args = shared_args.map(&:clone)
args << "--disable-cgi"
args << "--disable-cli"
args << "--disable-phpdbg"

if OS.mac?
args << "--disable-opcache-jit"
args << "--enable-embed=static"
args << "--enable-shared=no"
args << "--enable-static"
else
args << "--enable-embed"
end

system "./configure", *args
Expand Down

0 comments on commit 135ff0e

Please sign in to comment.