From b5698ac28a8a79105edf28ffc1db19bbcbecda3a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 14 Jan 2019 15:08:42 +0100 Subject: sdext: fix build with poppler 0.73 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... which has removed Guchar, Gushort, Guint, Gulong... Change-Id: Ia54ad378031f167f6779f6ffe574b85c1e72f26d Reviewed-on: https://gerrit.libreoffice.org/66305 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 50d371ae08c66648d9f32f633b2245e1746e2bb6) Reviewed-on: https://gerrit.libreoffice.org/66363 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 4 ++-- sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | 6 +++++- sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index 9c65fc2..9432755 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -298,7 +298,7 @@ void writePpm_( OutputBuffer& o_rOutputBuf, o_rOutputBuf.resize(header_size); // initialize stream - Guchar *p; + unsigned char *p; GfxRGB rgb; std::unique_ptr imgStr( new ImageStream(str, @@ -401,7 +401,7 @@ void writeImage_( OutputBuffer& o_rOutputBuf, oneColor = { byteToCol( 0xff ), byteToCol( 0xff ), byteToCol( 0xff ) }; if( colorMap->getColorSpace()->getMode() == csIndexed || colorMap->getColorSpace()->getMode() == csDeviceGray ) { - Guchar nIndex = 0; + unsigned char nIndex = 0; colorMap->getRGB( &nIndex, &zeroColor ); nIndex = 1; colorMap->getRGB( &nIndex, &oneColor ); diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx index 37a03bc..533eb93 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx @@ -290,9 +290,13 @@ extern FILE* g_binary_out; // note: if you ever change Output_t, please keep in mind that the current code // relies on it being of 8 bit size -typedef Guchar Output_t; +typedef unsigned char Output_t; typedef std::vector< Output_t > OutputBuffer; +#if !POPPLER_CHECK_VERSION(0, 73, 0) +static_assert(std::is_same::value, "unexpected typedef"); +#endif + #endif // INCLUDED_SDEXT_SOURCE_PDFIMPORT_XPDFWRAPPER_PDFIOUTDEV_GPL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx index 44f30c0..66c1751 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx @@ -242,7 +242,7 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image // initialize stream - Guchar *p, *pm; + unsigned char *p, *pm; GfxRGB rgb; GfxGray alpha; ImageStream* imgStr = @@ -328,7 +328,7 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image // initialize stream - Guchar *p; + unsigned char *p; GfxRGB rgb; ImageStream* imgStr = new ImageStream(str, @@ -374,7 +374,7 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, { for( int x = 0; x < maskWidth; ++x ) { - Guchar aPixel = 0; + unsigned char aPixel = 0; imgStrMask->getPixel( &aPixel ); int nIndex = (y*height/maskHeight) * (width*4+1) + // mapped line (x*width/maskWidth)*4 + 1 + 3 // mapped column -- cgit v1.1 From 033ff5b3eb90deaf6fd5eb8a74100233aa5fe772 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 14 Jan 2019 15:12:24 +0100 Subject: poppler: upgrade to release 0.73.0 Change-Id: If20998f8565b5534a96b3f29ccec572273edca1d Reviewed-on: https://gerrit.libreoffice.org/66306 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 0609ea4fc27f34367716bf41c0cdaa7785aed9da) Reviewed-on: https://gerrit.libreoffice.org/66369 Reviewed-by: Christian Lohmaier --- download.lst | 4 +-- external/poppler/StaticLibrary_poppler.mk | 6 +---- external/poppler/UnpackedTarball_poppler.mk | 11 ++++++++ external/poppler/poppler-c++11.patch.1 | 31 ++++++++++++++++++++++ external/poppler/poppler-config.patch.1 | 12 ++++----- .../pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | 1 + 6 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 external/poppler/poppler-c++11.patch.1 diff --git a/download.lst b/download.lst index 636ae69..3b526c2 100644 --- a/download.lst +++ b/download.lst @@ -206,8 +206,8 @@ export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz export LIBPNG_SHA256SUM := 2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6 export LIBPNG_TARBALL := libpng-1.6.34.tar.xz -export POPPLER_SHA256SUM := 2c096431adfb74bc2f53be466889b7646e1b599f28fa036094f3f7235cc9eae7 -export POPPLER_TARBALL := poppler-0.66.0.tar.xz +export POPPLER_SHA256SUM := e44b5543903128884ba4538c2a97d3bcc8889e97ffacc4636112101f0238db03 +export POPPLER_TARBALL := poppler-0.73.0.tar.xz export POSTGRESQL_SHA256SUM := db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461 export POSTGRESQL_TARBALL := c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2 export PYTHON_SHA256SUM := 063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009 diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk index f145b7a..aa5ed69 100644 --- a/external/poppler/StaticLibrary_poppler.mk +++ b/external/poppler/StaticLibrary_poppler.mk @@ -53,11 +53,8 @@ $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,poppler,cc)) $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/goo/gfile \ - UnpackedTarball/poppler/goo/gmempp \ - UnpackedTarball/poppler/goo/GooList \ UnpackedTarball/poppler/goo/GooTimer \ UnpackedTarball/poppler/goo/GooString \ - UnpackedTarball/poppler/goo/gmem \ UnpackedTarball/poppler/goo/FixedPoint \ UnpackedTarball/poppler/goo/NetPBMWriter \ UnpackedTarball/poppler/goo/PNGWriter \ @@ -80,6 +77,7 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/BuiltinFontTables \ UnpackedTarball/poppler/poppler/CachedFile \ UnpackedTarball/poppler/poppler/Catalog \ + UnpackedTarball/poppler/poppler/CertificateInfo \ UnpackedTarball/poppler/poppler/CharCodeToUnicode \ UnpackedTarball/poppler/poppler/CMap \ UnpackedTarball/poppler/poppler/DateInfo \ @@ -114,7 +112,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/PDFDoc \ UnpackedTarball/poppler/poppler/PDFDocEncoding \ UnpackedTarball/poppler/poppler/PDFDocFactory \ - UnpackedTarball/poppler/poppler/PopplerCache \ UnpackedTarball/poppler/poppler/ProfileData \ UnpackedTarball/poppler/poppler/PreScanOutputDev \ UnpackedTarball/poppler/poppler/PSTokenizer \ @@ -135,7 +132,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/StdinPDFDocBuilder \ UnpackedTarball/poppler/poppler/Sound \ UnpackedTarball/poppler/poppler/ViewerPreferences \ - UnpackedTarball/poppler/poppler/XpdfPluginAPI \ UnpackedTarball/poppler/poppler/Movie \ UnpackedTarball/poppler/poppler/Rendition \ UnpackedTarball/poppler/poppler/DCTStream \ diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index 68fd06d..5b91e16 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -13,6 +13,17 @@ $(eval $(call gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ external/poppler/poppler-config.patch.1 \ + external/poppler/poppler-c++11.patch.1 \ )) +# std::make_unique is only available in C++14 +# use "env -i" to avoid Cygwin "environment is too large for exec" +# Mac OS X sed says "sed: RE error: illegal byte sequence"; Apple clang should +# be happy with std::make_unique so just skip it +ifneq ($(OS_FOR_BUILD),MACOSX) +$(eval $(call gb_UnpackedTarball_set_post_action,poppler,\ + env -i PATH="$(PATH)" $(FIND) . -name '*.cc' -exec sed -i -e 's/std::make_unique/o3tl::make_unique/' {} \\; \ +)) +endif + # vim: set noet sw=4 ts=4: diff --git a/external/poppler/poppler-c++11.patch.1 b/external/poppler/poppler-c++11.patch.1 new file mode 100644 index 0000000..5a4d1a2 --- /dev/null +++ b/external/poppler/poppler-c++11.patch.1 @@ -0,0 +1,31 @@ +remove usage of newfangled C++ that baseline toolchains don't support + +--- poppler/goo/gfile.cc.orig 2019-01-16 11:02:21.112911552 +0100 ++++ poppler/goo/gfile.cc 2019-01-16 11:01:33.125975178 +0100 +@@ -67,7 +67,7 @@ + + #ifndef _WIN32 + +-using namespace std::string_literals; ++//using namespace std::string_literals; + + namespace { + +@@ -366,7 +366,7 @@ + } + #else + // First try to atomically open the file with CLOEXEC +- const std::string modeStr = mode + "e"s; ++ const std::string modeStr = mode + std::string("e"); + FILE *file = fopen(path, modeStr.c_str()); + if (file != nullptr) + return file; +--- poppler/goo/gmem.h.orig 2019-01-16 11:25:28.161920038 +0100 ++++ poppler/goo/gmem.h 2019-01-16 11:25:53.756882295 +0100 +@@ -177,4 +177,6 @@ + return std::strncpy(r, s, n); + } + ++#include ++ + #endif // GMEM_H diff --git a/external/poppler/poppler-config.patch.1 b/external/poppler/poppler-config.patch.1 index 5328e68..e312573 100644 --- a/external/poppler/poppler-config.patch.1 +++ b/external/poppler/poppler-config.patch.1 @@ -195,7 +195,7 @@ index 0fbd336a..451213f8 100644 +#define PACKAGE_NAME "poppler" + +/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "poppler 0.66.0" ++#define PACKAGE_STRING "poppler 0.73.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "poppler" @@ -204,7 +204,7 @@ index 0fbd336a..451213f8 100644 +#define PACKAGE_URL "" + +/* Define to the version of this package. */ -+#define PACKAGE_VERSION "0.66.0" ++#define PACKAGE_VERSION "0.73.0" + +/* Poppler data dir */ +#define POPPLER_DATADIR "/usr/local/share/poppler" @@ -228,7 +228,7 @@ index 0fbd336a..451213f8 100644 +/* #undef USE_FLOAT */ + +/* Version number of package */ -+#define VERSION "0.66.0" ++#define VERSION "0.73.0" + +#if defined(__APPLE__) +#elif defined (_WIN32) @@ -304,7 +304,7 @@ index 0fbd336a..451213f8 100644 + +/* Defines the poppler version. */ +#ifndef POPPLER_VERSION -+#define POPPLER_VERSION "0.66.0" ++#define POPPLER_VERSION "0.73.0" +#endif + +/* Enable multithreading support. */ @@ -466,9 +466,9 @@ index 0fbd336a..451213f8 100644 + +#include "poppler-global.h" + -+#define POPPLER_VERSION "0.66.0" ++#define POPPLER_VERSION "0.73.0" +#define POPPLER_VERSION_MAJOR 0 -+#define POPPLER_VERSION_MINOR 66 ++#define POPPLER_VERSION_MINOR 73 +#define POPPLER_VERSION_MICRO 0 + +namespace poppler diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx index 533eb93..ced1a65 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx @@ -30,6 +30,7 @@ #elif defined _MSC_VER #pragma warning(push) #pragma warning(disable : 4100) // unreferenced formal parameter +#pragma warning(disable : 4310) // cast truncates constant value #endif #include -- cgit v1.1