Browse Source

php7: update to 7.1.0

Adjust patches for new upstream revision.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
lilik-openwrt-22.03
Michael Heimpold 8 years ago
parent
commit
3fc9ae5071
4 changed files with 44 additions and 49 deletions
  1. +3
    -2
      lang/php7/Makefile
  2. +27
    -16
      lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch
  3. +2
    -2
      lang/php7/patches/0032-Use-system-timezone.patch
  4. +12
    -29
      lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch

+ 3
- 2
lang/php7/Makefile View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=php
PKG_VERSION:=7.0.13
PKG_VERSION:=7.1.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
@ -16,7 +16,8 @@ PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.php.net/distributions/
PKG_MD5SUM:=eb117bf1d1efc99c522f132b265a3402
PKG_MD5SUM:=cf36039303c47f493100afea522a8f53
PKG_HASH:=a810b3f29c21407c24caa88f50649320d20ba6892ae1923132598b8a0ca145b6
PKG_FIXUP:=libtool autoreconf
PKG_BUILD_PARALLEL:=1


+ 27
- 16
lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch View File

@ -1,11 +1,12 @@
From: Joe Orton <jorton@redhat.com>
Date: Sun, 18 Oct 2015 02:15:17 +0200
Date: Thu, 20 Oct 2016 11:44:14 +0200
Subject: Add support for use of the system timezone database
Add support for use of the system timezone database, rather
than embedding a copy. Discussed upstream but was not desired.
History:
r14: improve check for valid tz file
r13: adapt for upstream changes to use PHP allocator
r12: adapt for upstream changes for new zic
r11: use canonical names to avoid more case sensitivity issues
@ -25,12 +26,12 @@ r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
r2: add filesystem trawl to set up name alias index
r1: initial revision
---
ext/date/lib/parse_tz.c | 549 +++++++++++++++++++++++++++++++++++++++++++++++-
ext/date/lib/timelib.m4 | 14 ++
2 files changed, 552 insertions(+), 11 deletions(-)
ext/date/lib/parse_tz.c | 560 +++++++++++++++++++++++++++++++++++++++++++++++-
ext/date/lib/timelib.m4 | 13 ++
2 files changed, 562 insertions(+), 11 deletions(-)
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index 20d7eea..6301dc5 100644
index 20d7eea..ed7717e 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -24,6 +24,16 @@
@ -75,7 +76,7 @@ index 20d7eea..6301dc5 100644
/* read ID */
version = (*tzf)[3] - '0';
*tzf += 4;
@@ -302,7 +321,418 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
@@ -302,7 +321,429 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
@ -294,6 +295,7 @@ index 20d7eea..6301dc5 100644
+ && strcmp(ent->d_name, "posix") != 0
+ && strcmp(ent->d_name, "posixrules") != 0
+ && strcmp(ent->d_name, "right") != 0
+ && strstr(ent->d_name, ".list") == NULL
+ && strstr(ent->d_name, ".tab") == NULL;
+}
+
@ -434,8 +436,18 @@ index 20d7eea..6301dc5 100644
+
+/* Returns true if the passed-in stat structure describes a
+ * probably-valid timezone file. */
+static int is_valid_tzfile(const struct stat *st)
+static int is_valid_tzfile(const struct stat *st, int fd)
+{
+ if (fd) {
+ char buf[20];
+ if (read(fd, buf, 20)!=20) {
+ return 0;
+ }
+ lseek(fd, SEEK_SET, 0);
+ if (memcmp(buf, "TZif", 4)) {
+ return 0;
+ }
+ }
+ return S_ISREG(st->st_mode) && st->st_size > 20;
+}
+
@ -473,11 +485,11 @@ index 20d7eea..6301dc5 100644
+ }
+
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
+
+
+ fd = open(fname, O_RDONLY);
+ if (fd == -1) {
+ return NULL;
+ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
+ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) {
+ close(fd);
+ return NULL;
+ }
@ -495,7 +507,7 @@ index 20d7eea..6301dc5 100644
{
int left = 0, right = tzdb->index_size - 1;
#ifdef HAVE_SETLOCALE
@@ -341,21 +771,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
@@ -341,21 +782,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
return 0;
}
@ -577,7 +589,7 @@ index 20d7eea..6301dc5 100644
+
+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
+
+ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
+ return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0);
+ }
+#endif
+
@ -585,7 +597,7 @@ index 20d7eea..6301dc5 100644
}
static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
@@ -380,24 +877,54 @@ static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
@@ -380,24 +888,54 @@ static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
{
const unsigned char *tzf;
@ -650,13 +662,13 @@ index 20d7eea..6301dc5 100644
tmp = NULL;
}
diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
index c725572..4c837c7 100644
index 99bf9fa..4bf7e46 100644
--- a/ext/date/lib/timelib.m4
+++ b/ext/date/lib/timelib.m4
@@ -78,3 +78,17 @@ stdlib.h
@@ -78,3 +78,16 @@ stdlib.h
dnl Check for strtoll, atoll
AC_CHECK_FUNCS(strtoll atoll strftime)
AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
+
+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
+[ --with-system-tzdata[=DIR] to specify use of system timezone data],
@ -670,4 +682,3 @@ index c725572..4c837c7 100644
+ [Define for location of system timezone data])
+ fi
+fi
+

