X-Git-Url: https://git.tld-linux.org/?p=packages%2Fphp.git;a=blobdiff_plain;f=php-systzdata.patch;h=fb696217b35187d6bf865e1f00c5b33a5661ef14;hp=4bf7be9e18ae94926f1eb088599a315986683e53;hb=HEAD;hpb=10921c9c40face7049840694288b81ba19f72436 diff --git a/php-systzdata.patch b/php-systzdata.patch index 4bf7be9..fb69621 100644 --- a/php-systzdata.patch +++ b/php-systzdata.patch @@ -5,6 +5,8 @@ Add support for use of the system timezone database, rather than embedding a copy. Discussed upstream but was not desired. History: +r21: adapt for timelib 2021.03 (in 8.1.0) +r20: adapt for timelib 2020.03 (in 8.0.10RC1) r19: adapt for timelib 2020.02 (in 8.0.0beta2) r18: adapt for autotool change in 7.3.3RC1 r17: adapt for timelib 2018.01 (in 7.3.2RC1) @@ -50,13 +52,13 @@ diff -up php-8.0.0beta3/ext/date/config0.m4.systzdata php-8.0.0beta3/ext/date/co + fi +fi + - PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" - timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c + PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" + timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/date/lib/parse_tz.c --- php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata 2020-09-01 19:13:26.000000000 +0200 +++ php-8.0.0beta3/ext/date/lib/parse_tz.c 2020-09-02 08:07:51.039979873 +0200 -@@ -26,8 +26,21 @@ +@@ -26,9 +26,22 @@ #include "timelib.h" #include "timelib_private.h" @@ -71,6 +73,7 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat + +#else #define TIMELIB_SUPPORTS_V2DATA + #define TIMELIB_SUPPORT_SLIM_FILE #include "timezonedb.h" +#endif + @@ -78,7 +81,7 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) # if defined(__LITTLE_ENDIAN__) -@@ -94,6 +107,11 @@ static int read_php_preamble(const unsig +@@ -95,6 +108,11 @@ static int read_php_preamble(const unsig { uint32_t version; @@ -90,7 +93,7 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat /* read ID */ version = (*tzf)[3] - '0'; *tzf += 4; -@@ -418,7 +436,429 @@ void timelib_dump_tzinfo(timelib_tzinfo +@@ -577,7 +595,429 @@ void timelib_dump_tzinfo(timelib_tzinfo } } @@ -521,7 +524,7 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat { int left = 0, right = tzdb->index_size - 1; -@@ -444,9 +884,48 @@ static int seek_to_tz_position(const uns +@@ -603,9 +1043,48 @@ static int seek_to_tz_position(const uns return 0; } @@ -570,7 +573,7 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat } const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count) -@@ -458,7 +937,30 @@ const timelib_tzdb_index_entry *timelib_ +@@ -617,7 +1096,30 @@ const timelib_tzdb_index_entry *timelib_ int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb) { const unsigned char *tzf; @@ -602,9 +605,27 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat } static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) -@@ -540,11 +1044,36 @@ timelib_tzinfo *timelib_parse_tzfile(con +@@ -662,6 +1164,8 @@ static timelib_tzinfo* timelib_tzinfo_ct + timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code) + { + const unsigned char *tzf; ++ char *memmap = NULL; ++ size_t maplen; + timelib_tzinfo *tmp; + int version; + int transitions_result, types_result; +@@ -669,7 +1173,7 @@ timelib_tzinfo *timelib_parse_tzfile(con + + *error_code = TIMELIB_ERROR_NO_ERROR; + +- if (seek_to_tz_position(&tzf, timezone, tzdb)) { ++ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) { + tmp = timelib_tzinfo_ctor(timezone); + + version = read_preamble(&tzf, tmp, &type); +@@ -712,11 +1216,36 @@ timelib_tzinfo *timelib_parse_tzfile(con + return NULL; } - skip_posix_string(&tzf, tmp); +#ifdef HAVE_SYSTEM_TZDATA + if (memmap) { @@ -639,23 +660,3 @@ diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/dat } else { *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE; tmp = NULL; ---- php-8.0.10/ext/date/lib/parse_tz.c.orig 2021-08-27 14:25:14.033549324 +0200 -+++ php-8.0.10/ext/date/lib/parse_tz.c 2021-08-27 14:24:27.173547016 +0200 -@@ -1019,6 +1019,8 @@ - timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code) - { - const unsigned char *tzf; -+ char *memmap = NULL; -+ size_t maplen; - timelib_tzinfo *tmp; - int version; - int transitions_result, types_result; -@@ -1026,7 +1028,7 @@ - - *error_code = TIMELIB_ERROR_NO_ERROR; - -- if (seek_to_tz_position(&tzf, timezone, tzdb)) { -+ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) { - tmp = timelib_tzinfo_ctor(timezone); - - version = read_preamble(&tzf, tmp, &type);