git: 58de78405733 - main - lang/php83: Update version 8.3.0=>8.3.1

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

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

commit 58de78405733ce66390af3d1db0e40e35a0d4355
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-12-21 23:46:58 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-12-22 01:24:35 +0000

    lang/php83: Update version 8.3.0=>8.3.1
    
    - 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]
    
    Thanks to brnrd@ for the patch. [2]
    
    Changelog: https://www.php.net/ChangeLog-8.php#8.3.1
    
    PR:             275522 [1], 268318 [2]
    Reported by:    majo-bugs.freebsd.org@cerny.sk [1], zarychtam@plan-b.pwste.edu.pl [2]
---
 lang/php83/Makefile                                  | 17 +++++++++++------
 lang/php83/distinfo                                  |  6 +++---
 lang/php83/files/patch-configure.ac                  | 12 ++++++------
 ...tch-ext_pcre_pcre2lib_sljit_sljitConfigInternal.h | 10 +++++-----
 lang/php83/pkg-message.mod                           | 15 ++++++++++-----
 lang/php83/pkg-plist                                 |  7 +++++++
 www/php83-opcache/files/patch-config.m4              | 20 --------------------
 7 files changed, 42 insertions(+), 45 deletions(-)

diff --git a/lang/php83/Makefile b/lang/php83/Makefile
index 060b7c772f72..f606bdd67a01 100644
--- a/lang/php83/Makefile
+++ b/lang/php83/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	php83
-DISTVERSION=	8.3.0
+DISTVERSION=	8.3.1
+PORTREVISION?=	0
 CATEGORIES?=	lang devel www
 MASTER_SITES=	PHP/distributions
 DISTNAME=	php-${DISTVERSION}
@@ -17,7 +18,6 @@ PHP_VER=	83
 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 +29,7 @@ CONFIGURE_ARGS+=	\
 		--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 +39,8 @@ LDFLAGS+=	-L${OPENSSLLIB} -lcrypto -lssl
 LDFLAGS_i386=	-Wl,-z,notext
 
 OPTIONS_DEFINE+=CGI CLI DEBUG DTRACE EMBED FPM IPV6 LINKTHR \
-				MYSQLND NOASLR PHPDBG ZTS
-OPTIONS_DEFAULT=	CGI CLI DTRACE EMBED FPM LINKTHR MYSQLND
+				MYSQLND NOASLR 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 +63,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
 
@@ -84,6 +84,10 @@ IPV6_CONFIGURE_OFF=	--disable-ipv6
 LINKTHR_LIBS=		-lpthread
 NOASLR_USES=	elfctl
 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
@@ -98,6 +102,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.options.mk>
diff --git a/lang/php83/distinfo b/lang/php83/distinfo
index d6c31a4c1d21..53ca8a45b507 100644
--- a/lang/php83/distinfo
+++ b/lang/php83/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1700688940
-SHA256 (php-8.3.0.tar.xz) = 1db84fec57125aa93638b51bb2b15103e12ac196e2f960f0d124275b2687ea54
-SIZE (php-8.3.0.tar.xz) = 12431612
+TIMESTAMP = 1703155183
+SHA256 (php-8.3.1.tar.xz) = 56445b1771b2ba5b7573453f9e8a9451e2d810b1741a352fa05259733b1e9758
+SIZE (php-8.3.1.tar.xz) = 12444232
diff --git a/lang/php83/files/patch-configure.ac b/lang/php83/files/patch-configure.ac
index d2468ec18e55..a616256a55df 100644
--- a/lang/php83/files/patch-configure.ac
+++ b/lang/php83/files/patch-configure.ac
@@ -1,4 +1,4 @@
---- configure.ac.orig	2023-09-12 11:29:39 UTC
+--- configure.ac.orig	2023-12-20 12:44:38 UTC
 +++ configure.ac
 @@ -55,6 +55,7 @@ AH_BOTTOM([
  
@@ -8,7 +8,7 @@
  #endif /* PHP_CONFIG_H */
  ])
  
-@@ -283,7 +284,6 @@ sinclude(Zend/Zend.m4)
+@@ -283,7 +284,6 @@ dnl --------------------------------------------------
  
  dnl ----------------------------------------------------------------------------
  
