php@7.0 7.0.32

Closes #32057.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Jan Viljanen 2018-09-13 21:09:49 +02:00 committed by FX Coudert
parent f875a15428
commit 6affdf01c3

View file

@ -1,8 +1,8 @@
class PhpAT70 < Formula
desc "General-purpose scripting language"
homepage "https://secure.php.net/"
url "https://php.net/get/php-7.0.31.tar.xz/from/this/mirror"
sha256 "68f57b3f4587071fb54a620cb83a1cfb3f0bd4ee071e0ce3bf7046a5f2d2f3cf"
url "https://php.net/get/php-7.0.32.tar.xz/from/this/mirror"
sha256 "ff6f62afeb32c71b3b89ecbd42950ef6c5e0c329cc6e1c58ffac47e6f1f883c4"
bottle do
sha256 "4f56a665942734d6cd1b6dd6b4d74064e7c0c32b8133b7956644d94fb0354830" => :high_sierra
@ -26,11 +26,13 @@ class PhpAT70 < Formula
depends_on "gmp"
depends_on "icu4c"
depends_on "jpeg"
depends_on "libiconv" if DevelopmentTools.clang_build_version >= 1000
depends_on "libpng"
depends_on "libpq"
depends_on "libtool"
depends_on "libzip"
depends_on "mcrypt"
depends_on "openldap" if DevelopmentTools.clang_build_version >= 1000
depends_on "openssl"
depends_on "pcre"
depends_on "unixodbc"
@ -38,12 +40,19 @@ class PhpAT70 < Formula
needs :cxx11
# PHP build system incorrectly links system libraries
# see https://github.com/php/php-src/pull/3472
patch :DATA
def install
# Ensure that libxml2 will be detected correctly in older MacOS
if MacOS.version == :el_capitan || MacOS.version == :sierra
ENV["SDKROOT"] = MacOS.sdk_path
end
# buildconf required due to system library linking bug patch
system "./buildconf", "--force"
inreplace "configure" do |s|
s.gsub! "APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`",
"APACHE_THREADED_MPM="
@ -82,6 +91,10 @@ class PhpAT70 < Formula
# Prevent homebrew from harcoding path to sed shim in phpize script
ENV["lt_cv_path_SED"] = "sed"
# Each extension that is built on Mojave needs a direct reference to the
# sdk path or it won't find the headers
headers_path = "=#{MacOS.sdk_path_if_needed}/usr"
args = %W[
--prefix=#{prefix}
--localstatedir=#{var}
@ -113,7 +126,7 @@ class PhpAT70 < Formula
--enable-wddx
--enable-zip
--with-apxs2=#{Formula["httpd"].opt_bin}/apxs
--with-bz2
--with-bz2#{headers_path}
--with-fpm-user=_www
--with-fpm-group=_www
--with-freetype-dir=#{Formula["freetype"].opt_prefix}
@ -122,17 +135,18 @@ class PhpAT70 < Formula
--with-gmp=#{Formula["gmp"].opt_prefix}
--with-icu-dir=#{Formula["icu4c"].opt_prefix}
--with-jpeg-dir=#{Formula["jpeg"].opt_prefix}
--with-kerberos
--with-kerberos#{headers_path}
--with-layout=GNU
--with-ldap
--with-ldap-sasl
--with-libedit
--with-ldap-sasl#{headers_path}
--with-libedit#{headers_path}
--with-libxml-dir#{headers_path}
--with-libzip
--with-mcrypt=#{Formula["mcrypt"].opt_prefix}
--with-mhash
--with-mhash#{headers_path}
--with-mysql-sock=/tmp/mysql.sock
--with-mysqli=mysqlnd
--with-ndbm
--with-ndbm#{headers_path}
--with-openssl=#{Formula["openssl"].opt_prefix}
--with-pdo-dblib=#{Formula["freetds"].opt_prefix}
--with-pdo-mysql=mysqlnd
@ -145,14 +159,21 @@ class PhpAT70 < Formula
--with-unixODBC=#{Formula["unixodbc"].opt_prefix}
--with-webp-dir=#{Formula["webp"].opt_prefix}
--with-xmlrpc
--with-xsl
--with-zlib
--with-xsl#{headers_path}
--with-zlib#{headers_path}
]
if MacOS.version < :lion
args << "--with-curl=#{Formula["curl"].opt_prefix}"
else
args << "--with-curl"
args << "--with-curl#{headers_path}"
end
if MacOS.sdk_path_if_needed
args << "--with-ldap=#{Formula["openldap"].opt_prefix}"
args << "--with-iconv=#{Formula["libiconv"].opt_prefix}"
else
args << "--with-ldap"
end
system "./configure", *args
@ -294,7 +315,12 @@ class PhpAT70 < Formula
end
test do
assert_match /^Zend OPcache$/, shell_output("#{bin}/php -i"), "Zend OPCache extension not loaded"
assert_match /^Zend OPcache$/, shell_output("#{bin}/php -i"),
"Zend OPCache extension not loaded"
# Test related to libxml2 and
# https://github.com/Homebrew/homebrew-core/issues/28398
assert_includes MachO::Tools.dylibs("#{bin}/php"),
"#{Formula["libpq"].opt_lib}/libpq.5.dylib"
system "#{sbin}/php-fpm", "-t"
system "#{bin}/phpdbg", "-V"
system "#{bin}/php-cgi", "-m"
@ -390,3 +416,33 @@ class PhpAT70 < Formula
end
end
end
__END__
diff --git a/acinclude.m4 b/acinclude.m4
index 1deb50d2983c..d0e66c8b6344 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -441,7 +441,11 @@ dnl
dnl Adds a path to linkpath/runpath (LDFLAGS)
dnl
AC_DEFUN([PHP_ADD_LIBPATH],[
- if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then
+ case "$1" in
+ "/usr/$PHP_LIBDIR"|"/usr/lib"[)] ;;
+ /Library/Developer/CommandLineTools/SDKs/*/usr/lib[)] ;;
+ /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*/usr/lib[)] ;;
+ *[)]
PHP_EXPAND_PATH($1, ai_p)
ifelse([$2],,[
_PHP_ADD_LIBPATH_GLOBAL([$ai_p])
@@ -452,8 +456,8 @@ AC_DEFUN([PHP_ADD_LIBPATH],[
else
_PHP_ADD_LIBPATH_GLOBAL([$ai_p])
fi
- ])
- fi
+ ]) ;;
+ esac
])
dnl