commit:     916960e6b70b9d89d19cd9602a4b610d8597c3a5
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  2 12:32:46 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Oct  2 12:58:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=916960e6

sci-libs/gdal: Fix build with app-text/poppler-21.10.0

Package-Manager: Portage-3.0.26, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../gdal/files/gdal-3.3.2-poppler-21.10.0.patch    | 32 ++++++++++++++++++++++
 sci-libs/gdal/gdal-3.3.2.ebuild                    |  1 +
 2 files changed, 33 insertions(+)

diff --git a/sci-libs/gdal/files/gdal-3.3.2-poppler-21.10.0.patch 
b/sci-libs/gdal/files/gdal-3.3.2-poppler-21.10.0.patch
new file mode 100644
index 00000000000..a727d21dab6
--- /dev/null
+++ b/sci-libs/gdal/files/gdal-3.3.2-poppler-21.10.0.patch
@@ -0,0 +1,32 @@
+From 9c09870e374ca21d558101af3f4c09a6164fdfc3 Mon Sep 17 00:00:00 2001
+From: Even Rouault <[email protected]>
+Date: Sun, 26 Sep 2021 22:49:52 +0200
+Subject: [PATCH] Fix build against Poppler master
+
+---
+ frmts/pdf/pdfdataset.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp
+index 9c4c28a6572..50a8154c756 100644
+--- a/frmts/pdf/pdfdataset.cpp
++++ b/frmts/pdf/pdfdataset.cpp
+@@ -5012,7 +5012,7 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo )
+ #ifdef HAVE_POPPLER
+   if (bUseLib.test(PDFLIB_POPPLER))
+   {
+-    GooString* poMetadata = poCatalogPoppler->readMetadata();
++    auto poMetadata = poCatalogPoppler->readMetadata();
+     if (poMetadata)
+     {
+ #if (POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 72)
+@@ -5026,7 +5026,9 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo )
+             const char * const apszMDList[2] = { pszContent, nullptr };
+             poDS->SetMetadata(const_cast<char**>(apszMDList), "xml:XMP");
+         }
++#if (POPPLER_MAJOR_VERSION < 21 || (POPPLER_MAJOR_VERSION == 21 && 
POPPLER_MINOR_VERSION <= 9))
+         delete poMetadata;
++#endif
+     }
+ 
+     /* Read Info object */

diff --git a/sci-libs/gdal/gdal-3.3.2.ebuild b/sci-libs/gdal/gdal-3.3.2.ebuild
index 5a7c010cdbf..216917c266d 100644
--- a/sci-libs/gdal/gdal-3.3.2.ebuild
+++ b/sci-libs/gdal/gdal-3.3.2.ebuild
@@ -89,6 +89,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-2.2.3-soname.patch"
        "${FILESDIR}/${PN}-2.3.0-curl.patch" # bug 659840
        "${FILESDIR}/${PN}-3.3.0-libdir.patch"
+       "${FILESDIR}/${P}-poppler-21.10.0.patch"
 )
 
 src_prepare() {

Reply via email to