@@ -16,7 +16,7 @@
  PHP_HELP_SEPARATOR([SAPI modules:])
  PHP_SHLIB_SUFFIX_NAMES
  PHP_BUILD_PROGRAM
-@@ -567,7 +567,7 @@ dnl Fix for these systems is already included in GCC 7
+@@ -567,7 +567,7 @@ dnl bug #77284. Conservatively don't use ifuncs on Fre
  dnl
  dnl At least some versions of FreeBSD seem to have buggy ifunc support, see
  dnl bug #77284. Conservatively don't use ifuncs on FreeBSD.
@@ -25,7 +25,7 @@
    AX_GCC_FUNC_ATTRIBUTE([ifunc])
    AX_GCC_FUNC_ATTRIBUTE([target])
  ])
-@@ -652,7 +652,7 @@ AC_FUNC_STRERROR_R
+@@ -652,7 +652,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.
@@ -34,7 +34,7 @@
  
  dnl Haiku does not have network api in libc.
  PHP_CHECK_FUNC_LIB(setsockopt, network)
-@@ -1463,7 +1463,7 @@ EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
+@@ -1463,7 +1463,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"`
@@ -43,7 +43,7 @@
  
  exec_prefix=$old_exec_prefix
  libdir=$old_libdir
-@@ -1688,7 +1688,7 @@ PHP_SUBST(all_targets)
+@@ -1705,7 +1705,7 @@ PHP_SUBST(install_binary_targets)
  PHP_SUBST(install_targets)
  PHP_SUBST(install_binary_targets)
  
diff --git a/lang/php83/files/patch-ext_pcre_pcre2lib_sljit_sljitConfigInternal.h b/lang/php83/files/patch-ext_pcre_pcre2lib_sljit_sljitConfigInternal.h
index 12705b62543e..3c39908b647d 100644
--- a/lang/php83/files/patch-ext_pcre_pcre2lib_sljit_sljitConfigInternal.h
+++ b/lang/php83/files/patch-ext_pcre_pcre2lib_sljit_sljitConfigInternal.h
@@ -1,6 +1,6 @@
---- ext/pcre/pcre2lib/sljit/sljitConfigInternal.h.orig	2022-08-02 13:57:03 UTC
+--- ext/pcre/pcre2lib/sljit/sljitConfigInternal.h.orig	2023-12-20 12:44:38 UTC
 +++ ext/pcre/pcre2lib/sljit/sljitConfigInternal.h
-@@ -303,7 +303,7 @@ extern "C" {
+@@ -308,7 +308,7 @@ extern "C" {
  /* Type of public API functions. */
  /*********************************/
  
@@ -9,9 +9,9 @@
  #if (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC)
  /* Static ABI functions. For all-in-one programs. */
  
-@@ -333,7 +333,7 @@ extern "C" {
-  * beware APPLE is known to have removed the code in iOS so
-  * it will need to be excempted or result in broken builds
+@@ -344,7 +344,7 @@ extern "C" {
+  * system provided method that should be defined below is used
+  * instead.
   */
 -#if (!defined SLJIT_CACHE_FLUSH && defined __has_builtin)
 +#if (!defined SLJIT_CACHE_FLUSH && defined __has_builtin && !defined SLJIT_CONFIG_PPC_32)
diff --git a/lang/php83/pkg-message.mod b/lang/php83/pkg-message.mod
index a0c2c87889a7..8ad98d25b4e6 100644
--- a/lang/php83/pkg-message.mod
+++ b/lang/php83/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/php83/pkg-plist b/lang/php83/pkg-plist
index 148b08bab605..cac3796b458a 100644
--- a/lang/php83/pkg-plist
+++ b/lang/php83/pkg-plist
@@ -167,6 +167,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/www/php83-opcache/files/patch-config.m4 b/www/php83-opcache/files/patch-config.m4
deleted file mode 100644
index ac1219142024..000000000000
--- a/www/php83-opcache/files/patch-config.m4
+++ /dev/null
@@ -1,20 +0,0 @@
---- config.m4.orig	2023-06-06 15:54:29 UTC
-+++ config.m4
-@@ -35,7 +35,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])
-@@ -54,7 +54,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"
-         ;;