git: e216badd2221 - main - lang/php82: Update version 8.2.13=>8.2.14

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Fri, 22 Dec 2023 01:24:51 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e216badd22213c1654b46954576b85887a0a92b7

commit e216badd22213c1654b46954576b85887a0a92b7
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-12-22 00:33:13 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-12-22 01:24:36 +0000

    lang/php82: Update version 8.2.13=>8.2.14
    
    - php modules while build with system pcre fails to run when using
      apache httpd and mod_php. So OPTIONIZE and add as a non-DEFAULT
      option. However to my knowledge and experience I haven't faced this
      with nginx and php-fpm yet. [1]
    - There is another corner case with apache httpd and mod_php when run
      on 13.2-RELEASE or newer specially on versions where ASLR is by default
      turned on. All modules specialy opcache crashes httpd. So add a
      warning message to advise users to move into php-fpm. [2]
    - Remove unnecesary patches from devel/php82-readline [3]
    
    Changelog: https://www.php.net/ChangeLog-8.php#8.2.14
    
    PR: 275522 [1], 268318 [2], 275795 [3]
    Reported by: majo-bugs.freebsd.org@cerny.sk [1], zarychtam@plan-b.pwste.edu.pl [2], x0r+freebsd@x0r.fr [3]
---
 devel/php82-readline/files/patch-config.m4      | 33 ---------------------
 devel/php82-readline/files/patch-readline_cli.c | 13 ---------
 lang/php82/Makefile                             | 16 +++++++----
 lang/php82/distinfo                             |  6 ++--
 lang/php82/files/patch-TSRM_TSRM.c              |  4 +--
 lang/php82/files/patch-configure.ac             | 10 +++----
 lang/php82/pkg-message.mod                      | 15 ++++++----
 lang/php82/pkg-plist                            |  7 +++++
 sysutils/php82-posix/files/patch-posix.c        | 38 -------------------------
 www/php82-opcache/files/patch-config.m4         | 20 -------------
 10 files changed, 37 insertions(+), 125 deletions(-)

diff --git a/devel/php82-readline/files/patch-config.m4 b/devel/php82-readline/files/patch-config.m4
deleted file mode 100644
index 93799734a3e3..000000000000
--- a/devel/php82-readline/files/patch-config.m4
+++ /dev/null
@@ -1,33 +0,0 @@
---- config.m4.orig	2019-08-06 06:54:14 UTC
-+++ config.m4
-@@ -3,16 +3,10 @@ PHP_ARG_WITH([libedit],
-   [AS_HELP_STRING([--with-libedit],
-     [Include libedit readline replacement (CLI/CGI only)])])
- 
--if test "$PHP_LIBEDIT" = "no"; then
-   PHP_ARG_WITH([readline],
-     [for readline support],
-     [AS_HELP_STRING([[--with-readline[=DIR]]],
-       [Include readline support (CLI/CGI only)])])
--else
--  dnl "register" the --with-readline option to prevent invalid "unknown
--  dnl configure option" warning
--  php_with_readline=no
--fi
- 
- if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
-   for i in $PHP_READLINE /usr/local /usr; do
-@@ -78,6 +72,13 @@ if test "$PHP_READLINE" && test "$PHP_RE
-   AC_DEFINE(HAVE_HISTORY_LIST, 1, [ ])
-   AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
- 
-+  PHP_CHECK_LIBRARY(readline, rl_completion_matches,
-+  [
-+    AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1, [ ])
-+  ],[],[
-+    -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
-+  ])
-+
- elif test "$PHP_LIBEDIT" != "no"; then
-   if test "$PHP_LIBEDIT" != "yes"; then
-     AC_MSG_WARN([libedit directory ignored, rely on pkg-config])
diff --git a/devel/php82-readline/files/patch-readline_cli.c b/devel/php82-readline/files/patch-readline_cli.c
deleted file mode 100644
index 02f55974f9b0..000000000000
--- a/devel/php82-readline/files/patch-readline_cli.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- readline_cli.c.orig	2012-03-02 16:40:26.000000000 +0100
-+++ readline_cli.c	2012-03-02 16:40:43.000000000 +0100
-@@ -19,6 +19,10 @@
- 
- /* $Id: readline_cli.c 321634 2012-01-01 13:15:04Z felipe $ */
- 
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
- #include "php.h"
- 
- #ifndef HAVE_RL_COMPLETION_MATCHES
diff --git a/lang/php82/Makefile b/lang/php82/Makefile
index 11d8c1102f8d..8ddad72503e6 100644
--- a/lang/php82/Makefile
+++ b/lang/php82/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	php82
-DISTVERSION=	8.2.13
+DISTVERSION=	8.2.14
 PORTREVISION?=	0
 CATEGORIES?=	lang devel www
 MASTER_SITES=	PHP/distributions
