diff --git a/Formula/php@8.3-zts.rb b/Formula/php@8.3-zts.rb index 2a4bb044..3d2b581a 100644 --- a/Formula/php@8.3-zts.rb +++ b/Formula/php@8.3-zts.rb @@ -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} @@ -125,7 +125,6 @@ def install --enable-dba --enable-exif --enable-ftp - --enable-fpm --enable-gd --enable-intl --enable-mbregex @@ -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} @@ -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