From b404243318ee15d71ffc214f71374c0228790523 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 10 Jan 2018 09:41:54 +0100 Subject: [PATCH] remove already applied patch Signed-off-by: Igor Gnatenko --- 0001-adapt-to-poppler-0.58.patch | 193 ------------------------------- gdcm.spec | 2 - 2 files changed, 195 deletions(-) delete mode 100644 0001-adapt-to-poppler-0.58.patch diff --git a/0001-adapt-to-poppler-0.58.patch b/0001-adapt-to-poppler-0.58.patch deleted file mode 100644 index 3c8a86a..0000000 --- a/0001-adapt-to-poppler-0.58.patch +++ /dev/null @@ -1,193 +0,0 @@ -From 45cca81d842779203d21a5ddf390c272b7056d42 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Wed, 6 Sep 2017 16:37:16 +0200 -Subject: [PATCH] adapt to poppler 0.58 - ---- - Applications/Cxx/CMakeLists.txt | 6 ++++++ - Applications/Cxx/gdcminfo.cxx | 22 ++++++++++++++++++++++ - Applications/Cxx/gdcmpdf.cxx | 20 ++++++++++++++++++++ - 3 files changed, 48 insertions(+) - -diff --git a/Applications/Cxx/CMakeLists.txt b/Applications/Cxx/CMakeLists.txt -index 9b42682..2843fd5 100644 ---- a/Applications/Cxx/CMakeLists.txt -+++ b/Applications/Cxx/CMakeLists.txt -@@ -84,6 +84,12 @@ if(GDCM_USE_SYSTEM_POPPLER) - if(LIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT) - list(APPEND libpoppler_flags -DLIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT) - endif() -+ CHECK_CXX_SOURCE_COMPILES( -+ "\#include \nint main() { Object o(42); }" -+ LIBPOPPLER_NEW_OBJECT_API) -+if(LIBPOPPLER_NEW_OBJECT_API) -+ list(APPEND libpoppler_flags -DLIBPOPPLER_NEW_OBJECT_API) -+ endif() - if(libpoppler_flags) - string(REPLACE ";" " " libpoppler_flags_string "${libpoppler_flags}") - set_source_files_properties( -diff --git a/Applications/Cxx/gdcminfo.cxx b/Applications/Cxx/gdcminfo.cxx -index 6e2b50d..8d2a137 100644 ---- a/Applications/Cxx/gdcminfo.cxx -+++ b/Applications/Cxx/gdcminfo.cxx -@@ -193,7 +193,11 @@ static std::string getInfoDate(Dict *infoDict, const char *key) - //char buf[256]; - std::string out; - -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ if ((obj = infoDict->lookup((char*)key)).isString()) -+#else - if (infoDict->lookup((char*)key, &obj)->isString()) -+#endif - { - s = obj.getString()->getCString(); - if (s[0] == 'D' && s[1] == ':') -@@ -241,7 +245,9 @@ static std::string getInfoDate(Dict *infoDict, const char *key) - out = date; - } - } -+#ifndef LIBPOPPLER_NEW_OBJECT_API - obj.free(); -+#endif - return out; - } - -@@ -255,7 +261,11 @@ static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uM - int i, n; - std::string out; - -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ if ((obj = infoDict->lookup((char*)key)).isString()) -+#else - if (infoDict->lookup((char*)key, &obj)->isString()) -+#endif - { - s1 = obj.getString(); - if ((s1->getChar(0) & 0xff) == 0xfe && -@@ -287,7 +297,9 @@ static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uM - out.append( std::string(buf, n) ); - } - } -+#ifndef LIBPOPPLER_NEW_OBJECT_API - obj.free(); -+#endif - return out; - } - #endif -@@ -434,7 +446,11 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs - MemStream *appearStream; - - appearStream = new MemStream((char*)bv->GetPointer(), 0, -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ bv->GetLength(), std::move(appearDict)); -+#else - bv->GetLength(), &appearDict); -+#endif - GooString *ownerPW, *userPW; - ownerPW = NULL; - userPW = NULL; -@@ -462,7 +478,11 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs - Object info; - if (doc->isOk()) - { -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ info = doc->getDocInfo(); -+#else - doc->getDocInfo(&info); -+#endif - if (info.isDict()) - { - title = getInfoString(info.getDict(), "Title", uMap); -@@ -473,7 +493,9 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs - producer = getInfoString(info.getDict(), "Producer", uMap); - creationdate = getInfoDate( info.getDict(), "CreationDate" ); - moddate = getInfoDate( info.getDict(), "ModDate" ); -+#ifndef LIBPOPPLER_NEW_OBJECT_API - info.free(); -+#endif - } - #ifdef LIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT - const char *tagged = doc->getStructTreeRoot() ? "yes" : "no"; -diff --git a/Applications/Cxx/gdcmpdf.cxx b/Applications/Cxx/gdcmpdf.cxx -index 4c7a7bb..92caad7 100644 ---- a/Applications/Cxx/gdcmpdf.cxx -+++ b/Applications/Cxx/gdcmpdf.cxx -@@ -43,7 +43,11 @@ static std::string getInfoDate(Dict *infoDict, const char *key) - //char buf[256]; - std::string out; - -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ if ((obj = infoDict->lookup((char*)key)).isString()) -+#else - if (infoDict->lookup((char*)key, &obj)->isString()) -+#endif - { - s = obj.getString()->getCString(); - if (s[0] == 'D' && s[1] == ':') -@@ -91,7 +95,9 @@ static std::string getInfoDate(Dict *infoDict, const char *key) - out = date; - } - } -+#ifndef LIBPOPPLER_NEW_OBJECT_API - obj.free(); -+#endif - return out; - } - -@@ -105,7 +111,11 @@ static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uM - int i, n; - std::string out; - -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ if ((obj = infoDict->lookup((char*)key)).isString()) -+#else - if (infoDict->lookup((char*)key, &obj)->isString()) -+#endif - { - s1 = obj.getString(); - if ((s1->getChar(0) & 0xff) == 0xfe && -@@ -137,7 +147,9 @@ static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uM - out.append( std::string(buf, n) ); - } - } -+#ifndef LIBPOPPLER_NEW_OBJECT_API - obj.free(); -+#endif - unicode = unicode || isUnicode; - return out; - } -@@ -340,7 +352,9 @@ int main (int argc, char *argv[]) - //ownerPW = new GooString( "toto" ); - Object obj; - -+#ifndef LIBPOPPLER_NEW_OBJECT_API - obj.initNull(); -+#endif - doc = new PDFDoc(fileName, ownerPW, userPW); - - if (doc->isEncrypted()) -@@ -386,7 +400,11 @@ http://msdn.microsoft.com/en-us/library/078sfkak(VS.80).aspx - GBool isUnicode = gFalse; - if (doc->isOk()) - { -+#ifdef LIBPOPPLER_NEW_OBJECT_API -+ info = doc->getDocInfo(); -+#else - doc->getDocInfo(&info); -+#endif - if (info.isDict()) - { - title = getInfoString(info.getDict(), "Title", uMap, isUnicode); -@@ -397,7 +415,9 @@ http://msdn.microsoft.com/en-us/library/078sfkak(VS.80).aspx - producer = getInfoString(info.getDict(), "Producer", uMap, isUnicode); - creationdate = getInfoDate( info.getDict(), "CreationDate" ); - moddate = getInfoDate( info.getDict(), "ModDate" ); -+#ifndef LIBPOPPLER_NEW_OBJECT_API - info.free(); -+#endif - } - } - --- -2.13.5 - diff --git a/gdcm.spec b/gdcm.spec index 7e682d3..7578f84 100644 --- a/gdcm.spec +++ b/gdcm.spec @@ -14,7 +14,6 @@ Patch3: gdcm-2.4.0-no-versioned-dir.patch #Patch4: gdcm-0005-support-vtk6.patch Patch5: gdcm-2.4.0-find-python27.patch Patch6: gdcm-2.6-fix-cmake-config-paths.patch -Patch7: 0001-adapt-to-poppler-0.58.patch BuildRequires: CharLS-devel >= 1.0 BuildRequires: cmake @@ -114,7 +113,6 @@ used this library with python %patch2 -p 1 %patch3 -p 1 %patch6 -p 1 -%patch7 -p 1 # Fix cmake command sed -i.backup 's/add_dependency/add_dependencies/' Utilities/doxygen/CMakeLists.txt