@@ -18,7 +18,6 @@ PHP_VER=	82
 CONFLICTS_INSTALL?=	php[0-9][0-9]${PKGNAMESUFFIX}
 
 .if !defined(PKGNAMESUFFIX)
-BUILD_DEPENDS=	re2c>0:devel/re2c
 LIB_DEPENDS=	libargon2.so:security/libargon2 \
 		libpcre2-8.so:devel/pcre2
 
@@ -29,8 +28,7 @@ CONFIGURE_ARGS+=	--disable-all \
 			--with-layout=GNU \
 			--with-libxml \
 			--with-openssl \
-			--with-password-argon2=${LOCALBASE} \
-			--with-external-pcre=${LOCALBASE}
+			--with-password-argon2=${LOCALBASE}
 
 USES+=		autoreconf:build ssl
 USE_GNOME=	libxml2
@@ -40,8 +38,8 @@ LDFLAGS=	-L${OPENSSLLIB} -lcrypto -lssl
 LDFLAGS_i386=	-Wl,-z,notext
 
 OPTIONS_DEFINE+=		CGI CLI DEBUG DTRACE EMBED FPM IPV6 LINKTHR \
-				MYSQLND PHPDBG ZTS
-OPTIONS_DEFAULT=		CGI CLI DTRACE EMBED FPM LINKTHR MYSQLND
+				MYSQLND PCRE PHPDBG ZTS
+OPTIONS_DEFAULT=		CGI CLI DTRACE EMBED FPM LINKTHR MYSQLND PCRE
 OPTIONS_EXCLUDE_DragonFly=	DTRACE
 # ld(1) fails to link probes: Relocations in generic ELF (EM: 0)
 OPTIONS_EXCLUDE_aarch64=	DTRACE
@@ -64,6 +62,7 @@ EMBED_DESC=	Build embedded library
 FPM_DESC=	Build FPM version
 LINKTHR_DESC=	Link thread lib (for threaded extensions)
 MYSQLND_DESC=	Build with MySQL Native Driver
+PCRE_DESC=	Use system pcre instead of bundled one
 PHPDBG_DESC=	Interactive PHP debugger
 ZTS_DESC=	Force Zend Thread Safety (ZTS) build
 
@@ -83,6 +82,10 @@ FPM_VARS=		PHP_SAPI+=fpm \
 IPV6_CONFIGURE_OFF=	--disable-ipv6
 LINKTHR_LIBS=		-lpthread
 MYSQLND_CONFIGURE_ON=	--enable-mysqlnd
+PCRE_BUILD_DEPENDS=	re2c>0:devel/re2c
+PCRE_CONFIGURE_ON=	--with-external-pcre=${LOCALBASE}
+PCRE_PLIST_SUB=	BUNDLED_PCRE="@comment "
+PCRE_PLIST_SUB_OFF=	BUNDLED_PCRE=""
 PHPDBG_CONFIGURE_ON=	--enable-phpdbg
 PHPDBG_VARS=		PHP_SAPI+=phpdbg
 ZTS_CONFIGURE_ON=	--enable-zts
@@ -97,6 +100,7 @@ PKGMESSAGE=		${PKGDIR}/pkg-message.mod
 MODULENAME=		libphp
 SHORTMODNAME=		php
 WARNING=		"!!! If you have a threaded Apache, you must build ${PHP_PORT} with ZTS support to enable thread-safety in extensions !!!"
+WARNING+=	"!!! Consider switching to php-fpm and mod_proxy_fcgi as per Apache httpd recommendations !!!"
 .endif
 
 .include <bsd.port.pre.mk>
