Browse Source

php: update to 7.4.1 (#4713)

%ci:reset-backlog
build-on-device
its-pointless 5 years ago
committed by Leonid Plyushch
parent
commit
ba6c509520
  1. 7
      packages/oniguruma/build.sh
  2. 14
      packages/php/Makefile.global.patch
  3. 22
      packages/php/build.sh
  4. 9
      packages/php/ext-phar-Makefile.frag.patch
  5. 13
      packages/php/ext-standard-proc_open.c.patch
  6. 15
      packages/php/sapi-apache2handler-config.m4.patch
  7. 14
      packages/php/zend-zend_alloc.h.patch

7
packages/oniguruma/build.sh

@ -0,0 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://github.com/kkos/oniguruma
TERMUX_PKG_DESCRIPTION="regular expressions library"
TERMUX_PKG_VERSION=6.9.4
TERMUX_PKG_SRCURL=https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
TERMUX_PKG_SHA256=4669d22ff7e0992a7e93e116161cac9c0949cd8960d1c562982026726f0e6d53
TERMUX_PKG_LICENSE="BSD"

14
packages/php/Makefile.global.patch

@ -1,14 +0,0 @@
Work around https://github.com/android-ndk/ndk/issues/201.
diff -u -r ../php-7.1.6/Makefile.global ./Makefile.global
--- ../php-7.1.6/Makefile.global 2017-06-07 10:09:38.000000000 +0200
+++ ./Makefile.global 2017-06-14 23:22:21.258154325 +0200
@@ -16,7 +16,7 @@
build-binaries: $(PHP_BINARIES)
libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) -lapr-1 -laprutil-1 $(ZEND_EXTRA_LIBS) -o $@
-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)

22
packages/php/build.sh

