diff --git a/srcpkgs/php8.3/patches/ac_fn_c_try_run_cross.patch b/srcpkgs/php8.3/patches/ac_fn_c_try_run_cross.patch deleted file mode 100644 index e0a5d3cf2b1..00000000000 --- a/srcpkgs/php8.3/patches/ac_fn_c_try_run_cross.patch +++ /dev/null @@ -1,176 +0,0 @@ -diff --git a/configure b/configure -index b6c740b..550e313 100755 ---- a/configure -+++ b/configure -@@ -2600,7 +2600,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 - esac - eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" - printf "%s\n" "$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=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -@@ -39741,13 +39741,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -39786,7 +39779,6 @@ printf "%s\n" "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' -@@ -39810,13 +39802,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -39855,7 +39840,6 @@ printf "%s\n" "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' -@@ -39879,13 +39863,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -39924,7 +39901,6 @@ printf "%s\n" "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' -@@ -39948,13 +39924,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -39993,7 +39962,6 @@ printf "%s\n" "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' -@@ -40017,13 +39985,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -40062,7 +40023,6 @@ printf "%s\n" "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' -@@ -40086,13 +40046,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -40131,7 +40084,6 @@ printf "%s\n" "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' -@@ -40155,13 +40107,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 : -- -- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 --printf "%s\n" "no" >&6; } -- --else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -40200,7 +40145,6 @@ printf "%s\n" "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' - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } diff --git a/srcpkgs/php8.3/patches/cross-configure.patch b/srcpkgs/php8.3/patches/cross-configure.patch new file mode 100644 index 00000000000..c6977514ceb --- /dev/null +++ b/srcpkgs/php8.3/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.3/patches/cross-gdImageCreateFrom.patch b/srcpkgs/php8.3/patches/cross-gdImageCreateFrom.patch new file mode 100644 index 00000000000..1f35f9482f9 --- /dev/null +++ b/srcpkgs/php8.3/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.3/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.3/patches/cross-ltmain-sysroot-support.patch similarity index 75% rename from srcpkgs/php8.3/patches/php-ltmain-sysroot-support.patch rename to srcpkgs/php8.3/patches/cross-ltmain-sysroot-support.patch index bbe0a514a9e..a6447ac1502 100644 --- a/srcpkgs/php8.3/patches/php-ltmain-sysroot-support.patch +++ b/srcpkgs/php8.3/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.3/patches/php-pear-cross.patch b/srcpkgs/php8.3/patches/cross-pear.patch similarity index 100% rename from srcpkgs/php8.3/patches/php-pear-cross.patch rename to srcpkgs/php8.3/patches/cross-pear.patch diff --git a/srcpkgs/php8.3/patches/php-phar-cross.patch b/srcpkgs/php8.3/patches/cross-phar.patch similarity index 100% rename from srcpkgs/php8.3/patches/php-phar-cross.patch rename to srcpkgs/php8.3/patches/cross-phar.patch diff --git a/srcpkgs/php8.3/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.3/patches/cross-phpize-sysroot-support.patch similarity index 100% rename from srcpkgs/php8.3/patches/php-phpize-sysroot-support.patch rename to srcpkgs/php8.3/patches/cross-phpize-sysroot-support.patch diff --git a/srcpkgs/php8.3/patches/php-706-crypt.patch b/srcpkgs/php8.3/patches/musl-crypt.patch similarity index 80% rename from srcpkgs/php8.3/patches/php-706-crypt.patch rename to srcpkgs/php8.3/patches/musl-crypt.patch index 254f1d2187c..b83a7ab9bc1 100644 --- a/srcpkgs/php8.3/patches/php-706-crypt.patch +++ b/srcpkgs/php8.3/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.3/patches/php-cross-config.patch b/srcpkgs/php8.3/patches/php-cross-config.patch deleted file mode 100644 index c84e4497436..00000000000 --- a/srcpkgs/php8.3/patches/php-cross-config.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/configure b/configure -index d317fd7..5560d75 100755 ---- a/configure -+++ b/configure -@@ -60896,7 +60896,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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 - $as_echo "$PG_CONFIG" >&6; } - PGSQL_INCLUDE=`$PG_CONFIG --includedir` -@@ -62422,7 +62422,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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 - $as_echo "$PG_CONFIG" >&6; } - PGSQL_INCLUDE=`$PG_CONFIG --includedir` diff --git a/srcpkgs/php8.3/patches/fix-manpages.patch b/srcpkgs/php8.3/patches/php8.3-fix-manpages.patch similarity index 100% rename from srcpkgs/php8.3/patches/fix-manpages.patch rename to srcpkgs/php8.3/patches/php8.3-fix-manpages.patch diff --git a/srcpkgs/php8.3/patches/php.ini.patch b/srcpkgs/php8.3/patches/php8.3-ini.patch similarity index 100% rename from srcpkgs/php8.3/patches/php.ini.patch rename to srcpkgs/php8.3/patches/php8.3-ini.patch diff --git a/srcpkgs/php8.3/template b/srcpkgs/php8.3/template index 9a415922f01..433314bae52 100644 --- a/srcpkgs/php8.3/template +++ b/srcpkgs/php8.3/template @@ -1,16 +1,16 @@ # Template file for 'php8.3' # rebuild php8.3-apcu and php8.3-imagick when updating this package pkgname=php8.3 -version=8.3.10 +version=8.3.14 revision=1 _php_version=8.3 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=d0b4dd5ff465053248fd28dacf2fe0bed79deaaef657890cecb6bfcb73996dcd +checksum=e4ee602c31e2f701c9f0209a2902dd4802727431246a9155bf56dda7bcf7fb4a 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}