diff --git a/lang/php82/distinfo b/lang/php82/distinfo
index 122e2bc243d9..09fae9d03f24 100644
--- a/lang/php82/distinfo
+++ b/lang/php82/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1700689026
-SHA256 (php-8.2.13.tar.xz) = 2629bba10117bf78912068a230c68a8fd09b7740267bd8ebd3cfce91515d454b
-SIZE (php-8.2.13.tar.xz) = 12069092
+TIMESTAMP = 1703153770
+SHA256 (php-8.2.14.tar.xz) = 763ecd39fcf51c3815af6ef6e43fa9aa0d0bd8e5a615009e5f4780c92705f583
+SIZE (php-8.2.14.tar.xz) = 12080468
diff --git a/lang/php82/files/patch-TSRM_TSRM.c b/lang/php82/files/patch-TSRM_TSRM.c
index 3746de1d8b36..2b041b300aca 100644
--- a/lang/php82/files/patch-TSRM_TSRM.c
+++ b/lang/php82/files/patch-TSRM_TSRM.c
@@ -1,6 +1,6 @@
---- TSRM/TSRM.c.orig	2023-04-12 04:09:40 UTC
+--- TSRM/TSRM.c.orig	2023-12-20 06:28:06 UTC
 +++ TSRM/TSRM.c
-@@ -740,7 +740,7 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void)
+@@ -769,7 +769,7 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void)
  	asm ("leal _tsrm_ls_cache@ntpoff,%0"
            : "=r" (ret));
  	return ret;
diff --git a/lang/php82/files/patch-configure.ac b/lang/php82/files/patch-configure.ac
index 242c702f4b8d..a2444a37fa50 100644
--- a/lang/php82/files/patch-configure.ac
+++ b/lang/php82/files/patch-configure.ac
@@ -1,4 +1,4 @@
---- configure.ac.orig	2023-03-14 16:11:05 UTC
+--- configure.ac.orig	2023-12-20 06:28:06 UTC
 +++ configure.ac
 @@ -55,6 +55,7 @@ AH_BOTTOM([
  
@@ -8,7 +8,7 @@
  #endif /* PHP_CONFIG_H */
  ])
  
-@@ -279,7 +280,6 @@ sinclude(Zend/Zend.m4)
+@@ -281,7 +282,6 @@ dnl --------------------------------------------------
  
  dnl ----------------------------------------------------------------------------
  
@@ -16,7 +16,7 @@
  PHP_HELP_SEPARATOR([SAPI modules:])
  PHP_SHLIB_SUFFIX_NAMES
  PHP_BUILD_PROGRAM
-@@ -626,7 +626,7 @@ memrchr \
+@@ -637,7 +637,7 @@ dnl Some systems (like OpenSolaris) do not have nanosl
  AX_FUNC_WHICH_GETHOSTBYNAME_R
  
  dnl Some systems (like OpenSolaris) do not have nanosleep in libc.
@@ -25,7 +25,7 @@
  
  dnl Haiku does not have network api in libc.
  PHP_CHECK_FUNC_LIB(setsockopt, network)
-@@ -1413,7 +1413,7 @@ EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
+@@ -1424,7 +1424,7 @@ EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CON
  EXPANDED_DATADIR=$datadir
  EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
  EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
@@ -34,7 +34,7 @@
  
  exec_prefix=$old_exec_prefix
  libdir=$old_libdir
-@@ -1638,7 +1638,7 @@ PHP_SUBST(all_targets)
+@@ -1666,7 +1666,7 @@ PHP_SUBST(install_binary_targets)
  PHP_SUBST(install_targets)
  PHP_SUBST(install_binary_targets)
  
diff --git a/lang/php82/pkg-message.mod b/lang/php82/pkg-message.mod
index a0c2c87889a7..8ad98d25b4e6 100644
--- a/lang/php82/pkg-message.mod
+++ b/lang/php82/pkg-message.mod
@@ -1,5 +1,15 @@
 ******************************************************************************
 
+Consider switching to php-fpm and mod_fast_cgi as per Apache httpd project
+recommendation. See https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM
+
+******************************************************************************
+
+If you are building PHP-based ports in poudriere(8) or Synth with ZTS enabled,
+add WITH_MPM=event to /etc/make.conf to prevent build failures.
+
+******************************************************************************
+
 Make sure index.php is part of your DirectoryIndex.
 
 You should add the following to your Apache configuration file:
