From 56fa3d514bd4a4889d09aa6504bb8de420039f4973fdefb80a6f5b28ed723481 Mon Sep 17 00:00:00 2001 From: Bruno Friedmann Date: Wed, 20 Oct 2021 07:20:34 +0000 Subject: [PATCH] Accepting request 926472 from home:Guillaume_G:branches:Application:Geo - Fix build with poppler 2.10: * gdal-poppler-2.10-a.patch * gdal-poppler-2.10-b.patch OBS-URL: https://build.opensuse.org/request/show/926472 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/gdal?expand=0&rev=142 --- gdal-poppler-2.10-a.patch | 32 ++++++++++++++++++++++++++++++++ gdal-poppler-2.10-b.patch | 22 ++++++++++++++++++++++ gdal.changes | 7 +++++++ gdal.spec | 4 ++++ 4 files changed, 65 insertions(+) create mode 100644 gdal-poppler-2.10-a.patch create mode 100644 gdal-poppler-2.10-b.patch diff --git a/gdal-poppler-2.10-a.patch b/gdal-poppler-2.10-a.patch new file mode 100644 index 0000000..577570b --- /dev/null +++ b/gdal-poppler-2.10-a.patch @@ -0,0 +1,32 @@ +From 9c09870e374ca21d558101af3f4c09a6164fdfc3 Mon Sep 17 00:00:00 2001 +From: Even Rouault +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(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/gdal-poppler-2.10-b.patch b/gdal-poppler-2.10-b.patch new file mode 100644 index 0000000..806358e --- /dev/null +++ b/gdal-poppler-2.10-b.patch @@ -0,0 +1,22 @@ +From 53f969c9c287e4893ff8d9f97ddd1cb25c32dfb4 Mon Sep 17 00:00:00 2001 +From: Even Rouault +Date: Tue, 5 Oct 2021 22:45:43 +0200 +Subject: [PATCH] PDF: adjust test to Poppler 21.10 + +--- + frmts/pdf/pdfdataset.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp +index 50a8154c756..22238bd7482 100644 +--- a/frmts/pdf/pdfdataset.cpp ++++ b/frmts/pdf/pdfdataset.cpp +@@ -5026,7 +5026,7 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo ) + const char * const apszMDList[2] = { pszContent, nullptr }; + poDS->SetMetadata(const_cast(apszMDList), "xml:XMP"); + } +-#if (POPPLER_MAJOR_VERSION < 21 || (POPPLER_MAJOR_VERSION == 21 && POPPLER_MINOR_VERSION <= 9)) ++#if (POPPLER_MAJOR_VERSION < 21 || (POPPLER_MAJOR_VERSION == 21 && POPPLER_MINOR_VERSION < 10)) + delete poMetadata; + #endif + } diff --git a/gdal.changes b/gdal.changes index ce19919..ab7a67b 100644 --- a/gdal.changes +++ b/gdal.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 20 06:53:22 UTC 2021 - Guillaume GARDET + +- Fix build with poppler 2.10: + * gdal-poppler-2.10-a.patch + * gdal-poppler-2.10-b.patch + ------------------------------------------------------------------- Tue Sep 7 19:18:02 UTC 2021 - Bruno Friedmann diff --git a/gdal.spec b/gdal.spec index 3f45832..572bb10 100644 --- a/gdal.spec +++ b/gdal.spec @@ -39,6 +39,10 @@ Source2: https://download.osgeo.org/%{name}/%{version}/%{sourcename}autot Patch0: gdal-perl.patch # Fix occasional parallel build failure Patch1: GDALmake.opt.in.patch +# PATCH-FIX-UPSTREAM - https://github.com/OSGeo/gdal/commit/9c09870e374ca21d558101af3f4c09a6164fdfc3 +Patch2: gdal-poppler-2.10-a.patch +# PATCH-FIX-UPSTREAM - https://github.com/OSGeo/gdal/commit/53f969c9c287e4893ff8d9f97ddd1cb25c32dfb4 +Patch3: gdal-poppler-2.10-b.patch BuildRequires: KEALib-devel BuildRequires: autoconf BuildRequires: automake