From 57f20971a565e6f112e632977425310870dd8595 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Tue, 17 Sep 2024 09:20:36 -0400 Subject: [PATCH] php8.1: update to 8.1.31. - enable fpm ACLs - clean up patches - generate configure locally instead of using vendored for ease of patching - add user for php-fpm instead of using uncreated `http` user --- srcpkgs/php8.1/patches/cross-configure.patch | 26 +++++++++++++++++++ ...tch => cross-ltmain-sysroot-support.patch} | 9 +++++++ ...{php-pear-cross.patch => cross-pear.patch} | 0 ...{php-phar-cross.patch => cross-phar.patch} | 0 ...tch => cross-phpize-sysroot-support.patch} | 0 .../{php-706-crypt.patch => musl-crypt.patch} | 3 +++ srcpkgs/php8.1/patches/php-cross-config.patch | 22 ---------------- ...npages.patch => php8.1-fix-manpages.patch} | 0 .../{php.ini.patch => php8.1-ini.patch} | 0 srcpkgs/php8.1/template | 20 +++++++++----- 10 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 srcpkgs/php8.1/patches/cross-configure.patch rename srcpkgs/php8.1/patches/{php-ltmain-sysroot-support.patch => cross-ltmain-sysroot-support.patch} (75%) rename srcpkgs/php8.1/patches/{php-pear-cross.patch => cross-pear.patch} (100%) rename srcpkgs/php8.1/patches/{php-phar-cross.patch => cross-phar.patch} (100%) rename srcpkgs/php8.1/patches/{php-phpize-sysroot-support.patch => cross-phpize-sysroot-support.patch} (100%) rename srcpkgs/php8.1/patches/{php-706-crypt.patch => musl-crypt.patch} (80%) delete mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch rename srcpkgs/php8.1/patches/{fix-manpages.patch => php8.1-fix-manpages.patch} (100%) rename srcpkgs/php8.1/patches/{php.ini.patch => php8.1-ini.patch} (100%) diff --git a/srcpkgs/php8.1/patches/cross-configure.patch b/srcpkgs/php8.1/patches/cross-configure.patch new file mode 100644 index 00000000000..c6977514ceb --- /dev/null +++ b/srcpkgs/php8.1/patches/cross-configure.patch @@ -0,0 +1,26 @@ +diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4 +index 80ffd97..d8cad47 100644 +--- a/ext/pdo_pgsql/config.m4 ++++ b/ext/pdo_pgsql/config.m4 +@@ -20,7 +20,7 @@ if test "$PHP_PDO_PGSQL" != "no"; then + fi + done + +- if test -n "$PG_CONFIG"; then ++ if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then + AC_MSG_RESULT([$PG_CONFIG]) + PGSQL_INCLUDE=`$PG_CONFIG --includedir` + PGSQL_LIBDIR=`$PG_CONFIG --libdir` +diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 +index 669a9f7..7e5bf7f 100644 +--- a/ext/pgsql/config.m4 ++++ b/ext/pgsql/config.m4 +@@ -18,7 +18,7 @@ if test "$PHP_PGSQL" != "no"; then + fi + done + +- if test -n "$PG_CONFIG"; then ++ if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then + AC_MSG_RESULT([$PG_CONFIG]) + PGSQL_INCLUDE=`$PG_CONFIG --includedir` + PGSQL_LIBDIR=`$PG_CONFIG --libdir` diff --git a/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/cross-ltmain-sysroot-support.patch similarity index 75% rename from srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch rename to srcpkgs/php8.1/patches/cross-ltmain-sysroot-support.patch index bbe0a514a9e..a6447ac1502 100644 --- a/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch +++ b/srcpkgs/php8.1/patches/cross-ltmain-sysroot-support.patch @@ -1,3 +1,12 @@ +PHP's phpize is based on a very old libtool to generate build files for its +extensions. This libtool does not support .la files with '=' to support +sysroot. + +In order to support more PHP extension cross compilation this modifies +ltmain.sh to support such path. This is a bit hackish has it only get sysroot +from the used toolchain; the proper way to fix that is to have PHP developpers +to update the autotools file used to build there extensions. + --- a/build/ltmain.sh 2021-09-09 15:19:14.822208365 +0200 +++ b/build/ltmain.sh 2021-09-09 15:47:55.397011151 +0200 @@ -2375,6 +2375,13 @@ EOF diff --git a/srcpkgs/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/cross-pear.patch similarity index 100% rename from srcpkgs/php8.1/patches/php-pear-cross.patch rename to srcpkgs/php8.1/patches/cross-pear.patch diff --git a/srcpkgs/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/cross-phar.patch similarity index 100% rename from srcpkgs/php8.1/patches/php-phar-cross.patch rename to srcpkgs/php8.1/patches/cross-phar.patch diff --git a/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/cross-phpize-sysroot-support.patch similarity index 100% rename from srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch rename to srcpkgs/php8.1/patches/cross-phpize-sysroot-support.patch diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/musl-crypt.patch similarity index 80% rename from srcpkgs/php8.1/patches/php-706-crypt.patch rename to srcpkgs/php8.1/patches/musl-crypt.patch index 254f1d2187c..b83a7ab9bc1 100644 --- a/srcpkgs/php8.1/patches/php-706-crypt.patch +++ b/srcpkgs/php8.1/patches/musl-crypt.patch @@ -1,3 +1,6 @@ +TODO: This is apparently needed on musl, not sure what the error is, might be +something to dig in to. + --- a/ext/standard/crypt.c 2016-04-28 14:13:00.000000000 -0400 +++ b/ext/standard/crypt.c 2016-04-28 21:45:24.340955313 -0400 @@ -267,6 +267,12 @@ diff --git a/srcpkgs/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch deleted file mode 100644 index 169c43f1df9..00000000000 --- a/srcpkgs/php8.1/patches/php-cross-config.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/configure b/configure -index e4b82d1..1a8678f 100755 ---- a/configure -+++ b/configure -@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; } - fi - done - -- if test -n "$PG_CONFIG"; then -+ if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 - printf "%s\n" "$PG_CONFIG" >&6; } - PGSQL_INCLUDE=`$PG_CONFIG --includedir` -@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; } - fi - done - -- if test -n "$PG_CONFIG"; then -+ if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 - printf "%s\n" "$PG_CONFIG" >&6; } - PGSQL_INCLUDE=`$PG_CONFIG --includedir` diff --git a/srcpkgs/php8.1/patches/fix-manpages.patch b/srcpkgs/php8.1/patches/php8.1-fix-manpages.patch similarity index 100% rename from srcpkgs/php8.1/patches/fix-manpages.patch rename to srcpkgs/php8.1/patches/php8.1-fix-manpages.patch diff --git a/srcpkgs/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php8.1-ini.patch similarity index 100% rename from srcpkgs/php8.1/patches/php.ini.patch rename to srcpkgs/php8.1/patches/php8.1-ini.patch diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template index 71285aa8281..6e95ccdcd9c 100644 --- a/srcpkgs/php8.1/template +++ b/srcpkgs/php8.1/template @@ -1,15 +1,15 @@ # Template file for 'php8.1' # rebuild php8.1-apcu and php8.1-imagick when updating this package pkgname=php8.1 -version=8.1.29 +version=8.1.31 revision=1 _php_version=8.1 -hostmakedepends="bison pkg-config apache-devel" +hostmakedepends="bison pkg-config apache-devel autoconf" makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel - libffi-devel oniguruma-devel gd-devel" + libffi-devel oniguruma-devel gd-devel acl-devel" short_desc="HTML-embedded scripting language" maintainer="Joel Beckmeyer " license="PHP-3.01" @@ -18,9 +18,12 @@ changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS" # this is the source where the www.php.net code pulls the tarballs it serves # at https://www.php.net/distributions/ distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz" -checksum=8b2609bf1d3173aa38269a9af21532c65f730aadd3051f9aae011eea9e246de5 +checksum=618923b407c4575bfee085f00c4aaa16a5cc86d4b1eb893c0f352d61541bbfb1 provides="php-runtime-${version}_1" +system_accounts="_phpfpm" +_phpfpm_homedir="/var/empty" + conf_files="/etc/php${_php_version}/php.ini" lib32disabled=yes @@ -50,6 +53,10 @@ alternatives=" php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1 php:php.1:/usr/share/man/man1/php${_php_version}.1" +do_configure() { + autoconf -f +} + do_build() { local _phpconfig="--srcdir=.. \ --config-cache \ @@ -140,8 +147,9 @@ do_build() { --host=${XBPS_CROSS_TRIPLET} \ --enable-cgi \ --enable-fpm \ - --with-fpm-user=http \ - --with-fpm-group=http \ + --with-fpm-user=_phpfpm \ + --with-fpm-group=_phpfpm \ + --with-fpm-acl \ --enable-embed=shared \ ${_phpextensions} make ${makejobs} ${_make_env}