public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdcm] rawhide: Rebuild for poppler 26.08.0
@ 2026-08-07 15:08 Marek Kasik
0 siblings, 0 replies; only message in thread
From: Marek Kasik @ 2026-08-07 15:08 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/gdcm
Branch : rawhide
Commit : f0824c38f3cdce204663f7a6e919c69569b52464
Author : Marek Kasik <mkasik@redhat.com>
Date : 2026-08-07T15:20:50+02:00
Stats : +256/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/gdcm/c/f0824c38f3cdce204663f7a6e919c69569b52464?branch=rawhide
Log:
Rebuild for poppler 26.08.0
---
diff --git a/gdcm-3.0.24-poppler-26.08.0.patch b/gdcm-3.0.24-poppler-26.08.0.patch
new file mode 100644
index 0000000..0ef0cb3
--- /dev/null
+++ b/gdcm-3.0.24-poppler-26.08.0.patch
@@ -0,0 +1,254 @@
+--- GDCM-3.0.24/Applications/Cxx/CMakeLists.txt
++++ GDCM-3.0.24/Applications/Cxx/CMakeLists.txt
+@@ -122,6 +122,18 @@ if(GDCM_USE_SYSTEM_POPPLER)
+ if(LIBPOPPLER_PDFDOC_HAS_OPTIONAL)
+ list(APPEND libpoppler_flags -DLIBPOPPLER_PDFDOC_HAS_OPTIONAL)
+ endif()
++ CHECK_CXX_SOURCE_COMPILES(
++ "\#include <poppler/Object.h>\nint main() { std::string str; Object obj; obj = Object (std::string (\"test\")); str = obj.getString (); return 0;}"
++ LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING)
++ if(LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING)
++ list(APPEND libpoppler_flags -DLIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING)
++ endif()
++ CHECK_CXX_SOURCE_COMPILES(
++ "\#include <poppler/PDFDoc.h>\nint main() { std::optional<GooString> ownerPW, userPW; MemStream *stream; PDFDoc doc(std::unique_ptr<BaseStream>(stream),ownerPW,userPW); return 0;}"
++ LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
++ if(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
++ list(APPEND libpoppler_flags -DLIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
++ endif()
+ if(libpoppler_flags)
+ string(REPLACE ";" " " libpoppler_flags_string "${libpoppler_flags}")
+ set_source_files_properties(
+--- GDCM-3.0.24/Applications/Cxx/gdcminfo.cxx
++++ GDCM-3.0.24/Applications/Cxx/gdcminfo.cxx
+@@ -204,12 +204,17 @@ static std::string getInfoDate(Dict *inf
+ #ifndef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING
+ const
+ #endif
++#ifdef LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING
++ std::string os = obj.getString();
++ s = os.c_str();
++#else
+ GooString* gs = obj.getString();
+ #ifdef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING
+ s = gs->getCString();
+ #else
+ s = gs->c_str();
+ #endif
++#endif
+ if (s[0] == 'D' && s[1] == ':')
+ {
+ s += 2;
+@@ -268,11 +273,15 @@ static std::string getInfoString(Dict *i
+ #endif
+ {
+ Object obj;
++#ifdef LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING
++ std::string s1;
++#else
+ #ifdef LIBPOPPLER_GOOSTRING_HAS_CONSTGETCHAR
+ const GooString *s1;
+ #else
+ GooString *s1;
+ #endif
++#endif
+ bool isUnicode;
+ Unicode u;
+ char buf[8];
+@@ -294,6 +294,35 @@ static std::string getInfoString(Dict *i
+ if (infoDict->lookup((char*)key, &obj)->isString())
+ #endif
+ {
++#ifdef LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING
++ s1 = obj.getString();
++ if ((s1[0] & 0xff) == 0xfe && (s1[1] & 0xff) == 0xff)
++ {
++ isUnicode = true;
++ i = 2;
++ }
++ else
++ {
++ isUnicode = false;
++ i = 0;
++ }
++ while (i < s1.size())
++ {
++ if (isUnicode)
++ {
++ u = ((s1[i] & 0xff) << 8) | (s1[i+1] & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = pdfDocEncoding[s1[i] & 0xff];
++ ++i;
++ }
++ n = uMap->mapUnicode(u, buf, sizeof(buf));
++ //fwrite(buf,1,n,stdout);
++ out.append( std::string(buf, n) );
++ }
++#else
+ s1 = obj.getString();
+ if ((s1->getChar(0) & 0xff) == 0xfe &&
+ (s1->getChar(1) & 0xff) == 0xff)
+@@ -323,6 +352,7 @@ static std::string getInfoString(Dict *i
+ //fwrite(buf,1,n,stdout);
+ out.append( std::string(buf, n) );
+ }
++#endif
+ }
+ #ifndef LIBPOPPLER_NEW_OBJECT_API
+ obj.free();
+@@ -510,7 +540,7 @@ static int ProcessOneFile( std::string c
+ #else
+ bv->GetLength(), &appearDict);
+ #endif
+-#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) || defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ std::optional<GooString> ownerPW, userPW;
+ #else
+ GooString *ownerPW, *userPW;
+@@ -519,7 +549,11 @@ static int ProcessOneFile( std::string c
+ #endif
+
+ PDFDoc *doc;
++#ifdef LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL
++ doc = new PDFDoc(std::unique_ptr<BaseStream>(appearStream), ownerPW, userPW);
++#else
+ doc = new PDFDoc(appearStream, ownerPW, userPW);
++#endif
+
+ std::string title;
+ std::string subject;
+--- GDCM-3.0.24/Applications/Cxx/gdcmpdf.cxx
++++ GDCM-3.0.24/Applications/Cxx/gdcmpdf.cxx
+@@ -25,7 +25,7 @@
+ #include <poppler/UnicodeMap.h>
+ #include <poppler/PDFDocEncoding.h>
+ #include <poppler/GlobalParams.h>
+-#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) || defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ #include <poppler/PDFDocFactory.h>
+ #endif
+ #endif
+@@ -55,12 +55,17 @@ static std::string getInfoDate(Dict *inf
+ #ifndef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING
+ const
+ #endif
++#ifdef LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING
++ std::string os = obj.getString();
++ s = os.c_str();
++#else
+ GooString* gs = obj.getString();
+ #ifdef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING
+ s = gs->getCString();
+ #else
+ s = gs->c_str();
+ #endif
++#endif
+ if (s[0] == 'D' && s[1] == ':')
+ {
+ s += 2;
+@@ -119,11 +124,15 @@ static std::string getInfoString(Dict *i
+ #endif
+ {
+ Object obj;
++#ifdef LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING
++ std::string s1;
++#else
+ #ifdef LIBPOPPLER_GOOSTRING_HAS_CONSTGETCHAR
+ const GooString *s1;
+ #else
+ GooString *s1;
+ #endif
++#endif
+ bool isUnicode = false;
+ Unicode u;
+ char buf[8];
+@@ -136,6 +145,35 @@ static std::string getInfoString(Dict *i
+ if (infoDict->lookup((char*)key, &obj)->isString())
+ #endif
+ {
++#ifdef LIBPOPPLER_OBJECT_GETSTRING_RETURNS_STRING
++ s1 = obj.getString();
++ if ((s1[0] & 0xff) == 0xfe && (s1[1] & 0xff) == 0xff)
++ {
++ isUnicode = true;
++ i = 2;
++ }
++ else
++ {
++ isUnicode = false;
++ i = 0;
++ }
++ while (i < s1.size())
++ {
++ if (isUnicode)
++ {
++ u = ((s1[i] & 0xff) << 8) | (s1[i+1] & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = pdfDocEncoding[s1[i] & 0xff];
++ ++i;
++ }
++ n = uMap->mapUnicode(u, buf, sizeof(buf));
++ //fwrite(buf,1,n,stdout);
++ out.append( std::string(buf, n) );
++ }
++#else
+ s1 = obj.getString();
+ if ((s1->getChar(0) & 0xff) == 0xfe &&
+ (s1->getChar(1) & 0xff) == 0xff)
+@@ -165,6 +203,7 @@ static std::string getInfoString(Dict *i
+ //fwrite(buf,1,n,stdout);
+ out.append( std::string(buf, n) );
+ }
++#endif
+ }
+ #ifndef LIBPOPPLER_NEW_OBJECT_API
+ obj.free();
+@@ -378,13 +378,13 @@ int main (int argc, char *argv[])
+ return 0;
+ }
+
+-#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) || defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ std::optional<GooString> ownerPW, userPW;
+ #else
+ GooString *ownerPW, *userPW;
+ #endif
+ GooString *fileName;
+-#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) || defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ std::unique_ptr<PDFDoc> doc;
+ #else
+ PDFDoc *doc;
+@@ -395,7 +395,7 @@ int main (int argc, char *argv[])
+ #else
+ UnicodeMap *uMap;
+ #endif
+-#ifndef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if !defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) && !defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ ownerPW = NULL;
+ userPW = NULL;
+ #endif
+@@ -431,7 +431,7 @@ int main (int argc, char *argv[])
+ #ifndef LIBPOPPLER_NEW_OBJECT_API
+ obj.initNull();
+ #endif
+-#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) || defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ doc = PDFDocFactory().createPDFDoc(*fileName, ownerPW, userPW);
+ #else
+ doc = new PDFDoc(fileName, ownerPW, userPW);
+@@ -464,7 +464,7 @@ return ch;
+ http://msdn.microsoft.com/en-us/library/078sfkak(VS.80).aspx
+ }
+ */
+-#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL
++#if defined(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) || defined(LIBPOPPLER_PDFDOC_HAS_UNIQUE_BASESTREAM_AND_OPTIONAL)
+ ownerPW = GooString( password.c_str() );
+ doc = PDFDocFactory().createPDFDoc(*fileName, ownerPW, userPW);
+ #else
diff --git a/gdcm.spec b/gdcm.spec
index 96e9b43..72b97bc 100644
--- a/gdcm.spec
+++ b/gdcm.spec
@@ -28,6 +28,8 @@ Patch4: 0004-fix-GooString-use-std-string-size.patch
# Replace removed Python 2 C API macros with Python 3 equivalents
# for compatibility with SWIG 4.5.0
Patch5: gdcm-swig45.patch
+# Fixes build with poppler 26.08.0
+Patch6: gdcm-3.0.24-poppler-26.08.0.patch
BuildRequires: CharLS-devel >= 2.2
BuildRequires: cmake
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-07 15:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-07 15:08 [rpms/gdcm] rawhide: Rebuild for poppler 26.08.0 Marek Kasik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox