diff options
author | Remi Collet <remi@remirepo.net> | 2019-09-06 17:58:11 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-09-06 17:58:11 +0200 |
commit | c933556c0db9ba79b5f8a07d546a0c712aa79549 (patch) | |
tree | b87f0786675189f8ed96966965e6491b8727653e | |
parent | 5b3d8f1973662218ba5b83c65fbe5fff1bbabd40 (diff) |
- enable the reader
- add patch to fix config.m4 from
https://github.com/viest/php-ext-excel-export/pull/158
-rw-r--r-- | 158.patch | 85 | ||||
-rw-r--r-- | REFLECTION | 22 | ||||
-rw-r--r-- | php-pecl-xlswriter.spec | 19 |
3 files changed, 123 insertions, 3 deletions
diff --git a/158.patch b/158.patch new file mode 100644 index 0000000..024cba5 --- /dev/null +++ b/158.patch @@ -0,0 +1,85 @@ +From f44f4196ba504b5a096e4ded2baae5a7751bdd84 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 6 Sep 2019 17:41:25 +0200 +Subject: [PATCH] fix config to allow to enable the reader when using system + libxlswriter + +--- + config.m4 | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +diff --git a/config.m4 b/config.m4 +index 7bf2d53..f0a6851 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -1,4 +1,4 @@ +-PHP_ARG_WITH(xlsxwriter, xlswriter support, ++PHP_ARG_WITH(xlswriter, xlswriter support, + [ --with-xlswriter Include xlswriter support], yes) + + PHP_ARG_WITH(libxlsxwriter, system libxlsswriter, +@@ -23,11 +23,14 @@ if test "$PHP_XLSWRITER" != "no"; then + kernel/read.c \ + " + +- libxlsxwriter_sources=" ++ minizip_sources=" + library/libxlsxwriter/third_party/minizip/ioapi.c \ + library/libxlsxwriter/third_party/minizip/mztools.c \ + library/libxlsxwriter/third_party/minizip/unzip.c \ + library/libxlsxwriter/third_party/minizip/zip.c \ ++ " ++ ++ libxlsxwriter_sources=" + library/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c \ + library/libxlsxwriter/src/app.c \ + library/libxlsxwriter/src/chart.c \ +@@ -111,7 +114,7 @@ if test "$PHP_XLSWRITER" != "no"; then + AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ]) + else + AC_MSG_RESULT([use the bundled library]) +- xls_writer_sources="$xls_writer_sources $libxlsxwriter_sources" ++ xls_writer_sources="$xls_writer_sources $libxlsxwriter_sources $minizip_sources" + PHP_ADD_INCLUDE([$srcdir/library/libxlsxwriter/include]) + + XLSXWRITER_VERSION=`$EGREP "define LXW_VERSION" $srcdir/library/include/libxlsxwriter/xlsxwriter.h | $SED -e 's/[[^0-9\.]]//g'` +@@ -132,18 +135,18 @@ if test "$PHP_XLSWRITER" != "no"; then + fi + + if test "$PHP_READER" = "yes"; then +- xls_writer_sources="$xls_writer_sources $xls_read_sources" ++ xls_writer_sources="$xls_writer_sources $xls_read_sources $minizip_sources" + + AC_DEFINE(ENABLE_READER, 1, [enable reader]) + + xls_writer_sources="$xls_writer_sources $libexpat" + PHP_ADD_INCLUDE([$srcdir/library/libexpat/expat/lib]) +- PHP_ADD_BUILD_DIR([$ext_builddir/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([$ext_builddir/library/libxlsxio/lib]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib]) + LIBOPT="$LIBOPT -DUSE_MINIZIP" + fi + +@@ -158,11 +161,11 @@ if test "$PHP_XLSWRITER" != "no"; then + PHP_ADD_INCLUDE([$srcdir]) + PHP_ADD_INCLUDE([$srcdir/include]) + +- PHP_ADD_BUILD_DIR([$ext_builddir/kernel]) +- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxwriter/src]) +- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxwriter/third_party/minizip]) +- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxwriter/third_party/tmpfileplus]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/kernel]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/src]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/third_party/minizip]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/third_party/tmpfileplus]) + +- PHP_ADD_BUILD_DIR([$ext_builddir/library/libexpat/expat/lib]) +- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxio/lib]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib]) ++ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib]) + fi @@ -74,7 +74,7 @@ Extension [ <persistent> extension #173 xlswriter version 1.2.7 ] { Property [ <default> private $fileName ] } - - Methods [18] { + - Methods [22] { Method [ <internal:xlswriter, ctor> public method __construct ] { - Parameters [1] { @@ -214,6 +214,26 @@ Extension [ <persistent> extension #173 xlswriter version 1.2.7 ] { Parameter #2 [ <required> $height ] } } + + Method [ <internal:xlswriter> public method openFile ] { + + - Parameters [1] { + Parameter #0 [ <required> $zs_file_name ] + } + } + + Method [ <internal:xlswriter> public method openSheet ] { + + - Parameters [1] { + Parameter #0 [ <required> $zs_sheet_name ] + } + } + + Method [ <internal:xlswriter> public method getSheetData ] { + } + + Method [ <internal:xlswriter> public method nextRow ] { + } } } diff --git a/php-pecl-xlswriter.spec b/php-pecl-xlswriter.spec index 65008bb..18459b3 100644 --- a/php-pecl-xlswriter.spec +++ b/php-pecl-xlswriter.spec @@ -7,6 +7,8 @@ # Please, preserve the changelog entries # +# TODO unbundle libxlsxio + # we don't want -z defs linker flag %undefine _strict_symbol_defs_build @@ -27,11 +29,13 @@ Summary: An efficient and fast xlsx file export extension Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.2.7 -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/158.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear @@ -103,7 +107,8 @@ sed -e 's/role="test"/role="src"/' \ cd NTS # we use the system library -rm -r library +rm -r library/libxlsxwriter/src +%patch0 -p1 -b .pr158 # Sanity check, really often broken extver=$(sed -n '/#define PHP_XLSWRITER_VERSION/{s/.* "//;s/".*$//;p}' php_xlswriter.h) @@ -132,6 +137,11 @@ peclbuild() { %configure \ --with-xlswriter \ --with-libxlsxwriter=%{_prefix} \ +%if 0%{?rhel} == 6 + --disable-reader \ +%else + --enable-reader \ +%endif --with-php-config=$1 make %{?_smp_mflags} @@ -245,6 +255,11 @@ cd .. %changelog +* Fri Sep 6 2019 Remi Collet <remi@remirepo.net> - 1.2.7-2 +- enable the reader +- add patch to fix config.m4 from + https://github.com/viest/php-ext-excel-export/pull/158 + * Fri Sep 6 2019 Remi Collet <remi@remirepo.net> - 1.2.7-1 - update to 1.2.7 |