@ -1,14 +1,14 @@
TERMUX_PKG_HOMEPAGE=https://php.net
TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
TERMUX_PKG_LICENSE="PHP-3.0"
TERMUX_PKG_VERSION=7.3.12
TERMUX_PKG_VERSION=7.4.1
TERMUX_PKG_SRCURL=https://secure.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df
TERMUX_PKG_SHA256=561bb866bdd509094be00f4ece7c3543ec971c4d878645ee81437e291cffc762
# Build native php for phar to build (see pear-Makefile.frag.patch):
TERMUX_PKG_HOSTBUILD=true
# Build the native php without xml support as we only need phar:
TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="--disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear"
TERMUX_PKG_DEPENDS="libiconv, libandroid-glob, libxml2, liblzma, openssl, pcre2, libbz2, libcrypt, libcurl, libgd, readline, freetype, libandroid-support, zlib"
TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="--disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear --disable-sqlite3 --without-libxml --without-sqlite3 --without-pdo-sqlite"
TERMUX_PKG_DEPENDS="libiconv, libandroid-glob, libxml2, liblzma, openssl, pcre2, libbz2, libcrypt, libcurl, libgd, readline, freetype, libandroid-support, zlib, oniguruma, libsqlite"
# mysql modules were initially shared libs
TERMUX_PKG_CONFLICTS="php-mysql, php-dev"
TERMUX_PKG_REPLACES="php-mysql, php-dev"
@ -19,24 +19,16 @@ ac_cv_func_res_nsearch=no
--enable-bcmath
--enable-calendar
--enable-exif
--enable-gd-native-ttf=$TERMUX_PREFIX
--enable-mbstring
--enable-opcache
--enable-pcntl
--enable-sockets
--enable-zip
--mandir=$TERMUX_PREFIX/share/man
--with-bz2=$TERMUX_PREFIX
--with-curl=$TERMUX_PREFIX
--with-freetype-dir=$TERMUX_PREFIX
--with-gd=$TERMUX_PREFIX
--with-libxml-dir=$TERMUX_PREFIX
--with-openssl=$TERMUX_PREFIX
--with-pcre-regex=$TERMUX_PREFIX
--with-png-dir=$TERMUX_PREFIX
--with-readline=$TERMUX_PREFIX
--with-zlib
--without-libzip
--with-pgsql=shared,$TERMUX_PREFIX
--with-pdo-pgsql=shared,$TERMUX_PREFIX
--with-mysqli=mysqlnd
@ -45,6 +37,7 @@ ac_cv_func_res_nsearch=no
--with-apxs2=$TERMUX_PKG_TMPDIR/apxs-wrapper.sh
--with-iconv=$TERMUX_PREFIX
--enable-fpm
--with-external-pcre
--sbindir=$TERMUX_PREFIX/bin
"
@ -53,7 +46,10 @@ termux_step_pre_configure() {
export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
if [ "$TERMUX_ARCH" = "aarch64" ]; then
CFLAGS+=" -march=armv8-a+crc"
CXXFLAGS+=" -march=armv8-a+crc"
fi
# Run autoconf since we have patched config.m4 files.
autoconf

9
packages/php/ext-phar-Makefile.frag.patch

@ -1,10 +1,9 @@
diff -u -r ../php-7.1.0RC3/ext/phar/Makefile.frag ./ext/phar/Makefile.frag
--- ../php-7.1.0RC3/ext/phar/Makefile.frag 2016-09-28 22:15:43.000000000 -0400
+++ ./ext/phar/Makefile.frag 2016-10-03 05:47:53.106218451 -0400
@@ -4,20 +4,7 @@
--- ./ext/phar/Makefile.frag.orig 2019-12-28 21:58:16.963934498 +0000
+++ ./ext/phar/Makefile.frag 2019-12-28 21:58:32.664200997 +0000
@@ -9,20 +9,7 @@
pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0'
PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
-PHP_PHARCMD_EXECUTABLE = ` \
- if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
- $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \

13
packages/php/ext-standard-proc_open.c.patch

@ -1,9 +1,8 @@
diff -u -r ../php-5.6.17/ext/standard/proc_open.c ./ext/standard/proc_open.c > ~/php-proc_open.patch
--- ../php-5.6.17/ext/standard/proc_open.c 2016-03-04 18:41:21.108197300 +0100
+++ ./ext/standard/proc_open.c 2016-03-04 18:41:58.088196534 +0100
@@ -881,9 +881,9 @@
}
--- ext/standard/proc_open.c.orig 2019-12-28 22:27:36.923774794 +0000
+++ ./ext/standard/proc_open.c 2019-12-28 22:28:31.914719970 +0000
@@ -1048,9 +1048,9 @@
execvp(command, argv);
} else {
if (env.envarray) {
- execle("/bin/sh", "sh", "-c", command, NULL, env.envarray);
+ execle("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL, env.envarray);
@ -11,5 +10,5 @@ diff -u -r ../php-5.6.17/ext/standard/proc_open.c ./ext/standard/proc_open.c > ~
- execl("/bin/sh", "sh", "-c", command, NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL);
}
}
_exit(127);

15
packages/php/sapi-apache2handler-config.m4.patch

@ -1,6 +1,6 @@
--- ./sapi/apache2handler/config.m4 2017-05-09 17:59:42.000000000 +0530
+++ ./sapi/apache2handler/config.m4 2017-06-08 21:10:39.847173781 +0530
@@ -67,18 +67,9 @@
--- sapi/apache2handler/config.m4.orig 2019-12-28 22:30:23.046629391 +0000
+++ ./sapi/apache2handler/config.m4 2019-12-28 22:31:10.687447649 +0000
@@ -64,18 +64,9 @@
fi
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
@ -19,12 +19,3 @@
case $host_alias in
*aix*)
@@ -122,7 +122,7 @@
PHP_BUILD_THREAD_SAFE
fi
else
- APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
+ APACHE_THREADED_MPM=true
if test -n "$APACHE_THREADED_MPM"; then
PHP_BUILD_THREAD_SAFE
fi

14
packages/php/zend-zend_alloc.h.patch

@ -0,0 +1,14 @@
--- /home/builder/.termux-build/php/src/Zend/zend_alloc.h.orig 2019-12-29 20:42:25.958615960 +0000
+++ ./Zend/zend_alloc.h 2019-12-29 20:46:26.512651734 +0000
@@ -27,7 +27,11 @@
#include "zend.h"
#ifndef ZEND_MM_ALIGNMENT
+#ifdef __ANDROID__
+# define ZEND_MM_ALIGNMENT 8
+#else
# define ZEND_MM_ALIGNMENT ((size_t) 8)
+#endif
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(3)
#elif ZEND_MM_ALIGNMENT < 4
# undef ZEND_MM_ALIGNMENT
Loading…
Cancel
Save