php 7.4.0

Closes #47289.

Signed-off-by: Bo Anderson <mail@boanderson.me>
master
Andreas Braun 2019-11-28 14:30:11 +01:00 committed by Bo Anderson
parent 51af987f52
commit 0e2a0cde3c
2 changed files with 61 additions and 83 deletions

View File

@ -1,8 +1,8 @@
class Php < Formula
desc "General-purpose scripting language"
homepage "https://www.php.net/"
url "https://www.php.net/distributions/php-7.3.12.tar.xz"
sha256 "aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df"
url "https://www.php.net/distributions/php-7.4.0.tar.xz"
sha256 "9bb751b20e5d6cc1ea9b1ebf23ef2d5f07f99b2d9cc417bf1d70c04f8b20ec42"
bottle do
sha256 "722d443d96be2a8e13580c27630c39872da1b6d05a03b1df5780c34c45cfd315" => :catalina
@ -25,10 +25,12 @@ class Php < Formula
depends_on "gmp"
depends_on "icu4c"
depends_on "jpeg"
depends_on "libffi"
depends_on "libpng"
depends_on "libpq"
depends_on "libsodium"
depends_on "libzip"
depends_on "oniguruma"
depends_on "openldap"
depends_on "openssl@1.1"
depends_on "sqlite"
@ -50,7 +52,7 @@ class Php < Formula
system "./buildconf", "--force"
inreplace "configure" do |s|
s.gsub! "APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`",
s.gsub! "APACHE_THREADED_MPM=`$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes'`",
"APACHE_THREADED_MPM="
s.gsub! "APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`",
"APXS_LIBEXECDIR='$(INSTALL_ROOT)#{lib}/httpd/modules'"
@ -71,9 +73,6 @@ class Php < Formula
inreplace "sapi/fpm/php-fpm.conf.in", ";daemonize = yes", "daemonize = no"
# Required due to icu4c dependency
ENV.cxx11
config_path = etc/"php/#{php_version}"
# Prevent system pear config from inhibiting pear install
(config_path/"pear.conf").delete if (config_path/"pear.conf").exist?
@ -81,6 +80,14 @@ class Php < Formula
# Prevent homebrew from harcoding path to sed shim in phpize script
ENV["lt_cv_path_SED"] = "sed"
# system pkg-config missing
ENV["KERBEROS_CFLAGS"] = " "
ENV["KERBEROS_LIBS"] = "-lkrb5"
ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl"
ENV["SASL_LIBS"] = "-lsasl2"
ENV["EDIT_CFLAGS"] = " "
ENV["EDIT_LIBS"] = "-ledit"
# 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"
@ -92,6 +99,7 @@ class Php < Formula
--with-config-file-path=#{config_path}
--with-config-file-scan-dir=#{config_path}/conf.d
--with-pear=#{pkgshare}/pear
--with-os-sdkpath=#{MacOS.sdk_path_if_needed}
--enable-bcmath
--enable-calendar
--enable-dba
@ -99,11 +107,11 @@ class Php < Formula
--enable-exif
--enable-ftp
--enable-fpm
--enable-gd
--enable-intl
--enable-mbregex
--enable-mbstring
--enable-mysqlnd
--enable-opcache-file
--enable-pcntl
--enable-phpdbg
--enable-phpdbg-webhelper
@ -113,50 +121,46 @@ class Php < Formula
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--enable-wddx
--enable-zip
--with-apxs2=#{Formula["httpd"].opt_bin}/apxs
--with-bz2#{headers_path}
--with-curl=#{Formula["curl-openssl"].opt_prefix}
--with-curl
--with-ffi
--with-fpm-user=_www
--with-fpm-group=_www
--with-freetype-dir=#{Formula["freetype"].opt_prefix}
--with-gd
--with-freetype
--with-gettext=#{Formula["gettext"].opt_prefix}
--with-gmp=#{Formula["gmp"].opt_prefix}
--with-iconv#{headers_path}
--with-icu-dir=#{Formula["icu4c"].opt_prefix}
--with-jpeg-dir=#{Formula["jpeg"].opt_prefix}
--with-kerberos#{headers_path}
--with-jpeg
--with-kerberos
--with-layout=GNU
--with-ldap=#{Formula["openldap"].opt_prefix}
--with-ldap-sasl#{headers_path}
--with-libxml-dir#{headers_path}
--with-libedit#{headers_path}
--with-libzip
--with-ldap-sasl
--with-libxml
--with-libedit
--with-mhash#{headers_path}
--with-mysql-sock=/tmp/mysql.sock
--with-mysqli=mysqlnd
--with-ndbm#{headers_path}
--with-openssl=#{Formula["openssl@1.1"].opt_prefix}
--with-openssl
--with-password-argon2=#{Formula["argon2"].opt_prefix}
--with-pdo-dblib=#{Formula["freetds"].opt_prefix}
--with-pdo-mysql=mysqlnd
--with-pdo-odbc=unixODBC,#{Formula["unixodbc"].opt_prefix}
--with-pdo-odbc=unixODBC
--with-pdo-pgsql=#{Formula["libpq"].opt_prefix}
--with-pdo-sqlite=#{Formula["sqlite"].opt_prefix}
--with-pdo-sqlite
--with-pgsql=#{Formula["libpq"].opt_prefix}
--with-pic
--with-png-dir=#{Formula["libpng"].opt_prefix}
--with-pspell=#{Formula["aspell"].opt_prefix}
--with-sodium=#{Formula["libsodium"].opt_prefix}
--with-sqlite3=#{Formula["sqlite"].opt_prefix}
--with-sodium
--with-sqlite3
--with-tidy=#{Formula["tidy-html5"].opt_prefix}
--with-unixODBC=#{Formula["unixodbc"].opt_prefix}
--with-webp-dir=#{Formula["webp"].opt_prefix}
--with-unixODBC
--with-webp
--with-xmlrpc
--with-xsl#{headers_path}
--with-zlib#{headers_path}
--with-xsl
--with-zip
--with-zlib
]
system "./configure", *args
@ -176,11 +180,6 @@ class Php < Formula
inreplace "php.ini-development", /; ?openssl\.capath=/,
"openssl.capath = \"#{etc}/openssl@1.1/certs\""
# php 7.3 known bug
# SO discussion: https://stackoverflow.com/a/53709484/791609
# bug report: https://bugs.php.net/bug.php?id=77260
inreplace "php.ini-development", ";pcre.jit=1", "pcre.jit=0"
config_files = {
"php.ini-development" => "php.ini",
"sapi/fpm/php-fpm.conf" => "php-fpm.conf",
@ -417,65 +416,44 @@ class Php < Formula
end
__END__
diff --git a/acinclude.m4 b/acinclude.m4
index 168c465f8d..6c087d152f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -441,7 +441,11 @@ dnl
dnl Adds a path to linkpath/runpath (LDFLAGS)
diff --git a/build/php.m4 b/build/php.m4
index 3624a33a8e..d17a635c2c 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -425,7 +425,7 @@ 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[)] ;;
+ *[)]
+ if test "$1" != "$PHP_OS_SDKPATH/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then
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
@@ -487,7 +491,11 @@ dnl add an include path.
dnl if before is 1, add in the beginning of INCLUDES.
@@ -470,7 +470,7 @@ dnl
dnl Add an include path. If before is 1, add in the beginning of INCLUDES.
dnl
AC_DEFUN([PHP_ADD_INCLUDE],[
- if test "$1" != "/usr/include"; then
+ case "$1" in
+ "/usr/include"[)] ;;
+ /Library/Developer/CommandLineTools/SDKs/*/usr/include[)] ;;
+ /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*/usr/include[)] ;;
+ *[)]
+ if test "$1" != "$PHP_OS_SDKPATH/usr/include"; then
PHP_EXPAND_PATH($1, ai_p)
PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [
if test "$2"; then
@@ -495,8 +503,8 @@ AC_DEFUN([PHP_ADD_INCLUDE],[
else
INCLUDES="$INCLUDES -I$ai_p"
fi
- ])
- fi
+ ]) ;;
+ esac
])
diff --git a/configure.ac b/configure.ac
index 36c6e5e3e2..71b1a16607 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,14 @@ PHP_ARG_WITH([libdir],
[lib],
[no])
dnl internal, don't use
@@ -2411,7 +2419,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [
fi
if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a ||
- test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
+ test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME ||
+ test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.tbd
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
+dnl Support systems with system libraries/includes in e.g. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk.
+PHP_ARG_WITH([os-sdkpath],
+ [for system SDK directory],
+ [AS_HELP_STRING([--with-os-sdkpath=NAME],
+ [Ignore system libraries and includes in NAME rather than /])],
+ [],
+ [no])
+
PHP_ARG_ENABLE([rpath],
[whether to enable runpaths],
[AS_HELP_STRING([--disable-rpath],