diff --git a/srcpkgs/php8.2/patches/ac_fn_c_try_run_cross.patch b/srcpkgs/php8.2/patches/ac_fn_c_try_run_cross.patch deleted file mode 100644 index 2205168a786..00000000000 --- a/srcpkgs/php8.2/patches/ac_fn_c_try_run_cross.patch +++ /dev/null @@ -1,166 +0,0 @@ -diff --git a/configure b/configure -index 88b317c..fdb8e73 100755 ---- a/configure -+++ b/configure -@@ -2600,7 +2600,13 @@ $as_echo "$ac_try_echo"; } >&5 - esac - eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" - $as_echo "$ac_try_echo"; } >&5 -- (eval "$ac_try") 2>&5 -+ if test "$cross_compiling" = "yes"; then -+ # Use qemu-user-static to run the executable -+ qemu_exec="QEMU_LD_PREFIX=${XBPS_CROSS_BASE} qemu-${XBPS_TARGET_QEMU_MACHINE}-static" -+ (eval "$qemu_exec $ac_try") 2>&5 -+ else -+ (eval "$ac_try") 2>&5 -+ fi - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -@@ -37619,12 +37619,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -37662,7 +37656,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -37686,12 +37679,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -37729,7 +37716,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -37753,12 +37739,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -37796,7 +37776,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -37820,12 +37799,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -37863,7 +37836,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -37887,12 +37859,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -37930,7 +37896,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -37954,12 +37919,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -37997,7 +37956,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' -@@ -38021,12 +37979,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - -- if test "$cross_compiling" = yes; then : -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -38064,7 +38016,6 @@ $as_echo "no" >&6; } - fi - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext --fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' diff --git a/srcpkgs/php8.2/patches/cross-configure.patch b/srcpkgs/php8.2/patches/cross-configure.patch new file mode 100644 index 00000000000..c6977514ceb --- /dev/null +++ b/srcpkgs/php8.2/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.2/patches/cross-gdImageCreateFrom.patch b/srcpkgs/php8.2/patches/cross-gdImageCreateFrom.patch new file mode 100644 index 00000000000..1f35f9482f9 --- /dev/null +++ b/srcpkgs/php8.2/patches/cross-gdImageCreateFrom.patch @@ -0,0 +1,66 @@ +Copied and modified library macros from /usr/share/autoconf/autoconf/general.m4 +with support for using qemu-user-static to execute when cross compiling. + +diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 +index b31c9b2..e5e2d9f 100644 +--- a/ext/gd/config.m4 ++++ b/ext/gd/config.m4 +@@ -147,6 +147,40 @@ dnl that gd defines "junk" versions of each gdImageCreateFromFoo function + dnl even when it does not support the Foo format. Those junk functions + dnl display a warning but eventually return normally, making a simple link + dnl or run test insufficient. ++ ++AC_DEFUN([_AC_DO_TOKENS_QEMU], ++[{ ++ if test "$cross_compiling" = "yes"; then ++ ac_try='QEMU_LD_PREFIX=${XBPS_CROSS_BASE} qemu-${XBPS_TARGET_QEMU_MACHINE}-static $1' ++ else ++ ac_try='$1' ++ fi ++ _AC_DO([$ac_try]); }]) ++ ++m4_define([_AC_RUN_IFELSE_QEMU_BODY], ++[ AS_LINENO_PUSH([$[]1]) ++ AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS_QEMU(./conftest$ac_exeext)], ++ [ac_retval=0], ++ [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD ++ _AC_MSG_LOG_CONFTEST ++ ac_retval=$ac_status]) ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ AS_LINENO_POP ++ AS_SET_STATUS([$ac_retval]) ++]) ++ ++AC_DEFUN([_AC_RUN_IFELSE_QEMU], ++[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_run_qemu], ++ [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_run_qemu], [LINENO], ++ [Try to run conftest.$ac_ext, and return whether this succeeded. ++ Assumes that executables *can* be run.])], ++ [$0_BODY])]dnl ++[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl ++[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_run_qemu "$LINENO"], [$2], [$3]) ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl ++]) ++ + AC_DEFUN([PHP_GD_CHECK_FORMAT],[ + old_LIBS="${LIBS}" + LIBS="${LIBS} ${GD_SHARED_LIBADD}" +@@ -154,7 +188,7 @@ AC_DEFUN([PHP_GD_CHECK_FORMAT],[ + CFLAGS="${CFLAGS} ${GDLIB_CFLAGS}" + AC_MSG_CHECKING([for working gdImageCreateFrom$1 in libgd]) + AC_LANG_PUSH([C]) +- AC_RUN_IFELSE([AC_LANG_SOURCE([ ++ _AC_RUN_IFELSE_QEMU([AC_LANG_SOURCE([ + #include + #include + #include +@@ -178,8 +212,6 @@ int main(int argc, char** argv) { + AC_DEFINE($2, 1, [Does gdImageCreateFrom$1 work?]) + ],[ + AC_MSG_RESULT([no]) +- ],[ +- AC_MSG_RESULT([no]) + ]) + AC_LANG_POP([C]) + CFLAGS="${old_CFLAGS}" diff --git a/srcpkgs/php8.2/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.2/patches/cross-ltmain-sysroot-support.patch similarity index 75% rename from srcpkgs/php8.2/patches/php-ltmain-sysroot-support.patch rename to srcpkgs/php8.2/patches/cross-ltmain-sysroot-support.patch index bbe0a514a9e..a6447ac1502 100644 --- a/srcpkgs/php8.2/patches/php-ltmain-sysroot-support.patch +++ b/srcpkgs/php8.2/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.2/patches/php-pear-cross.patch b/srcpkgs/php8.2/patches/cross-pear.patch similarity index 100% rename from srcpkgs/php8.2/patches/php-pear-cross.patch rename to srcpkgs/php8.2/patches/cross-pear.patch diff --git a/srcpkgs/php8.2/patches/php-phar-cross.patch b/srcpkgs/php8.2/patches/cross-phar.patch similarity index 100% rename from srcpkgs/php8.2/patches/php-phar-cross.patch rename to srcpkgs/php8.2/patches/cross-phar.patch diff --git a/srcpkgs/php8.2/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.2/patches/cross-phpize-sysroot-support.patch similarity index 100% rename from srcpkgs/php8.2/patches/php-phpize-sysroot-support.patch rename to srcpkgs/php8.2/patches/cross-phpize-sysroot-support.patch diff --git a/srcpkgs/php8.2/patches/php-706-crypt.patch b/srcpkgs/php8.2/patches/musl-crypt.patch similarity index 80% rename from srcpkgs/php8.2/patches/php-706-crypt.patch rename to srcpkgs/php8.2/patches/musl-crypt.patch index 254f1d2187c..b83a7ab9bc1 100644 --- a/srcpkgs/php8.2/patches/php-706-crypt.patch +++ b/srcpkgs/php8.2/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.2/patches/php-cross-config.patch b/srcpkgs/php8.2/patches/php-cross-config.patch deleted file mode 100644 index 21c5e1923b2..00000000000 --- a/srcpkgs/php8.2/patches/php-cross-config.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/configure b/configure -index 88b317c..816799f 100755 ---- a/configure -+++ b/configure -@@ -61564,7 +61564,7 @@ $as_echo_n "checking for pg_config... " >&6; } - fi - done - -- if test -n "$PG_CONFIG"; then -+ if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 - $as_echo "$PG_CONFIG" >&6; } - PGSQL_INCLUDE=`$PG_CONFIG --includedir` -@@ -63090,7 +63090,7 @@ $as_echo_n "checking for pg_config... " >&6; } - fi - done - -- if test -n "$PG_CONFIG"; then -+ if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 - $as_echo "$PG_CONFIG" >&6; } - PGSQL_INCLUDE=`$PG_CONFIG --includedir` diff --git a/srcpkgs/php8.2/patches/fix-manpages.patch b/srcpkgs/php8.2/patches/php8.2-fix-manpages.patch similarity index 100% rename from srcpkgs/php8.2/patches/fix-manpages.patch rename to srcpkgs/php8.2/patches/php8.2-fix-manpages.patch diff --git a/srcpkgs/php8.2/patches/php.ini.patch b/srcpkgs/php8.2/patches/php8.2-ini.patch similarity index 100% rename from srcpkgs/php8.2/patches/php.ini.patch rename to srcpkgs/php8.2/patches/php8.2-ini.patch diff --git a/srcpkgs/php8.2/template b/srcpkgs/php8.2/template index 4fe20834f2b..9d9c9edf218 100644 --- a/srcpkgs/php8.2/template +++ b/srcpkgs/php8.2/template @@ -1,16 +1,16 @@ # Template file for 'php8.2' # rebuild php8.2-apcu and php8.2-imagick when updating this package pkgname=php8.2 -version=8.2.22 +version=8.2.26 revision=1 _php_version=8.2 build_helper="qemu" -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" @@ -19,9 +19,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=44197016c9eeed5c50523e20eb44adc4dd9d84ac08bdf9e46077e775d467d7d0 +checksum=04e47b46b347ed6404dcc9e9989486710b075eafc8490500fd271aeeac5d83cb provides="php-runtime-${version}_1" +system_accounts="_phpfpm" +_phpfpm_homedir="/var/empty" + conf_files="/etc/php${_php_version}/php.ini" lib32disabled=yes @@ -47,6 +50,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 \ @@ -137,8 +144,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}