+ 2
- 2
lang/php7/patches/0032-Use-system-timezone.patch View File

@ -14,10 +14,10 @@ To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezon
1 file changed, 17 insertions(+)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index e780b2e..2b5a528 100644
index cbe6e91..1999c83 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -992,6 +992,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
@@ -1003,6 +1003,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
DATEG(timezone_valid) = 1;
return DATEG(default_timezone);
}


+ 12
- 29
lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch View File

@ -8,15 +8,14 @@ Subject: Add patch to remove build timestamps from generated binaries.
sapi/cgi/cgi_main.c | 4 ++--
sapi/cli/php_cli.c | 4 ++--
sapi/fpm/fpm/fpm_main.c | 4 ++--
sapi/litespeed/lsapi_main.c | 4 ++--
sapi/phpdbg/phpdbg.c | 4 +---
7 files changed, 12 insertions(+), 24 deletions(-)
6 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/ext/standard/info.c b/ext/standard/info.c
index e6eaac3..024e5c9 100644
index e74d6b4..883fbdf 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -863,7 +863,6 @@ PHPAPI void php_print_info(int flag)
@@ -865,7 +865,6 @@ PHPAPI void php_print_info(int flag)
php_info_print_box_end();
php_info_print_table_start();
php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
@ -51,10 +50,10 @@ index f286b1a..fba92b8 100644
case $host_alias in
*aix*)
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 8983b53..589e299 100644
index 0b6deb1..bb9014a 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2216,9 +2216,9 @@ consult the installation file that came with this distribution, or visit \n\
@@ -2342,9 +2342,9 @@ consult the installation file that came with this distribution, or visit \n\
SG(request_info).no_headers = 1;
}
#if ZEND_DEBUG
@ -67,10 +66,10 @@ index 8983b53..589e299 100644
php_request_shutdown((void *) 0);
fcgi_shutdown();
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 978c8b3..3ee61a4 100644
index dc92045..bb28364 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -682,8 +682,8 @@ static int do_cli(int argc, char **argv) /* {{{ */
@@ -690,8 +690,8 @@ static int do_cli(int argc, char **argv) /* {{{ */
goto out;
case 'v': /* show php version & quit */
@ -82,10 +81,10 @@ index 978c8b3..3ee61a4 100644
"ZTS "
#else
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 5adeb63..5e60255 100644
index 6768113..545c52e 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1757,9 +1757,9 @@ int main(int argc, char *argv[])
@@ -1756,9 +1756,9 @@ int main(int argc, char *argv[])
SG(request_info).no_headers = 1;
#if ZEND_DEBUG
@ -97,28 +96,12 @@ index 5adeb63..5e60255 100644
#endif
php_request_shutdown((void *) 0);
fcgi_shutdown();
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index b0ea105..4feb8f3 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -811,9 +811,9 @@ static int cli_main( int argc, char * argv[] )
case 'v':
if (php_request_startup() != FAILURE) {
#if ZEND_DEBUG
- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#else
- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
#endif
#ifdef PHP_OUTPUT_NEWAPI
php_output_end_all();
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 68a164c..82565d8 100644
index b47c7c8..ab94bba 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1657,10 +1657,8 @@
phpdbg_do_help(NULL);
@@ -1699,10 +1699,8 @@ phpdbg_main:
phpdbg_do_help_cmd(exec);
} else if (show_version) {
phpdbg_out(
- "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2016 The PHP Group\n%s",


Loading…
Cancel
Save