package/php: bump version to 8.0.7
authorAdam Duskett <aduskett@gmail.com>
Tue, 29 Jun 2021 16:50:54 +0000 (09:50 -0700)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 3 Jul 2021 20:01:12 +0000 (22:01 +0200)
Other changes:

  - Remove BR2_PACKAGE_PHP_EXT_JSON as the json extension is now an
    integral part of PHP and is no longer optional. Due to this, it is
    not added to Config.in.legacy.

  - Move BR2_PACKAGE_PHP_EXT_XMLRPC to Config.in.legacy as the extension has
    been removed. See https://wiki.php.net/rfc/unbundle_xmlprc for an
    explination.

  - Add a new patch that allows for opcache to cross-compile with PHP8.

  - Explicitly disable opcache-jit when opcache is enabled, as the JIT fails
    to cross-compile.

  - --enable-maintainer-zts is now --enable-zts

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Config.in.legacy
package/php/0001-acinclude.m4-don-t-unset-variables.patch
package/php/0002-iconv-tweak-iconv-detection.patch
package/php/0003-configure-disable-the-phar-tool.patch
package/php/0004-Call-apxs-with-correct-prefix.patch
package/php/0005-allow-opcache-cross-compiling.patch [new file with mode: 0644]
package/php/Config.ext
package/php/php.hash
package/php/php.mk

index a0c1a6898f43539bdad812227f16e758f6688674..bcbb625edb648544d7dc569fa3592dd49a632c2a 100644 (file)
@@ -146,6 +146,13 @@ endif
 
 comment "Legacy options removed in 2021.05"
 
+config BR2_PACKAGE_PHP_EXT_XMLRPC
+       bool "PHP XMLRPC extension removed"
+       select BR2_LEGACY
+       help
+         The XMLRPC php extension was removed.
+         See: https://wiki.php.net/rfc/unbundle_xmlprc
+
 config BR2_PACKAGE_UDISKS_LVM2
        bool "udisks lvm2 support removed"
        select BR2_LEGACY
index 982857a35726623dc6fc9efaf30c697e6ed80746..2d1555278381a4410ce6db94e1d34ab6da5d697d 100644 (file)
@@ -17,7 +17,7 @@ diff --git a/build/php.m4 b/build/php.m4
 index e91ef988..9586c490 100644
 --- a/build/php.m4
 +++ b/build/php.m4
