[arch-commits] Commit in gdal/trunk (PKGBUILD poppler-22.03.0.patch)
Evangelos Foutras
foutrelis at gemini.archlinux.org
Wed Mar 2 15:50:41 UTC 2022
Date: Wednesday, March 2, 2022 @ 15:50:41
Author: foutrelis
Revision: 1139616
upgpkg: gdal 3.4.0-5: use upstream patch for poppler 22.03.0
Modified:
gdal/trunk/PKGBUILD
gdal/trunk/poppler-22.03.0.patch
-----------------------+
PKGBUILD | 4 +--
poppler-22.03.0.patch | 53 +++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 48 insertions(+), 9 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-03-02 15:41:21 UTC (rev 1139615)
+++ PKGBUILD 2022-03-02 15:50:41 UTC (rev 1139616)
@@ -5,7 +5,7 @@
pkgbase=gdal
pkgname=('gdal' 'python-gdal')
pkgver=3.4.0
-pkgrel=4
+pkgrel=5
pkgdesc="A translator library for raster geospatial data formats"
arch=('x86_64')
url="https://gdal.org/"
@@ -22,7 +22,7 @@
poppler-22.03.0.patch
gdal-perl-vendor.patch)
sha256sums=('ac7bd2bb9436f3fc38bc7309704672980f82d64b4d57627d27849259b8f71d5c'
- 'f17b4d6f2e20c34140faf2154f6a64cc4afe10b484a13a0cac3a894f2919f16e'
+ 'b60d94457199ab49ff11cbbb793cd6cd459c732265d342f1c04721f164383e73'
'2103b98f2f15954f042d5620658b30d703125927bde2e5eb671c5facb6c2f5ed')
prepare() {
Modified: poppler-22.03.0.patch
===================================================================
--- poppler-22.03.0.patch 2022-03-02 15:41:21 UTC (rev 1139615)
+++ poppler-22.03.0.patch 2022-03-02 15:50:41 UTC (rev 1139616)
@@ -1,15 +1,54 @@
-diff -upr gdal-3.4.0.orig/frmts/pdf/pdfdataset.cpp gdal-3.4.0/frmts/pdf/pdfdataset.cpp
---- gdal-3.4.0.orig/frmts/pdf/pdfdataset.cpp 2021-11-04 13:57:20.000000000 +0200
-+++ gdal-3.4.0/frmts/pdf/pdfdataset.cpp 2022-03-02 13:17:56.964778481 +0200
-@@ -4322,7 +4322,11 @@ PDFDataset *PDFDataset::Open( GDALOpenIn
+From 17e98757e78969a199d1d6318f53d088da192191 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault at spatialys.com>
+Date: Fri, 18 Feb 2022 22:47:01 +0100
+Subject: [PATCH] PDF: fix build against Poppler > 22.2
+
+---
+ frmts/pdf/pdfdataset.cpp | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp
+index 22238bd74822..08f8e31c86a7 100644
+--- a/frmts/pdf/pdfdataset.cpp
++++ b/frmts/pdf/pdfdataset.cpp
+@@ -4241,8 +4241,6 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo )
+ #ifdef HAVE_POPPLER
+ if(bUseLib.test(PDFLIB_POPPLER))
+ {
+- GooString* poUserPwd = nullptr;
+-
+ static bool globalParamsCreatedByGDAL = false;
+ {
+ CPLMutexHolderD(&hGlobalParamsMutex);
+@@ -4310,9 +4308,6 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo )
+ while( true )
+ {
+ VSIFSeekL(fp, 0, SEEK_SET);
+- if (pszUserPwd)
+- poUserPwd = new GooString(pszUserPwd);
+-
+ g_nPopplerErrors = 0;
+ if( globalParamsCreatedByGDAL )
+ registerErrorCallback();
+@@ -4322,10 +4317,20 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo )
oObj.getObj()->initNull();
auto poStream = new VSIPDFFileStream(fp, pszFilename, oObj.getObj());
#endif
-+#if POPPLER_MAJOR_VERSION > 22 || (POPPLER_MAJOR_VERSION == 22 && POPPLER_MINOR_VERSION >= 3)
-+ poDocPoppler = new PDFDoc(poStream, std::nullopt, GooString(poUserPwd));
++#if POPPLER_MAJOR_VERSION > 22 || (POPPLER_MAJOR_VERSION == 22 && POPPLER_MINOR_VERSION > 2)
++ std::optional<GooString> osUserPwd;
++ if (pszUserPwd)
++ osUserPwd = std::optional<GooString>(pszUserPwd);
++ poDocPoppler = new PDFDoc(poStream, std::optional<GooString>(), osUserPwd);
+#else
++ GooString* poUserPwd = nullptr;
++ if (pszUserPwd)
++ poUserPwd = new GooString(pszUserPwd);
poDocPoppler = new PDFDoc(poStream, nullptr, poUserPwd);
++ delete poUserPwd;
+#endif
if( globalParamsCreatedByGDAL )
registerErrorCallback();
- delete poUserPwd;
+- delete poUserPwd;
+ if( g_nPopplerErrors >= MAX_POPPLER_ERRORS )
+ {
+ PDFFreeDoc(poDocPoppler);
More information about the arch-commits
mailing list