summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--199.patch78
-rw-r--r--PHPINFO4
-rw-r--r--REFLECTION2
-rw-r--r--php-pecl-xlswriter.spec13
4 files changed, 92 insertions, 5 deletions
diff --git a/199.patch b/199.patch
new file mode 100644
index 0000000..738ea31
--- /dev/null
+++ b/199.patch
@@ -0,0 +1,78 @@
+From dc34e4de787085ae0cbca373fb064d89c841ba05 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 18 Nov 2019 09:42:20 +0100
+Subject: [PATCH] fix compatibility with libxlsxwriter 0.8.8
+
+---
+ config.m4 | 11 +++++++++++
+ kernel/write.c | 12 ++++++++++++
+ 2 files changed, 23 insertions(+)
+
+diff --git a/config.m4 b/config.m4
+index 56c26fb..c0121a6 100644
+--- a/config.m4
++++ b/config.m4
+@@ -113,6 +113,13 @@ if test "$PHP_XLSWRITER" != "no"; then
+ ],[
+ -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
+ ])
++ PHP_CHECK_LIBRARY(xlsxwriter, lxw_fopen,
++ [
++ AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ])
++ ],[
++ ],[
++ -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
++ ])
+ fi
+
+ AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ])
+@@ -134,6 +141,10 @@ if test "$PHP_XLSWRITER" != "no"; then
+ 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
++
++ if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 808; then
++ AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ])
++ fi
+ dnl see library/CMakeLists.txt
+ LIBOPT="-DNOCRYPT -DNOUNCRYPT"
+ fi
+diff --git a/kernel/write.c b/kernel/write.c
+index 099e176..c4c7e4b 100644
+--- a/kernel/write.c
++++ b/kernel/write.c
+@@ -507,14 +507,22 @@ STATIC void
+ _prepare_drawings(lxw_workbook *self)
+ {
+ lxw_worksheet *worksheet;
++#ifdef HAVE_LXW_OPEN
++ lxw_object_properties *image_options;
++#else
+ lxw_image_options *image_options;
++#endif
+ uint16_t chart_ref_id = 0;
+ uint16_t image_ref_id = 0;
+ uint16_t drawing_id = 0;
+
+ STAILQ_FOREACH(worksheet, self->worksheets, list_pointers) {
+
++#ifdef HAVE_LXW_OPEN
++ if (STAILQ_EMPTY(worksheet->image_props)
++#else
+ if (STAILQ_EMPTY(worksheet->image_data)
++#endif
+ && STAILQ_EMPTY(worksheet->chart_data))
+ continue;
+
+@@ -534,7 +542,11 @@ _prepare_drawings(lxw_workbook *self)
+ ordered_list_pointers);
+ }
+
++#ifdef HAVE_LXW_OPEN
++ STAILQ_FOREACH(image_options, worksheet->image_props, list_pointers) {
++#else
+ STAILQ_FOREACH(image_options, worksheet->image_data, list_pointers) {
++#endif
+
+ if (image_options->image_type == LXW_IMAGE_PNG)
+ self->has_png = LXW_TRUE;
diff --git a/PHPINFO b/PHPINFO
index 89126d3..1a05be8 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -3,7 +3,7 @@ xlswriter
xlswriter support => enabled
Version => 1.3.1
-libxlsxwriter headers version => 0.8.7
-libxlsxwriter library version => 0.8.7
+libxlsxwriter headers version => 0.8.8
+libxlsxwriter library version => 0.8.8
libxlsxio headers version => 0.2.21
libxlsxio library version => 0.2.21
diff --git a/REFLECTION b/REFLECTION
index 8c0147b..e5c8eea 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #173 xlswriter version 1.3.1 ] {
+Extension [ <persistent> extension #174 xlswriter version 1.3.1 ] {
- Classes [4] {
Class [ <internal:xlswriter> class Vtiful\Kernel\Exception extends Exception implements Throwable ] {
diff --git a/php-pecl-xlswriter.spec b/php-pecl-xlswriter.spec
index f2203b3..d95c8ce 100644
--- a/php-pecl-xlswriter.spec
+++ b/php-pecl-xlswriter.spec
@@ -22,17 +22,19 @@
%global ini_name 40-%{pecl_name}.ini
# No soname, so manage dependency on available version
-%global libxlsxwriter_version 0.8.7
+%global libxlsxwriter_version 0.8.8
%global libxlsxio_version 0.2.21
Summary: An efficient and fast xlsx file export extension
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 1.3.1
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?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-xlswriter/pull/199.patch
+
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7
BuildRequires: %{?scl_prefix}php-pear
@@ -105,6 +107,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1
+
# we use the system libraries
rm -r library
@@ -250,6 +254,11 @@ cd ..
%changelog
+* Mon Nov 18 2019 Remi Collet <remi@remirepo.net> - 1.3.1-2
+- rebuild with libxlsxwriter 0.8.8
+- open https://github.com/viest/php-ext-excel-export/pull/199
+ fix compatibility with 0.8.8
+
* Sat Oct 12 2019 Remi Collet <remi@remirepo.net> - 1.3.1-1
- update to 1.3.1