git: f7c6b6335d77 - main - lang/php83: Update version 8.3.1=>8.3.2
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 Jan 2024 18:29:31 UTC
The branch main has been updated by bofh:
URL: https://cgit.FreeBSD.org/ports/commit/?id=f7c6b6335d77de48a1fd4986c69066a5c8d5bd87
commit f7c6b6335d77de48a1fd4986c69066a5c8d5bd87
Author: Johan Hendriks <joh.hendriks@gmail.com>
AuthorDate: 2024-01-18 18:22:20 +0000
Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2024-01-18 18:29:10 +0000
lang/php83: Update version 8.3.1=>8.3.2
- Add profile support in php-fpm rc script for running multiple php
master process
Changelog: https://www.php.net/ChangeLog-8.php#8.3.2
---
lang/php83/Makefile | 3 +-
lang/php83/distinfo | 6 +--
lang/php83/files/patch-configure.ac | 4 +-
lang/php83/files/patch-ext_standard_filestat.c | 26 +++++++++++
lang/php83/files/patch-main_fopen__wrappers.c | 14 ++++++
lang/php83/files/patch-main_main.c | 14 ++++++
lang/php83/files/php-fpm.in | 53 ++++++++++++++++++----
lang/php83/pkg-plist | 12 ++---
sysutils/php83-posix/files/patch-posix.c | 62 ++++++++++++++++++++++++++
9 files changed, 173 insertions(+), 21 deletions(-)
diff --git a/lang/php83/Makefile b/lang/php83/Makefile
index 8948d1e444b2..45741ef17f84 100644
--- a/lang/php83/Makefile
+++ b/lang/php83/Makefile
@@ -1,5 +1,5 @@
PORTNAME= php83
-DISTVERSION= 8.3.1
+DISTVERSION= 8.3.2
PORTREVISION?= 0
CATEGORIES?= lang devel www
MASTER_SITES= PHP/distributions
@@ -22,6 +22,7 @@ LIB_DEPENDS= libargon2.so:security/libargon2 \
libpcre2-8.so:devel/pcre2
GNU_CONFIGURE= yes
+GNU_CONFIGURE_MANPREFIX= ${MANPREFIX}/share
CONFIGURE_ARGS+= \
--disable-all \
--program-prefix="" \
diff --git a/lang/php83/distinfo b/lang/php83/distinfo
index 53ca8a45b507..d7927d336a68 100644
--- a/lang/php83/distinfo
+++ b/lang/php83/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1703155183
-SHA256 (php-8.3.1.tar.xz) = 56445b1771b2ba5b7573453f9e8a9451e2d810b1741a352fa05259733b1e9758
-SIZE (php-8.3.1.tar.xz) = 12444232
+TIMESTAMP = 1705528774
+SHA256 (php-8.3.2.tar.xz) = 4ffa3e44afc9c590e28dc0d2d31fc61f0139f8b335f11880a121b9f9b9f0634e
+SIZE (php-8.3.2.tar.xz) = 12440200
diff --git a/lang/php83/files/patch-configure.ac b/lang/php83/files/patch-configure.ac
index a616256a55df..bdd8afc9c692 100644
--- a/lang/php83/files/patch-configure.ac
+++ b/lang/php83/files/patch-configure.ac
@@ -1,4 +1,4 @@
---- configure.ac.orig 2023-12-20 12:44:38 UTC
+--- configure.ac.orig 2024-01-16 13:46:41 UTC
+++ configure.ac
@@ -55,6 +55,7 @@ AH_BOTTOM([
@@ -43,7 +43,7 @@
exec_prefix=$old_exec_prefix
libdir=$old_libdir
-@@ -1705,7 +1705,7 @@ PHP_SUBST(install_binary_targets)
+@@ -1706,7 +1706,7 @@ PHP_SUBST(install_binary_targets)
PHP_SUBST(install_targets)
PHP_SUBST(install_binary_targets)
diff --git a/lang/php83/files/patch-ext_standard_filestat.c b/lang/php83/files/patch-ext_standard_filestat.c
new file mode 100644
index 000000000000..eb08358dedfa
--- /dev/null
+++ b/lang/php83/files/patch-ext_standard_filestat.c
@@ -0,0 +1,26 @@
+--- ext/standard/filestat.c.orig 2024-01-17 22:13:37 UTC
++++ ext/standard/filestat.c
+@@ -281,7 +281,11 @@ PHPAPI zend_result php_get_gid_by_name(const char *nam
+ char *grbuf;
+
+ if (grbuflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ grbuflen = sysconf(_SC_PAGESIZE);
++#else
+ return FAILURE;
++#endif
+ }
+
+ grbuf = emalloc(grbuflen);
+@@ -407,7 +411,11 @@ PHPAPI zend_result php_get_uid_by_name(const char *nam
+ char *pwbuf;
+
+ if (pwbuflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ pwbuflen = sysconf(_SC_PAGESIZE);
++#else
+ return FAILURE;
++#endif
+ }
+
+ pwbuf = emalloc(pwbuflen);
diff --git a/lang/php83/files/patch-main_fopen__wrappers.c b/lang/php83/files/patch-main_fopen__wrappers.c
new file mode 100644
index 000000000000..4044ea70b113
--- /dev/null
+++ b/lang/php83/files/patch-main_fopen__wrappers.c
@@ -0,0 +1,14 @@
+--- main/fopen_wrappers.c.orig 2024-01-17 22:12:12 UTC
++++ main/fopen_wrappers.c
+@@ -381,7 +381,11 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *
+ char *pwbuf;
+
+ if (pwbuflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ pwbuflen = sysconf(_SC_PAGESIZE);
++#else
+ return FAILURE;
++#endif
+ }
+
+ pwbuf = emalloc(pwbuflen);
diff --git a/lang/php83/files/patch-main_main.c b/lang/php83/files/patch-main_main.c
new file mode 100644
index 000000000000..5a0c3c558cfe
--- /dev/null
+++ b/lang/php83/files/patch-main_main.c
@@ -0,0 +1,14 @@
+--- main/main.c.orig 2024-01-17 22:08:35 UTC
++++ main/main.c
+@@ -1459,7 +1459,11 @@ PHPAPI char *php_get_current_user(void)
+ char *pwbuf;
+
+ if (pwbuflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ pwbuflen = sysconf(_SC_PAGESIZE);
++#else
+ return "";
++#endif
+ }
+ pwbuf = emalloc(pwbuflen);
+ if (getpwuid_r(pstat->st_uid, &_pw, pwbuf, pwbuflen, &retpwptr) != 0) {
diff --git a/lang/php83/files/php-fpm.in b/lang/php83/files/php-fpm.in
index c234856b0e54..511e53426b71 100644
--- a/lang/php83/files/php-fpm.in
+++ b/lang/php83/files/php-fpm.in
@@ -6,8 +6,13 @@
#
# Add the following line to /etc/rc.conf to enable php-fpm:
-# php_fpm_enable="YES"
-#
+# php-fpm_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nginx
+# php-fpm_profiles (str): Set to "" by default.
+# Define your profiles here.
+# php_fpm_pid_prefix (str): Set to "" by default.
+# When using profiles manually assign value to "php_fpm_"
+# for prevent collision with other PIDs names.
. /etc/rc.subr
@@ -17,23 +22,53 @@ rcvar=php_fpm_enable
start_precmd="php_fpm_prestart"
restart_precmd="php_fpm_checkconfig"
reload_precmd="php_fpm_checkconfig"
+command="%%PREFIX%%/sbin/php-fpm"
configtest_cmd="php_fpm_checkconfig"
+_pidprefix="/var/run"
+pidfile="${_pidprefix}/php-fpm.pid"
+required_files="%%PREFIX%%/etc/php-fpm.conf"
-load_rc_config "$name"
+load_rc_config "${name}"
: ${php_fpm_enable="NO"}
: ${php_fpm_umask=""}
-extra_commands="reload configtest logrotate"
+if [ -n "$2" ]; then
+ profile="$2"
+ if [ "x${php_fpm_profiles}" != "x" ]; then
+ pidfile="${_pidprefix}/${php_fpm_pid_prefix}php-fpm-${profile}.pid"
+ eval php_fpm_configfile="\${php_fpm_${profile}_configfile:-}"
+ if [ "x${php_fpm_configfile}" = "x" ]; then
+ echo "You must define a configuration file (php_fpm_${profile}_configfile)"
+ exit 1
+ fi
+ required_files="${php_fpm_configfile}"
+ eval php_fpm_enable="\${php_fpm_${profile}_enable:-${php_fpm_enable}}"
+ php_fpm_flags="-y ${php_fpm_configfile} -g ${pidfile}"
+ else
+ echo "$0: extra argument ignored"
+ fi
+else
+ if [ "x${php_fpm_profiles}" != "x" -a "x$1" != "x" ]; then
+ for profile in ${php_fpm_profiles}; do
+ echo "===> php_fpm profile: ${profile}"
+ /usr/local/etc/rc.d/php-fpm $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+ fi
+fi
-command="%%PREFIX%%/sbin/php-fpm"
-pidfile="/var/run/php-fpm.pid"
+extra_commands="reload configtest logrotate"
sig_stop="QUIT"
sig_reload="USR2"
logrotate_cmd="php_fpm_logrotate"
-required_files="%%PREFIX%%/etc/php-fpm.conf"
-
php_fpm_logrotate() {
if [ -z "$rc_pid" ]; then
_run_rc_notrunning
@@ -46,7 +81,7 @@ php_fpm_logrotate() {
php_fpm_checkconfig()
{
echo "Performing sanity check on php-fpm configuration:"
- eval ${command} -t
+ eval ${command} ${php_fpm_flags} -t
}
php_fpm_prestart()
diff --git a/lang/php83/pkg-plist b/lang/php83/pkg-plist
index cac3796b458a..84225fc4e311 100644
--- a/lang/php83/pkg-plist
+++ b/lang/php83/pkg-plist
@@ -309,10 +309,10 @@ lib/php/build/phpize.m4
lib/php/build/pkg.m4
lib/php/build/run-tests.php
lib/php/build/shtool
-%%CGI%%man/man1/php-cgi.1.gz
-man/man1/php-config.1.gz
-%%CLI%%man/man1/php.1.gz
-%%PHPDBG%%man/man1/phpdbg.1.gz
-man/man1/phpize.1.gz
-%%FPM%%man/man8/php-fpm.8.gz
+%%CGI%%share/man/man1/php-cgi.1.gz
+share/man/man1/php-config.1.gz
+%%CLI%%share/man/man1/php.1.gz
+%%PHPDBG%%share/man/man1/phpdbg.1.gz
+share/man/man1/phpize.1.gz
+%%FPM%%share/man/man8/php-fpm.8.gz
%%FPM%%share/php/fpm/status.html
diff --git a/sysutils/php83-posix/files/patch-posix.c b/sysutils/php83-posix/files/patch-posix.c
new file mode 100644
index 000000000000..c97a44fcff96
--- /dev/null
+++ b/sysutils/php83-posix/files/patch-posix.c
@@ -0,0 +1,62 @@
+--- posix.c.orig 2024-01-17 22:28:09 UTC
++++ posix.c
+@@ -477,7 +477,11 @@ PHP_FUNCTION(posix_ttyname)
+ #if defined(ZTS) && defined(HAVE_TTYNAME_R) && defined(_SC_TTY_NAME_MAX)
+ buflen = sysconf(_SC_TTY_NAME_MAX);
+ if (buflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ buflen = sysconf(_SC_PAGESIZE);
++#else
+ RETURN_FALSE;
++#endif
+ }
+ p = emalloc(buflen);
+
+@@ -784,7 +788,11 @@ PHP_FUNCTION(posix_getgrnam)
+ #if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
+ buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (buflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ buflen = sysconf(_SC_PAGESIZE);
++#else
+ RETURN_FALSE;
++#endif
+ }
+ buf = emalloc(buflen);
+ try_again:
+@@ -840,7 +848,11 @@ PHP_FUNCTION(posix_getgrgid)
+
+ grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (grbuflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ grbuflen = sysconf(_SC_PAGESIZE);
++#else
+ RETURN_FALSE;
++#endif
+ }
+
+ grbuf = emalloc(grbuflen);
+@@ -914,7 +926,11 @@ PHP_FUNCTION(posix_getpwnam)
+ #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
+ buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (buflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ buflen = sysconf(_SC_PAGESIZE);
++#else
+ RETURN_FALSE;
++#endif
+ }
+ buf = emalloc(buflen);
+ pw = &pwbuf;
+@@ -969,7 +985,11 @@ PHP_FUNCTION(posix_getpwuid)
+ #if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
+ pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (pwbuflen < 1) {
++#if defined(__FreeBSD__) && defined(_SC_PAGESIZE)
++ pwbuflen = sysconf(_SC_PAGESIZE);
++#else
+ RETURN_FALSE;
++#endif
+ }
+ pwbuf = emalloc(pwbuflen);
+