php@7.1 7.1.22
Closes #32050. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
a5ff21bb22
commit
e2f07f8b0f
1 changed files with 68 additions and 13 deletions
|
@ -1,8 +1,8 @@
|
|||
class PhpAT71 < Formula
|
||||
desc "General-purpose scripting language"
|
||||
homepage "https://secure.php.net/"
|
||||
url "https://php.net/get/php-7.1.21.tar.xz/from/this/mirror"
|
||||
sha256 "d4da6dc69d3fe1e6b2b80f16b262f391037bfeb21213c966e026bd45d7ca2813"
|
||||
url "https://php.net/get/php-7.1.22.tar.xz/from/this/mirror"
|
||||
sha256 "9194c9b3a592d8376fde837dde711ec01ee26f8607fc2884047ef6f7c089b15d"
|
||||
|
||||
bottle do
|
||||
sha256 "82b35d91f0deda601f7a68aabd5905844ae4526e13b640ff42a481f815522ab9" => :high_sierra
|
||||
|
@ -26,11 +26,13 @@ class PhpAT71 < 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 PhpAT71 < 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="
|
||||
|
@ -79,6 +88,10 @@ class PhpAT71 < 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}
|
||||
|
@ -110,7 +123,7 @@ class PhpAT71 < 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}
|
||||
|
@ -119,17 +132,17 @@ class PhpAT71 < 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
|
||||
|
@ -142,14 +155,21 @@ class PhpAT71 < 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 +314,12 @@ class PhpAT71 < 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 +415,33 @@ class PhpAT71 < 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
|
||||
|
|
Loading…
Reference in a new issue