Skip to content

Commit

Permalink
feat: install libphp with the ZTS debug package
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored and github-actions[bot] committed Dec 13, 2024
1 parent 3e96fef commit d841187
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions Formula/php-debug-zts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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 @@ -133,7 +133,6 @@ def install
--enable-dba
--enable-exif
--enable-ftp
--enable-fpm
--enable-gd
--enable-intl
--enable-mbregex
Expand All @@ -149,15 +148,12 @@ def install
--enable-sysvsem
--enable-sysvshm
--enable-zts
--with-apxs2=#{Formula["httpd"].opt_bin}/apxs
--with-bz2#{headers_path}
--with-capstone
--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 @@ -190,14 +186,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 d841187

Please sign in to comment.