@@ -12,8 +22,3 @@ You should add the following to your Apache configuration file:
 </FilesMatch>
 
 ******************************************************************************
-
-If you are building PHP-based ports in poudriere(8) or Synth with ZTS enabled,
-add WITH_MPM=event to /etc/make.conf to prevent build failures.
-
-******************************************************************************
diff --git a/lang/php82/pkg-plist b/lang/php82/pkg-plist
index 2653280ebfc1..431ae89ee086 100644
--- a/lang/php82/pkg-plist
+++ b/lang/php82/pkg-plist
@@ -165,6 +165,13 @@ include/php/ext/libxml/php_libxml.h
 %%MYSQLND%%include/php/ext/mysqlnd/mysqlnd_vio.h
 %%MYSQLND%%include/php/ext/mysqlnd/mysqlnd_wireprotocol.h
 %%MYSQLND%%include/php/ext/mysqlnd/php_mysqlnd.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/config.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/pcre2.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/pcre2_internal.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/pcre2_intmodedep.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/pcre2_jit_neon_inc.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/pcre2_jit_simd_inc.h
+%%BUNDLED_PCRE%%include/php/ext/pcre/pcre2lib/pcre2_ucp.h
 include/php/ext/pcre/php_pcre.h
 include/php/ext/random/php_random.h
 include/php/ext/spl/php_spl.h
diff --git a/sysutils/php82-posix/files/patch-posix.c b/sysutils/php82-posix/files/patch-posix.c
deleted file mode 100644
index d2365b249569..000000000000
--- a/sysutils/php82-posix/files/patch-posix.c
+++ /dev/null
@@ -1,38 +0,0 @@
---- posix.c.orig	Fri Feb 23 00:40:39 2007
-+++ posix.c	Sun May 13 17:52:27 2007
-@@ -838,7 +838,7 @@
- #if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
- 	buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
- 	if (buflen < 1) {
--		RETURN_FALSE;
-+		buflen = 1024;
- 	}
- 	buf = emalloc(buflen);
- 	g = &gbuf;
-@@ -888,7 +888,7 @@
- 	
- 	grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
- 	if (grbuflen < 1) {
--		RETURN_FALSE;
-+		grbuflen = 1024;
- 	}
- 
- 	grbuf = emalloc(grbuflen);
-@@ -955,7 +955,7 @@
- #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
- 	buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
- 	if (buflen < 1) {
--		RETURN_FALSE;
-+		buflen = 1024;
- 	}
- 	buf = emalloc(buflen);
- 	pw = &pwbuf;
-@@ -1004,7 +1004,7 @@
- #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
- 	pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
- 	if (pwbuflen < 1) {
--		RETURN_FALSE;
-+		pwbuflen = 1024;
- 	}
- 	pwbuf = emalloc(pwbuflen);
- 
diff --git a/www/php82-opcache/files/patch-config.m4 b/www/php82-opcache/files/patch-config.m4
deleted file mode 100644
index 7bd2cb9083fd..000000000000
--- a/www/php82-opcache/files/patch-config.m4
+++ /dev/null
@@ -1,20 +0,0 @@
---- config.m4.orig	2021-12-15 02:00:45 UTC
-+++ config.m4
-@@ -29,7 +29,7 @@ if test "$PHP_OPCACHE" != "no"; then
- 
-   if test "$PHP_OPCACHE_JIT" = "yes"; then
-     case $host_cpu in
--      i[[34567]]86*|x86*|aarch64)
-+      i[[34567]]86*|x86*|aarch64|amd64)
-         ;;
-       *)
-         AC_MSG_WARN([JIT not supported by host architecture])
-@@ -48,7 +48,7 @@ if test "$PHP_OPCACHE" != "no"; then
-         DASM_FLAGS="-D X64APPLE=1 -D X64=1"
-         DASM_ARCH="x86"
-         ;;
--      x86_64*)
-+      *x86_64*|amd64-*-freebsd*)
-         DASM_FLAGS="-D X64=1"
-         DASM_ARCH="x86"
-         ;;