From a079bb263323bc3315711529ee3b78a3b3609899 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 20 Sep 2019 09:05:54 +0200 Subject: - update to 1.2.9 - drop patch merged upstream - add fix for 32-bit build from https://github.com/viest/php-ext-excel-export/pull/173 https://github.com/viest/php-ext-excel-export/pull/174 --- 165.patch | 137 ------------------------------------------------ 173.patch | 29 ++++++++++ 174.patch | 21 ++++++++ PHPINFO | 2 +- REFLECTION | 27 ++++++++-- php-pecl-xlswriter.spec | 17 ++++-- 6 files changed, 87 insertions(+), 146 deletions(-) delete mode 100644 165.patch create mode 100644 173.patch create mode 100644 174.patch diff --git a/165.patch b/165.patch deleted file mode 100644 index 49f98da..0000000 --- a/165.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 8139123b63f5a7885466e5450aba502f77a9a592 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 16 Sep 2019 12:04:08 +0200 -Subject: [PATCH 1/2] allow to build with system libxlsxio - ---- - config.m4 | 61 ++++++++++++++++++++++++++++++++++++++++++------------- - 1 file changed, 47 insertions(+), 14 deletions(-) - -diff --git a/config.m4 b/config.m4 -index 2c5f9be..f3fb280 100644 ---- a/config.m4 -+++ b/config.m4 -@@ -1,8 +1,11 @@ - PHP_ARG_WITH(xlswriter, xlswriter support, --[ --with-xlswriter Include xlswriter support], yes) -+[ --with-xlswriter Include xlswriter support], yes) - --PHP_ARG_WITH(libxlsxwriter, system libxlsswriter, --[ --with-libxlsxwriter=DIR Use system library], no, no) -+PHP_ARG_WITH(libxlsxwriter, system libxlsxwriter, -+[ --with-libxlsxwriter=DIR Use system libxlsxwriter], no, no) -+ -+PHP_ARG_WITH(libxlsxio, system libxlsxio, -+[ --with-libxlsxio=DIR Use system libxlsxio], no, no) - - PHP_ARG_ENABLE(reader, enable xlsx reader support, - [ --enable-reader Enable xlsx reader?], no, no) -@@ -135,22 +138,52 @@ if test "$PHP_XLSWRITER" != "no"; then - fi - - if test "$PHP_READER" = "yes"; then -- xls_writer_sources="$xls_writer_sources $xls_read_sources" -+ AC_MSG_CHECKING([Check libxlsxwriter library]) -+ if test "$PHP_LIBXLSXIO" != "no"; then -+ -+ for i in $PHP_LIBXLSXIO /usr/local /usr; do -+ if test -r $i/include/xlsxio_read.h; then -+ XLSXIO_DIR=$i -+ AC_MSG_RESULT([found in $i]) -+ break -+ fi -+ done -+ -+ if test -z "$XLSXIO_DIR"; then -+ AC_MSG_ERROR([libxlsxio library not found]) -+ else -+ PHP_ADD_INCLUDE($XLSXIO_DIR/include) -+ PHP_CHECK_LIBRARY(xlsxio_read, xlsxioread_sheet_open, -+ [ -+ PHP_ADD_LIBRARY_WITH_PATH(xlsxio_read, $i/$PHP_LIBDIR, XLSWRITER_SHARED_LIBADD) -+ ],[ -+ AC_MSG_ERROR([Wrong libxlsxio version or library not found]) -+ ],[ -+ -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm -+ ]) -+ fi - -- AC_DEFINE(ENABLE_READER, 1, [enable reader]) -+ AC_DEFINE(HAVE_LIBXLSXIO, 1, [ use system libxlsxwriter ]) -+ else -+ AC_MSG_RESULT([use the bundled library]) - -- xls_writer_sources="$xls_writer_sources $libexpat" -- PHP_ADD_INCLUDE([$srcdir/library/libexpat/expat/lib]) -- PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib]) -- LIBOPT="$LIBOPT -DXML_POOR_ENTROPY" -+ xls_writer_sources="$xls_writer_sources $libexpat" -+ PHP_ADD_INCLUDE([$srcdir/library/libexpat/expat/lib]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib]) -+ LIBOPT="$LIBOPT -DXML_POOR_ENTROPY" - -- xls_writer_sources="$xls_writer_sources $libxlsxio" -- PHP_ADD_INCLUDE([$srcdir/library/libxlsxio/include]) -- PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib]) -- LIBOPT="$LIBOPT -DUSE_MINIZIP" -+ xls_writer_sources="$xls_writer_sources $libxlsxio" -+ PHP_ADD_INCLUDE([$srcdir/library/libxlsxio/include]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib]) -+ LIBOPT="$LIBOPT -DUSE_MINIZIP" -+ -+ fi -+ -+ xls_writer_sources="$xls_writer_sources $xls_read_sources" -+ AC_DEFINE(ENABLE_READER, 1, [enable reader]) - fi - -- if test "$PHP_READER" = "yes" || test "$PHP_LIBXLSXWRITER" = "no"; then -+ if test "$PHP_LIBXLSXIO" = "no" || test "$PHP_LIBXLSXWRITER" = "no"; then - xls_writer_sources="$xls_writer_sources $minizip_sources" - fi - - -From feb5b1a4c963d06ee70ab3eb74401160ccc201e1 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 16 Sep 2019 12:04:21 +0200 -Subject: [PATCH 2/2] report libxlsxio in phpinfo - ---- - xlswriter.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/xlswriter.c b/xlswriter.c -index 8faa7f6..7b223c3 100644 ---- a/xlswriter.c -+++ b/xlswriter.c -@@ -18,6 +18,11 @@ - #include "ext/standard/info.h" - #include "xlswriter.h" - -+#if ENABLE_READER -+#include -+#include -+#endif -+ - int le_xls_writer; - - /* {{{ PHP_MINIT_FUNCTION -@@ -85,6 +90,18 @@ PHP_MINFO_FUNCTION(xlswriter) - php_info_print_table_row(2, "bundled libxlsxwriter version", LXW_VERSION); - #endif - #endif -+ -+#if ENABLE_READER -+#if HAVE_LIBXLSXIO -+ /* Build time */ -+ php_info_print_table_row(2, "libxlsxio headers version", XLSXIO_VERSION_STRING); -+ /* Run time */ -+ php_info_print_table_row(2, "libxlsxio library version", xlsxioread_get_version_string()); -+#else -+ php_info_print_table_row(2, "bundled libxlsxio version", XLSXIO_VERSION_STRING); -+#endif -+#endif -+ - php_info_print_table_end(); - } - /* }}} */ diff --git a/173.patch b/173.patch new file mode 100644 index 0000000..ee1071f --- /dev/null +++ b/173.patch @@ -0,0 +1,29 @@ +From a30311cd401221eef7be3bc5b25bf247a134383e Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 20 Sep 2019 08:08:28 +0200 +Subject: [PATCH] fix stack mashing using proper format + +--- + kernel/read.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/kernel/read.c b/kernel/read.c +index cd28916..18d66a6 100644 +--- a/kernel/read.c ++++ b/kernel/read.c +@@ -96,7 +96,7 @@ void data_to_custom_type(const char *string_value, zend_ulong type, zval *zv_res + + zend_long _long_value; + +- sscanf(string_value, "%" PRIi64, &_long_value); ++ sscanf(string_value, ZEND_LONG_FMT, &_long_value); + + if (Z_TYPE_P(zv_result_t) == IS_ARRAY) { + add_next_index_long(zv_result_t, _long_value); +@@ -268,4 +268,4 @@ void load_sheet_all_data(xlsxioreadersheet sheet_t, zval *zv_type_t, zval *zv_re + add_next_index_zval(zv_result_t, &_zv_tmp_row); + } + } +-/* }}} */ +\ No newline at end of file ++/* }}} */ diff --git a/174.patch b/174.patch new file mode 100644 index 0000000..ec1355a --- /dev/null +++ b/174.patch @@ -0,0 +1,21 @@ +From 3a075e77c614c2b701a359ff0eb651fbb529b51e Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 20 Sep 2019 08:47:16 +0200 +Subject: [PATCH] add missing init + +--- + kernel/read.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/read.c b/kernel/read.c +index 18d66a6..a272fee 100644 +--- a/kernel/read.c ++++ b/kernel/read.c +@@ -229,6 +229,7 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba + } + } + ++ ZVAL_NULL(&args[2]); + data_to_custom_type(value, _type, &args[2]); + } + diff --git a/PHPINFO b/PHPINFO index 3062dc3..d1d55da 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,7 +2,7 @@ xlswriter xlswriter support => enabled -Version => 1.2.8 +Version => 1.2.9 libxlsxwriter headers version => 0.8.7 libxlsxwriter library version => 0.8.7 libxlsxio headers version => 0.2.21 diff --git a/REFLECTION b/REFLECTION index b9dab38..354a197 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #173 xlswriter version 1.2.8 ] { +Extension [ extension #173 xlswriter version 1.2.9 ] { - Classes [4] { Class [ class Vtiful\Kernel\Exception extends Exception implements Throwable ] { @@ -60,7 +60,10 @@ Extension [ extension #173 xlswriter version 1.2.8 ] { Class [ class Vtiful\Kernel\Excel ] { - - Constants [4] { + - Constants [7] { + Constant [ public integer SKIP_NONE ] { 0 } + Constant [ public integer SKIP_EMPTY_ROW ] { 1 } + Constant [ public integer SKIP_EMPTY_CELLS ] { 2 } Constant [ public integer TYPE_INT ] { 2 } Constant [ public integer TYPE_DOUBLE ] { 4 } Constant [ public integer TYPE_STRING ] { 1 } @@ -73,12 +76,13 @@ Extension [ extension #173 xlswriter version 1.2.8 ] { - Static methods [0] { } - - Properties [2] { + - Properties [3] { Property [ private $config ] Property [ private $fileName ] + Property [ private $read_row_type ] } - - Methods [23] { + - Methods [25] { Method [ public method __construct ] { - Parameters [1] { @@ -244,11 +248,26 @@ Extension [ extension #173 xlswriter version 1.2.8 ] { } } + Method [ public method setType ] { + + - Parameters [1] { + Parameter #0 [ $zv_type_t ] + } + } + Method [ public method getSheetData ] { } Method [ public method nextRow ] { } + + Method [ public method nextCellCallback ] { + + - Parameters [2] { + Parameter #0 [ $fci ] + Parameter #1 [ $sheet_name ] + } + } } } diff --git a/php-pecl-xlswriter.spec b/php-pecl-xlswriter.spec index 3fb09cc..ab6a284 100644 --- a/php-pecl-xlswriter.spec +++ b/php-pecl-xlswriter.spec @@ -29,13 +29,14 @@ Summary: An efficient and fast xlsx file export extension Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 1.2.8 -Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 1.2.9 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -Patch0: https://patch-diff.githubusercontent.com/raw/viest/php-ext-excel-export/pull/165.patch +Patch0: https://patch-diff.githubusercontent.com/raw/viest/php-ext-excel-export/pull/173.patch +Patch1: https://patch-diff.githubusercontent.com/raw/viest/php-ext-excel-export/pull/174.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 @@ -111,7 +112,8 @@ sed -e 's/role="test"/role="src"/' \ cd NTS # we use the system libraries rm -r library -%patch0 -p1 +%patch0 -p1 -b .pr173 +%patch1 -p1 -b .pr174 # Sanity check, really often broken extver=$(sed -n '/#define PHP_XLSWRITER_VERSION/{s/.* "//;s/".*$//;p}' php_xlswriter.h) @@ -255,6 +257,13 @@ cd .. %changelog +* Fri Sep 20 2019 Remi Collet - 1.2.9-1 +- update to 1.2.9 +- drop patch merged upstream +- add fix for 32-bit build from + https://github.com/viest/php-ext-excel-export/pull/173 + https://github.com/viest/php-ext-excel-export/pull/174 + * Mon Sep 16 2019 Remi Collet - 1.2.8-4 - build with system libxlsxio using patch from https://github.com/viest/php-ext-excel-export/pull/165 -- cgit