diff options
author | Remi Collet <remi@remirepo.net> | 2019-06-21 08:22:34 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-06-21 08:22:34 +0200 |
commit | ca8feee085f87a93c2d45764683b6eb8d90e8c1e (patch) | |
tree | 8d0fc1a1064a82112ae9090d78824db1b1e25d3e | |
parent | ec5584696e5bea326a79dc8f19feb2d3fa65729c (diff) |
- rebuild with libxlsxwriter 0.8.7
- open https://github.com/viest/php-ext-excel-export/pull/132 fix compatibility with 0.8.7
-rw-r--r-- | 132.patch | 65 | ||||
-rw-r--r-- | PHPINFO | 4 | ||||
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | php-pecl-xlswriter.spec | 19 |
4 files changed, 84 insertions, 6 deletions
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 <remi@remirepo.net> +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) { @@ -3,5 +3,5 @@ xlswriter xlswriter support => enabled Version => 1.2.4 -libxlsxwriter headers version => 0.8.6 -libxlsxwriter library version => 0.8.6 +libxlsxwriter headers version => 0.8.7 +libxlsxwriter library version => 0.8.7 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #177 xlswriter version 1.2.4 ] { +Extension [ <persistent> extension #175 xlswriter version 1.2.4 ] { - 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 32c2ba8..e1b7f39 100644 --- a/php-pecl-xlswriter.spec +++ b/php-pecl-xlswriter.spec @@ -25,16 +25,18 @@ %global ini_name 40-%{pecl_name}.ini # No soname, so manage dependency on available version -%global libxlsxwriter_version 0.8.3 +%global libxlsxwriter_version 0.8.7 Summary: An efficient and fast xlsx file export extension Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.2.4 -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-excel-export/pull/132.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear @@ -66,9 +68,13 @@ Obsoletes: php72u-pecl-%{pecl_name} <= %{version} Obsoletes: php72w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.3" -Obsoletes: php73u-pecl-%{pecl_name} <= %{version} +Obsoletes: php73-pecl-%{pecl_name} <= %{version} Obsoletes: php73w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.4" +Obsoletes: php74-pecl-%{pecl_name} <= %{version} +Obsoletes: php74w-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -101,6 +107,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .pr132 + # we use the system library rm -r library @@ -244,6 +252,11 @@ cd .. %changelog +* Fri Jun 21 2019 Remi Collet <remi@remirepo.net> - 1.2.4-2 +- rebuild with libxlsxwriter 0.8.7 +- open https://github.com/viest/php-ext-excel-export/pull/132 + fix compatibility with 0.8.7 + * Sat May 4 2019 Remi Collet <remi@remirepo.net> - 1.2.4-1 - update to 1.2.4 |