diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2019-01-12 17:27:11 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2019-01-12 21:07:04 +0100 |
commit | 864b528b1db3f4e946a21c7badac1448f13feaea (patch) | |
tree | ef838317bb70fdeca18b43e764c65520622fd49b /sci-libs/gdal/files | |
parent | profiles: arm: Drop obsolete sci-chemistry/gromacs[mpi] stable mask (diff) | |
download | gentoo-864b528b1db3f4e946a21c7badac1448f13feaea.tar.gz gentoo-864b528b1db3f4e946a21c7badac1448f13feaea.tar.bz2 gentoo-864b528b1db3f4e946a21c7badac1448f13feaea.zip |
sci-libs/gdal: Fix build with poppler-0.71 and poppler-0.72
Bug: https://bugs.gentoo.org/674556
Package-Manager: Portage-2.3.55, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'sci-libs/gdal/files')
-rw-r--r-- | sci-libs/gdal/files/gdal-2.3.1-poppler-0.71.0.patch | 82 | ||||
-rw-r--r-- | sci-libs/gdal/files/gdal-2.3.1-poppler-0.72.0.patch | 58 |
2 files changed, 140 insertions, 0 deletions
diff --git a/sci-libs/gdal/files/gdal-2.3.1-poppler-0.71.0.patch b/sci-libs/gdal/files/gdal-2.3.1-poppler-0.71.0.patch new file mode 100644 index 000000000000..90ee94d06216 --- /dev/null +++ b/sci-libs/gdal/files/gdal-2.3.1-poppler-0.71.0.patch @@ -0,0 +1,82 @@ +Description: Add support for Poppler 0.71.0. +Author: Even Rouault <even.rouault@spatialys.com> +Origin: https://github.com/OSGeo/gdal/commit/4cc0215b8f2cef3582265cdfaf16589390697706 +Bug: https://github.com/OSGeo/gdal/issues/1121 +Bug-Debian: https://bugs.debian.org/915722 + +--- a/frmts/pdf/pdfdataset.cpp ++++ b/frmts/pdf/pdfdataset.cpp +@@ -2593,18 +2593,25 @@ static void PDFDatasetErrorFunctionCommo + } + + #ifdef POPPLER_0_20_OR_LATER +-static void PDFDatasetErrorFunction(CPL_UNUSED void* userData, CPL_UNUSED ErrorCategory eErrCategory, ++ ++static void PDFDatasetErrorFunction(void* /* userData*/, ++ ErrorCategory /* eErrCategory */, + #ifdef POPPLER_0_23_OR_LATER + Goffset nPos, + #else + int nPos, + #endif +- char *pszMsg) ++#ifdef POPPLER_0_71_OR_LATER ++ const char *pszMsg ++#else ++ char *pszMsg ++#endif ++ ) + { + CPLString osError; + + if (nPos >= 0) +- osError.Printf("Pos = %d, ", (int)nPos); ++ osError.Printf("Pos = " CPL_FRMT_GUIB ", ", static_cast<GUIntBig>(nPos)); + osError += pszMsg; + PDFDatasetErrorFunctionCommon(osError); + } +@@ -4442,7 +4449,7 @@ GDALDataset *PDFDataset::Open( GDALOpenI + #ifdef HAVE_POPPLER + if (bUseLib.test(PDFLIB_POPPLER)) + { +- PDFRectangle* psMediaBox = poPagePoppler->getMediaBox(); ++ const auto* psMediaBox = poPagePoppler->getMediaBox(); + dfX1 = psMediaBox->x1; + dfY1 = psMediaBox->y1; + dfX2 = psMediaBox->x2; +@@ -4780,14 +4787,12 @@ GDALDataset *PDFDataset::Open( GDALOpenI + GooString* poMetadata = poCatalogPoppler->readMetadata(); + if (poMetadata) + { +- char* pszContent = poMetadata->getCString(); ++ const char* pszContent = poMetadata->getCString(); + if (pszContent != nullptr && + STARTS_WITH(pszContent, "<?xpacket begin=")) + { +- char *apszMDList[2]; +- apszMDList[0] = pszContent; +- apszMDList[1] = nullptr; +- poDS->SetMetadata(apszMDList, "xml:XMP"); ++ const char * const apszMDList[2] = { pszContent, nullptr }; ++ poDS->SetMetadata(const_cast<char**>(apszMDList), "xml:XMP"); + } + delete poMetadata; + } +--- a/frmts/pdf/pdfio.h ++++ b/frmts/pdf/pdfio.h +@@ -58,6 +58,15 @@ + #define makeSubStream_object_type Object* + #endif + ++// Detect Poppler 0.71 that no longer defines GBool ++#ifdef POPPLER_0_69_OR_LATER ++#ifndef initObj ++#define POPPLER_0_71_OR_LATER ++#define GBool bool ++#define gFalse false ++#endif ++#endif ++ + class VSIPDFFileStream: public BaseStream + { + public: diff --git a/sci-libs/gdal/files/gdal-2.3.1-poppler-0.72.0.patch b/sci-libs/gdal/files/gdal-2.3.1-poppler-0.72.0.patch new file mode 100644 index 000000000000..3302df9100df --- /dev/null +++ b/sci-libs/gdal/files/gdal-2.3.1-poppler-0.72.0.patch @@ -0,0 +1,58 @@ +From b471814ef406582f2b1bc0aabbe430c0026608c7 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com> +Date: Sat, 12 Jan 2019 17:21:54 +0100 +Subject: [PATCH] Fix build with poppler-0.72.0 + +Non-upstreamable patch that breaks backward compatibility. +--- + frmts/pdf/pdfdataset.cpp | 4 ++-- + frmts/pdf/pdfobject.cpp | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp +index 84fe1fe..38b8c30 100644 +--- a/frmts/pdf/pdfdataset.cpp ++++ b/frmts/pdf/pdfdataset.cpp +@@ -3459,7 +3459,7 @@ void PDFDataset::FindLayersPoppler() + #endif + if( ocg != nullptr && ocg->getName() != nullptr ) + { +- const char* pszLayerName = (const char*)ocg->getName()->getCString(); ++ const char* pszLayerName = (const char*)ocg->getName()->c_str(); + AddLayer(pszLayerName); + oLayerOCGMapPoppler[pszLayerName] = ocg; + } +@@ -4787,7 +4787,7 @@ GDALDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo ) + GooString* poMetadata = poCatalogPoppler->readMetadata(); + if (poMetadata) + { +- const char* pszContent = poMetadata->getCString(); ++ const char* pszContent = poMetadata->c_str(); + if (pszContent != nullptr && + STARTS_WITH(pszContent, "<?xpacket begin=")) + { +diff --git a/frmts/pdf/pdfobject.cpp b/frmts/pdf/pdfobject.cpp +index 0a5f907..9bed6c1 100644 +--- a/frmts/pdf/pdfobject.cpp ++++ b/frmts/pdf/pdfobject.cpp +@@ -1061,7 +1061,7 @@ const CPLString& GDALPDFObjectPoppler::GetString() + #else + GooString* gooString = m_po->getString(); + #endif +- return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast<const GByte*>(gooString->getCString()), ++ return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast<const GByte*>(gooString->c_str()), + static_cast<int>(gooString->getLength()))); + } + else +@@ -1422,7 +1422,7 @@ char* GDALPDFStreamPoppler::GetBytes() + char* pszContent = (char*) VSIMalloc(m_nLength + 1); + if (pszContent) + { +- memcpy(pszContent, gstr->getCString(), m_nLength); ++ memcpy(pszContent, gstr->c_str(), m_nLength); + pszContent[m_nLength] = '\0'; + } + delete gstr; +-- +2.20.1 + |