[med-svn] r17403 - trunk/packages/gdcm/trunk/debian/patches

Mathieu Malaterre malat at moszumanska.debian.org
Thu Jul 3 19:08:29 UTC 2014


Author: malat
Date: 2014-07-03 19:08:29 +0000 (Thu, 03 Jul 2014)
New Revision: 17403

Added:
   trunk/packages/gdcm/trunk/debian/patches/0001-cmake-proper-handle-the-extra-poppler-CFLAGS.patch
   trunk/packages/gdcm/trunk/debian/patches/0002-gdcminfo-support-poppler-0.25.1.patch
Log:
import from mentors

Added: trunk/packages/gdcm/trunk/debian/patches/0001-cmake-proper-handle-the-extra-poppler-CFLAGS.patch
===================================================================
--- trunk/packages/gdcm/trunk/debian/patches/0001-cmake-proper-handle-the-extra-poppler-CFLAGS.patch	                        (rev 0)
+++ trunk/packages/gdcm/trunk/debian/patches/0001-cmake-proper-handle-the-extra-poppler-CFLAGS.patch	2014-07-03 19:08:29 UTC (rev 17403)
@@ -0,0 +1,35 @@
+>From 096e5b84d9e241b6e5203904846454f7d7058e01 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <toscano.pino at tiscali.it>
+Date: Sun, 6 Apr 2014 06:20:43 +0000
+Subject: [PATCH] cmake: proper handle the extra poppler CFLAGS
+
+Make sure to join the extra CFLAGS with a space, otherwise they are
+passed as list to set_source_files_properties; also make sure to quote
+the string.
+---
+ Applications/Cxx/CMakeLists.txt | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Applications/Cxx/CMakeLists.txt b/Applications/Cxx/CMakeLists.txt
+index 1c83bc3..714f5bc 100644
+--- a/Applications/Cxx/CMakeLists.txt
++++ b/Applications/Cxx/CMakeLists.txt
+@@ -79,12 +79,13 @@ if(GDCM_USE_SYSTEM_POPPLER)
+     list(APPEND libpoppler_flags -DLIBPOPPLER_PDFDOC_HAS_PDFVERSION)
+   endif()
+   if(libpoppler_flags)
++    string(REPLACE ";" " " libpoppler_flags_string "${libpoppler_flags}")
+     set_source_files_properties(
+       ${CMAKE_CURRENT_SOURCE_DIR}/gdcminfo.cxx
+-      PROPERTIES COMPILE_FLAGS ${libpoppler_flags})
++      PROPERTIES COMPILE_FLAGS "${libpoppler_flags_string}")
+     set_source_files_properties(
+       ${CMAKE_CURRENT_SOURCE_DIR}/gdcmpdf.cxx
+-      PROPERTIES COMPILE_FLAGS ${libpoppler_flags})
++      PROPERTIES COMPILE_FLAGS "${libpoppler_flags_string}")
+   endif()
+   include_directories(${POPPLER_INCLUDE_DIRS})
+   set(GDCM_EXECUTABLE_NAME
+-- 
+2.0.0
+

Added: trunk/packages/gdcm/trunk/debian/patches/0002-gdcminfo-support-poppler-0.25.1.patch
===================================================================
--- trunk/packages/gdcm/trunk/debian/patches/0002-gdcminfo-support-poppler-0.25.1.patch	                        (rev 0)
+++ trunk/packages/gdcm/trunk/debian/patches/0002-gdcminfo-support-poppler-0.25.1.patch	2014-07-03 19:08:29 UTC (rev 17403)
@@ -0,0 +1,49 @@
+>From 1da0cab121782f1a63a84a9bcc90da6c337dc2e3 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <toscano.pino at tiscali.it>
+Date: Sun, 6 Apr 2014 06:23:46 +0000
+Subject: [PATCH] gdcminfo: support poppler 0.25.1
+
+Check for the new API of StructTreeRoot, adapting the check for a
+tagged PDF accordingly. Now Catalog::getStructTreeRoot() returns NULL
+if StructTreeRoot is not a dictionary.
+---
+ Applications/Cxx/CMakeLists.txt | 6 ++++++
+ Applications/Cxx/gdcminfo.cxx   | 4 ++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/Applications/Cxx/CMakeLists.txt b/Applications/Cxx/CMakeLists.txt
+index 714f5bc..9b4dd0e 100644
+--- a/Applications/Cxx/CMakeLists.txt
++++ b/Applications/Cxx/CMakeLists.txt
+@@ -78,6 +78,12 @@ if(GDCM_USE_SYSTEM_POPPLER)
+   if(LIBPOPPLER_PDFDOC_HAS_PDFVERSION)
+     list(APPEND libpoppler_flags -DLIBPOPPLER_PDFDOC_HAS_PDFVERSION)
+   endif()
++  CHECK_CXX_SOURCE_COMPILES(
++    "\#include <poppler/PDFDoc.h>\n#include <poppler/StructTreeRoot.h>\nint main() { Catalog c(NULL); c.getStructTreeRoot()->getDoc(); return 0;}"
++    LIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT)
++  if(LIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT)
++    list(APPEND libpoppler_flags -DLIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT)
++  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 6f52cd9..9288ea6 100644
+--- a/Applications/Cxx/gdcminfo.cxx
++++ b/Applications/Cxx/gdcminfo.cxx
+@@ -471,7 +471,11 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs
+         moddate      = getInfoDate(  info.getDict(), "ModDate"       );
+         info.free();
+         }
++#ifdef LIBPOPPLER_CATALOG_HAS_STRUCTTREEROOT
++      const char *tagged = doc->getStructTreeRoot() ? "yes" : "no";
++#else
+       const char *tagged = doc->getStructTreeRoot()->isDict() ? "yes" : "no";
++#endif
+       int pages = doc->getNumPages();
+       const char *encrypted = doc->isEncrypted() ? "yes" : "no";
+       //  printf("yes (print:%s copy:%s change:%s addNotes:%s)\n",
+-- 
+2.0.0
+




More information about the debian-med-commit mailing list