-@@ -1587,8 +1587,6 @@ dnl PHP_CHECK_FUNC_LIB
+@@ -1568,8 +1568,6 @@ dnl PHP_CHECK_FUNC_LIB
  dnl
  AC_DEFUN([PHP_CHECK_FUNC_LIB],[
    ifelse($2,,:,[
@@ -26,7 +26,7 @@ index e91ef988..9586c490 100644
    unset found
    AC_CHECK_LIB($2, $1, [found=yes], [
      AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
-@@ -1620,8 +1618,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and
+@@ -1601,8 +1599,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and
  dnl HAVE_library if found and adds the library to LIBS.
  dnl
  AC_DEFUN([PHP_CHECK_FUNC],[
index 65ed6055bcb045e96ab132164610f19376fa4060..19d7ab5cf92c89469d916e5141cb411f8e5a2d5d 100644 (file)
@@ -14,60 +14,26 @@ Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 [Gustavo: convert to nice m4 instead of patching configure]
 [Gustavo: update for 5.6.10]
 Signed-off-by: Adam Duskett <aduskett@gmail.com>
-[aduskett@gmail.com: Update for 7.3.0]
+[aduskett@gmail.com: Update for 8.0.7]
 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
 [Bernd: rebased for 7.4.10 & 7.4.13]
 ---
- build/php.m4        |  2 +-
- ext/iconv/config.m4 | 22 ----------------------
- 2 files changed, 1 insertion(+), 23 deletions(-)
+ build/php.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/build/php.m4 b/build/php.m4
 index 9586c490..8b3d47ed 100644
 --- a/build/php.m4
 +++ b/build/php.m4
-@@ -1973,7 +1973,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
+@@ -1937,7 +1937,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
    dnl Check external libs for iconv funcs.
    if test "$found_iconv" = "no"; then
  
 -    for i in $PHP_ICONV /usr/local /usr; do
 +    for i in $PHP_ICONV; do
-       if test -r $i/include/giconv.h; then
-         AC_DEFINE(HAVE_GICONV_H, 1, [ ])
+       if test -r $i/include/gnu-libiconv/iconv.h; then
          ICONV_DIR=$i
-diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
-index fe9b47aa..70599694 100644
---- a/ext/iconv/config.m4
-+++ b/ext/iconv/config.m4
-@@ -13,28 +13,6 @@ if test "$PHP_ICONV" != "no"; then
-   ])
-   if test "$iconv_avail" != "no"; then
--    if test -z "$ICONV_DIR"; then
--      for i in /usr/local /usr; do
--        if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
--          PHP_ICONV_PREFIX="$i"
--          break
--        fi
--      done
--      if test -z "$PHP_ICONV_PREFIX"; then
--        PHP_ICONV_PREFIX="/usr"
--      fi
--    else
--      PHP_ICONV_PREFIX="$ICONV_DIR"
--    fi
--
--    CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
--    LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
--
--    if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
--      PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
--    else
--      PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
--      fi
-     AC_MSG_CHECKING([if iconv is glibc's])
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnu/libc-version.h>]], [[gnu_get_libc_version();]])],[
+         ICONV_INCLUDE_DIR=$i/include/gnu-libiconv
 -- 
-2.7.4
+2.31.1
 
index 4a25ec05c1869b9f5daf03e2b8631f15c4dde14f..cc4f55a8c837260990b444bb8283a5c0122e94b1 100644 (file)
@@ -11,7 +11,7 @@ on the target.
 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 [Gustavo: update for autoreconf/configure.in]
 Signed-off-by: Adam Duskett <aduskett@gmail.com>
-[Aduskett: update for 7.3.0]
+[Aduskett: update for 8.0.7]
 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
 [Bernd: rebased for 7.4.10 & 7.4.13]
 ---
@@ -22,8 +22,8 @@ diff --git a/configure.ac b/configure.ac
 index 0dfab302..6026fb66 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1454,13 +1454,8 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
+@@ -1423,13 +1423,8 @@ CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)"
CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
  CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
  
 -if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
index a0a07157891daf39584febf89ff7a14b5d9c8d39..3a1a58008473000cfc9aeb416dd529a04f426898 100644 (file)
@@ -7,7 +7,7 @@ php uses apache's apxs script from staging directory to install libphp
 dynamic library and update /etc/apache2/httpd.conf in the staging and target
 directories. Here is the full command line:
 "apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/modules'
- -S SYSCONFDIR='$(INSTALL_ROOT)/etc/apache2' -i -a -n php7"
+ -S SYSCONFDIR='$(INSTALL_ROOT)/etc/apache2' -i -a -n php"
 This does not work for target directory as apxs sets the full path of the
 library and not the relative one. Indeed, apxs is smart enough to substitute
 away the prefix specified in $(STAGING_DIR)/usr/build/config_vars.mk so
@@ -16,7 +16,7 @@ To fix this, add -S PREFIX='$(INSTALL_ROOT)/usr' to apxs call in configure
 
 Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
 Signed-off-by: Adam Duskett <aduskett@gmail.com>
-[aduskett@gmail.com: Update for 7.3.0]
+[aduskett@gmail.com: Update for 8.0.7]
 ---
  sapi/apache2handler/config.m4 | 3 +++
  1 file changed, 3 insertions(+)
@@ -35,7 +35,7 @@ index 55c16179..68ce66c0 100644
      INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                   $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
 +                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
+                        -i -n php"
    else
      APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
 @@ -74,6 +76,7 @@ if test "$PHP_APXS2" != "no"; then
@@ -43,7 +43,7 @@ index 55c16179..68ce66c0 100644
                   $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                         -S SYSCONFDIR='$APXS_SYSCONFDIR' \
 +                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
+                        -i -a -n php"
    fi
  
 -- 
diff --git a/package/php/0005-allow-opcache-cross-compiling.patch b/package/php/0005-allow-opcache-cross-compiling.patch
new file mode 100644 (file)
index 0000000..d168f71
--- /dev/null
@@ -0,0 +1,37 @@
+From 9bb316c41a69935ee2072626467241889594bed4 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <aduskett@gmail.com>
+Date: Mon, 28 Jun 2021 11:12:36 -0700
+Subject: [PATCH] allow opcache cross-compiling
+
+Remove the check at the end of ext/opcache/config.m4 that prevents opcache from
+being enabled in a cross-compiled environment. We pass the following as a
+CFLAGS when opcache is enabled:
+  -DHAVE_SHM_IPC
+  -DHAVE_SHM_MMAP_ANON
+  -DHAVE_SHM_MMAP_ZERO
+  -DHAVE_SHM_MMAP_POSIX
+  -DHAVE_SHM_MMAP_FILE
+
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ ext/opcache/config.m4 | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
+index 5492fd92..10c150ff 100644
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -339,10 +339,6 @@ int main() {
+   PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)
+   PHP_ADD_EXTENSION_DEP(opcache, pcre)
+-  if test "$have_shm_ipc" != "yes" && test "$have_shm_mmap_posix" != "yes" && test "$have_shm_mmap_anon" != "yes"; then
+-    AC_MSG_ERROR([No supported shared memory caching support was found when configuring opcache. Check config.log for any errors or missing dependencies.])
+-  fi
+-
+   if test "$PHP_OPCACHE_JIT" = "yes"; then
+     PHP_ADD_BUILD_DIR([$ext_builddir/jit], 1)
+     PHP_ADD_MAKEFILE_FRAGMENT($ext_srcdir/jit/Makefile.frag)
+-- 
+2.31.1
+
index 1e8ca495a7229a4497859457c01706343c57a2e6..3a65f70b86f817c44eaaf04c63d935912c8d4a3e 100644 (file)
@@ -273,11 +273,6 @@ config BR2_PACKAGE_PHP_EXT_GMP
 
 comment "Other basic extensions"
 
-config BR2_PACKAGE_PHP_EXT_JSON
-       bool "JSON"
-       help
-         JavaScript Object Serialization support
-
 config BR2_PACKAGE_PHP_EXT_TOKENIZER
        bool "Tokenizer"
        help
@@ -363,13 +358,6 @@ config BR2_PACKAGE_PHP_EXT_SOAP
        help
          SOAP support
 
-config BR2_PACKAGE_PHP_EXT_XMLRPC
-       bool "XML-RPC"
-       select BR2_PACKAGE_PHP_EXT_LIBXML2
-       select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
-       help
-         XML-RPC support
-
 comment "XML manipulation"
 
 config BR2_PACKAGE_PHP_EXT_DOM
index d91d6aec66673e5c44761c684d3b9811172a0a52..b1cb8f045ec6faf6c351f85da2b0aca2151cf3e6 100644 (file)
@@ -1,5 +1,5 @@
 # From https://www.php.net/downloads.php
-sha256  1fa46ca6790d780bf2cb48961df65f0ca3640c4533f0bca743cd61b71cb66335  php-7.4.20.tar.xz
+sha256  d5fc2e4fc780a32404d88c360e3e0009bc725d936459668e9c2ac992f2d83654  php-8.0.7.tar.xz
 
 # License file
 sha256  a188db807d711536f71e27b7d36879d63480f7994dc18adc08e624b3c5430fff  LICENSE
index 3e422c5ac1966dedfda371ddecd8a1e0d18c26b5..af0b073d845905fc56a75a8270c680136893f11e 100644 (file)
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-PHP_VERSION = 7.4.20
-PHP_SITE = http://www.php.net/distributions
+PHP_VERSION = 8.0.7
+PHP_SITE = https://www.php.net/distributions
 PHP_SOURCE = php-$(PHP_VERSION).tar.xz
 PHP_INSTALL_STAGING = YES
 PHP_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
@@ -62,7 +62,7 @@ PHP_CXXFLAGS = $(TARGET_CXXFLAGS)
 # The OPcache extension isn't cross-compile friendly
 # Throw some defines here to avoid patching heavily
 ifeq ($(BR2_PACKAGE_PHP_EXT_OPCACHE),y)
-PHP_CONF_OPTS += --enable-opcache
+PHP_CONF_OPTS += --enable-opcache --disable-opcache-jit
 PHP_CONF_ENV += ac_cv_func_mprotect=yes
 PHP_CFLAGS += \
        -DHAVE_SHM_IPC \
@@ -90,7 +90,7 @@ PHP_CONF_OPTS += --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
 
 # Enable thread safety option if Apache MPM is event or worker
 ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT)$(BR2_PACKAGE_APACHE_MPM_WORKER),y)
-PHP_CONF_OPTS += --enable-maintainer-zts
+PHP_CONF_OPTS += --enable-zts
 endif
 endif
 
@@ -107,7 +107,6 @@ PHP_CONF_OPTS += \
        $(if $(BR2_PACKAGE_PHP_EXT_XMLWRITER),--enable-xmlwriter) \
        $(if $(BR2_PACKAGE_PHP_EXT_EXIF),--enable-exif) \
        $(if $(BR2_PACKAGE_PHP_EXT_FTP),--enable-ftp) \
-       $(if $(BR2_PACKAGE_PHP_EXT_JSON),--enable-json) \
        $(if $(BR2_PACKAGE_PHP_EXT_TOKENIZER),--enable-tokenizer) \
        $(if $(BR2_PACKAGE_PHP_EXT_PCNTL),--enable-pcntl) \
        $(if $(BR2_PACKAGE_PHP_EXT_SHMOP),--enable-shmop) \
@@ -161,13 +160,6 @@ PHP_CONF_OPTS += --enable-wddx --with-libexpat-dir=$(STAGING_DIR)/usr
 PHP_DEPENDENCIES += expat
 endif
 
-ifeq ($(BR2_PACKAGE_PHP_EXT_XMLRPC),y)
-PHP_CONF_OPTS += \
-       --with-xmlrpc \
-       $(if $(BR2_PACKAGE_LIBICONV),--with-iconv-dir=$(STAGING_DIR)/usr)
-PHP_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
-endif
-
 ifeq ($(BR2_PACKAGE_PHP_EXT_ZIP),y)
 PHP_DEPENDENCIES += libzip
 endif