From ca8feee085f87a93c2d45764683b6eb8d90e8c1e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 21 Jun 2019 08:22:34 +0200 Subject: - rebuild with libxlsxwriter 0.8.7 - open https://github.com/viest/php-ext-excel-export/pull/132 fix compatibility with 0.8.7 --- 132.patch | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 132.patch (limited to '132.patch') diff --git a/132.patch b/132.patch new file mode 100644 index 0000000..0a710be --- /dev/null +++ b/132.patch @@ -0,0 +1,65 @@ +From b29ad600d416d157486035e71c94b127e6a6fb27 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 21 Jun 2019 08:08:33 +0200 +Subject: [PATCH] fix compatibility with 0.8.7 + +--- + config.m4 | 13 ++++++++++++- + kernel/write.c | 5 +++++ + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/config.m4 b/config.m4 +index 0519129..0d0b379 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -76,6 +76,13 @@ if test "$PHP_XLSWRITER" != "no"; then + ],[ + -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm + ]) ++ PHP_CHECK_LIBRARY(xlsxwriter, workbook_add_vba_project, ++ [ ++ AC_DEFINE(HAVE_WORKBOOK_ADD_VBA_PROJECT, 1, [ workbook_add_vba_project available in 0.8.7 ]) ++ ],[ ++ ],[ ++ -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm ++ ]) + fi + AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ]) + else +@@ -85,13 +92,17 @@ if test "$PHP_XLSWRITER" != "no"; then + + XLSXWRITER_VERSION=`$EGREP "define LXW_VERSION" $srcdir/library/include/xlsxwriter.h | $SED -e 's/[[^0-9\.]]//g'` + +- if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 800; then ++ if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 709; then + AC_DEFINE(HAVE_LXW_VERSION, 1, [ lxw_version available in 0.7.9 ]) + fi + + if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 800; then + AC_DEFINE(HAVE_LXW_CHARTSHEET_NEW, 1, [ lxw_chartsheet_new available in 0.8.0 ]) + fi ++ ++ if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 807; then ++ AC_DEFINE(HAVE_WORKBOOK_ADD_VBA_PROJECT, 1, [ workbook_add_vba_project available in 0.8.7 ]) ++ fi + fi + + if test -z "$PHP_DEBUG"; then +diff --git a/kernel/write.c b/kernel/write.c +index 975c666..ab365f9 100644 +--- a/kernel/write.c ++++ b/kernel/write.c +@@ -159,8 +159,13 @@ workbook_file(xls_resource_t *self) + /* Add cached data to charts. */ + _add_chart_cache_data(self->workbook); + ++/* ugly test, new param (use_zip_64) was added in 0.8.7 with workbook_add_vba_project */ ++#ifdef HAVE_WORKBOOK_ADD_VBA_PROJECT + /* Create a packager object to assemble sub-elements into a zip file. */ ++ packager = lxw_packager_new(self->workbook->filename, self->workbook->options.tmpdir, 0); ++#else + packager = lxw_packager_new(self->workbook->filename, self->workbook->options.tmpdir); ++#endif + + /* If the packager fails it is generally due to a zip permission error. */ + if (packager == NULL) { -- cgit