commit:     e3f9446f655d4ba4c331015455367cac4ef09537
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue May  6 15:21:08 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue May  6 18:17:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3f9446f

sci-libs/gdal: Fix build w/ >=app-text/poppler-25.05

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sci-libs/gdal/files/gdal-3.9.3-poppler-25.05.patch | 61 ++++++++++++++++++++++
 sci-libs/gdal/gdal-3.9.3.ebuild                    |  2 +-
 2 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/sci-libs/gdal/files/gdal-3.9.3-poppler-25.05.patch 
b/sci-libs/gdal/files/gdal-3.9.3-poppler-25.05.patch
new file mode 100644
index 000000000000..3af89e4da866
--- /dev/null
+++ b/sci-libs/gdal/files/gdal-3.9.3-poppler-25.05.patch
@@ -0,0 +1,61 @@
+From a689e2189ff0a464f3150ed8b2dd5a3cc1194012 Mon Sep 17 00:00:00 2001
+From: Even Rouault <[email protected]>
+Date: Sun, 4 May 2025 21:00:18 +0200
+Subject: [PATCH] PDF: Fix build against Poppler 2025.05.0
+
+---
+ frmts/pdf/pdfio.cpp | 13 +++++++++++++
+ frmts/pdf/pdfio.h   |  8 ++++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/frmts/pdf/pdfio.cpp b/frmts/pdf/pdfio.cpp
+index 9bf39f495020..39cb1285ef40 100644
+--- a/frmts/pdf/pdfio.cpp
++++ b/frmts/pdf/pdfio.cpp
+@@ -77,12 +77,25 @@ BaseStream *VSIPDFFileStream::copy()
+ /************************************************************************/
+ /*                             makeSubStream()                          */
+ /************************************************************************/
++
++#if POPPLER_MAJOR_VERSION > 25 ||                                             
 \
++    (POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION >= 5)
++std::unique_ptr<Stream> VSIPDFFileStream::makeSubStream(Goffset startA,
++                                                        bool limitedA,
++                                                        Goffset lengthA,
++                                                        Object &&dictA)
++{
++    return std::make_unique<VSIPDFFileStream>(this, startA, limitedA, lengthA,
++                                              std::move(dictA));
++}
++#else
+ Stream *VSIPDFFileStream::makeSubStream(Goffset startA, bool limitedA,
+                                         Goffset lengthA, Object &&dictA)
+ {
+     return new VSIPDFFileStream(this, startA, limitedA, lengthA,
+                                 std::move(dictA));
+ }
++#endif
+ 
+ /************************************************************************/
+ /*                                 getPos()                             */
+diff --git a/frmts/pdf/pdfio.h b/frmts/pdf/pdfio.h
+index f3adf9707ead..e2223bd87fa5 100644
+--- a/frmts/pdf/pdfio.h
++++ b/frmts/pdf/pdfio.h
+@@ -31,8 +31,16 @@ class VSIPDFFileStream final : public BaseStream
+ 
+     virtual BaseStream *copy() override;
+ 
++#if POPPLER_MAJOR_VERSION > 25 ||                                             
 \
++    (POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION >= 5)
++    virtual std::unique_ptr<Stream> makeSubStream(Goffset startA, bool 
limitedA,
++                                                  Goffset lengthA,
++                                                  Object &&dictA) override;
++#else
+     virtual Stream *makeSubStream(Goffset startA, bool limitedA,
+                                   Goffset lengthA, Object &&dictA) override;
++
++#endif
+     virtual Goffset getPos() override;
+     virtual Goffset getStart() override;
+ 

diff --git a/sci-libs/gdal/gdal-3.9.3.ebuild b/sci-libs/gdal/gdal-3.9.3.ebuild
index 64946c6c7aa1..b0e19738ed58 100644
--- a/sci-libs/gdal/gdal-3.9.3.ebuild
+++ b/sci-libs/gdal/gdal-3.9.3.ebuild
@@ -103,7 +103,7 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 PATCHES=(
        "${FILESDIR}"/${PN}-3.6.4-abseil-cpp-20230125.2-c++17.patch
        "${FILESDIR}"/${PN}-3.9.1-poppler-24.12.patch
-       "${FILESDIR}"/${P}-poppler-25.02.patch
+       "${FILESDIR}"/${P}-poppler-25.0{2,5}.patch
 )
 
 pkg_setup() {

Reply via email to