Browse Source

php: Update from 5.6.26 to 7.1rc3

android-5
Fredrik Fornwall 8 years ago
parent
commit
da1533a42c
  1. 41
      packages/php/build.sh
  2. 8
      packages/php/ext-phar-Makefile.frag.patch
  3. 19
      packages/php/ext-posix-posix.c.patch
  4. 44
      packages/php/ext-standard-basic_functions.c.patch
  5. 18
      packages/php/pear-Makefile.frag.patch

41
packages/php/build.sh

@ -1,38 +1,35 @@
TERMUX_PKG_HOMEPAGE=http://php.net/
TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
TERMUX_PKG_VERSION=5.6.26
TERMUX_PKG_SRCURL=http://mirror.internode.on.net/pub/php/php-${TERMUX_PKG_VERSION}.tar.xz
_PHP_RC=3
TERMUX_PKG_VERSION=7.1~rc${_PHP_RC}
TERMUX_PKG_SRCURL=https://downloads.php.net/~davey/php-7.1.0RC${_PHP_RC}.tar.xz
# 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_FOLDERNAME=php-${TERMUX_PKG_VERSION}
TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libbz2, libcrypt, libmcrypt, libcurl, libgd, readline, freetype"
# http://php.net/manual/en/libxml.installation.php
# "If configure cannot find xml2-config in the directory specified by --with-libxml-dir,
# then it'll continue on and check the default locations."
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_res_nsearch=no"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --mandir=$TERMUX_PREFIX/share/man"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-bz2=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curl=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-freetype-dir=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-gd=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-iconv=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-libxml-dir=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-mcrypt=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX"
# http://php.net/manual/en/pcre.installation.php: pcre always enabled, use platform library:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-pcre-regex=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-iconv=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curl=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-mcrypt=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-gd=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-gd-native-ttf=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-freetype-dir=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-readline=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-zlib"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-zip"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-mbstring"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_res_nsearch=no"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --mandir=$TERMUX_PREFIX/share/man"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-sockets"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-bcmath"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-opcache"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-calendar"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-exif"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-bz2=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-gd-native-ttf=$TERMUX_PREFIX"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-mbstring"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-opcache"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-sockets"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-zip"
termux_step_pre_configure () {
LDFLAGS+=" -landroid-glob"
@ -46,6 +43,8 @@ termux_step_pre_configure () {
}
termux_step_post_configure () {
perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
# Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:
perl -p -i -e 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
# Avoid src/ext/standard/dns.c trying to use struct __res_state:
perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
}

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

@ -1,10 +1,10 @@
diff -u -r ../php-5.6.16/ext/phar/Makefile.frag ./ext/phar/Makefile.frag
--- ../php-5.6.16/ext/phar/Makefile.frag 2015-11-25 15:28:38.000000000 -0500
+++ ./ext/phar/Makefile.frag 2015-12-22 05:31:09.794496317 -0500
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 @@
pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
PHP_PHARCMD_SETTINGS = -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 -d 'safe_mode=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"; \

19
packages/php/ext-posix-posix.c.patch

@ -1,13 +1,14 @@
diff -u -r ../php-5.6.15/ext/posix/posix.c ./ext/posix/posix.c
--- ../php-5.6.15/ext/posix/posix.c 2015-10-29 05:55:01.000000000 -0400
+++ ./ext/posix/posix.c 2015-11-10 15:38:41.542443608 -0500
@@ -1098,7 +1098,9 @@
add_assoc_string(return_value, "passwd", pw->pw_passwd, 1);
diff -u -r ../php-7.1.0RC3/ext/posix/posix.c ./ext/posix/posix.c
--- ../php-7.1.0RC3/ext/posix/posix.c 2016-09-28 22:15:45.000000000 -0400
+++ ./ext/posix/posix.c 2016-10-03 08:39:39.009354865 -0400
@@ -1163,7 +1163,10 @@
add_assoc_string(return_value, "passwd", pw->pw_passwd);
add_assoc_long (return_value, "uid", pw->pw_uid);
add_assoc_long (return_value, "gid", pw->pw_gid);
+#ifdef __LP64__
add_assoc_string(return_value, "gecos", pw->pw_gecos, 1);
+#if !defined(__ANDROID__) || defined(__LP64__)
+ /* Only 64-bit Android has the pw_gecos field. */
add_assoc_string(return_value, "gecos", pw->pw_gecos);
+#endif
add_assoc_string(return_value, "dir", pw->pw_dir, 1);
add_assoc_string(return_value, "shell", pw->pw_shell, 1);
add_assoc_string(return_value, "dir", pw->pw_dir);
add_assoc_string(return_value, "shell", pw->pw_shell);
return 1;

44
packages/php/ext-standard-basic_functions.c.patch

@ -1,44 +0,0 @@
diff -u -r ../php-5.6.15/ext/standard/basic_functions.c ./ext/standard/basic_functions.c
--- ../php-5.6.15/ext/standard/basic_functions.c 2015-10-29 05:55:01.000000000 -0400
+++ ./ext/standard/basic_functions.c 2015-11-10 16:01:20.858601990 -0500
@@ -1834,6 +1834,7 @@
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ password.c */
+#if HAVE_CRYPT
ZEND_BEGIN_ARG_INFO_EX(arginfo_password_hash, 0, 0, 2)
ZEND_ARG_INFO(0, password)
ZEND_ARG_INFO(0, algo)
@@ -1851,6 +1852,7 @@
ZEND_ARG_INFO(0, password)
ZEND_ARG_INFO(0, hash)
ZEND_END_ARG_INFO()
+#endif
/* }}} */
/* {{{ proc_open.c */
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
@@ -2860,12 +2862,14 @@
PHP_FE(base64_decode, arginfo_base64_decode)
PHP_FE(base64_encode, arginfo_base64_encode)
+#if HAVE_CRYPT
PHP_FE(password_hash, arginfo_password_hash)
PHP_FE(password_get_info, arginfo_password_get_info)
PHP_FE(password_needs_rehash, arginfo_password_needs_rehash)
PHP_FE(password_verify, arginfo_password_verify)
PHP_FE(convert_uuencode, arginfo_convert_uuencode)
PHP_FE(convert_uudecode, arginfo_convert_uudecode)
+#endif
PHP_FE(abs, arginfo_abs)
PHP_FE(ceil, arginfo_ceil)
@@ -3620,7 +3624,9 @@
BASIC_MINIT_SUBMODULE(browscap)
BASIC_MINIT_SUBMODULE(standard_filters)
BASIC_MINIT_SUBMODULE(user_filters)
+#if HAVE_CRYPT
BASIC_MINIT_SUBMODULE(password)
+#endif
#if defined(HAVE_LOCALECONV) && defined(ZTS)
BASIC_MINIT_SUBMODULE(localeconv)

18
packages/php/pear-Makefile.frag.patch

@ -1,8 +1,8 @@
diff -u -r ../php-5.6.15/pear/Makefile.frag ./pear/Makefile.frag
--- ../php-5.6.15/pear/Makefile.frag 2015-10-29 05:55:01.000000000 -0400
+++ ./pear/Makefile.frag 2015-11-10 16:27:03.754982330 -0500
@@ -11,7 +11,7 @@
PEAR_SUFFIX = -ds a$(program_suffix)
diff -u -r ../php-7.1.0RC3/pear/Makefile.frag ./pear/Makefile.frag
--- ../php-7.1.0RC3/pear/Makefile.frag 2016-09-28 22:15:47.000000000 -0400
+++ ./pear/Makefile.frag 2016-10-03 05:53:02.793555471 -0400
@@ -12,7 +12,7 @@
PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
install-pear-installer: $(SAPI_CLI_PATH)
- @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
@ -10,12 +10,12 @@ diff -u -r ../php-5.6.15/pear/Makefile.frag ./pear/Makefile.frag
install-pear:
@echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/"
@@ -24,7 +24,7 @@
@@ -25,7 +25,7 @@
elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
"$(FETCH)" -o $(builddir)/ http://pear.php.net/install-pear-nozlib.phar; \
"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
else \
- $(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php http://pear.php.net/install-pear-nozlib.phar $(builddir)/install-pear-nozlib.phar; \
+ php -n $(srcdir)/fetch.php http://pear.php.net/install-pear-nozlib.phar $(builddir)/install-pear-nozlib.phar; \
- $(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
+ php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
fi \
fi \
fi

Loading…
Cancel
Save