Hi,
this diff enforces C++11 and adds some patches from upstream to let
gdcm build with poppler->=0.58.
Tests with the (old) poppler-0.57 we still have in the ports tree
are as welcome as comments and oks (U've only tested it with
poppler-0.59 in my tree).
Ciao,
Kili
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/gdcm/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 1 Aug 2017 16:38:46 -0000 1.1.1.1
+++ Makefile 20 Sep 2017 21:20:09 -0000
@@ -28,6 +28,10 @@ MASTER_SITES = ${MASTER_SITE_SOURCEFOR
MODULES = devel/cmake
+# c++-11
+COMPILER = base-clang ports-gcc
+CXXFLAGS += -std=c++11
+
WANTLIB += ${COMPILER_LIBCXX} c crypto expat json-c m openjp2
WANTLIB += poppler ssl uuid xml2 z
Index: patches/patch-Applications_Cxx_CMakeLists_txt
===================================================================
RCS file: patches/patch-Applications_Cxx_CMakeLists_txt
diff -N patches/patch-Applications_Cxx_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Applications_Cxx_CMakeLists_txt 20 Sep 2017 21:20:09 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Fix build with poppler->=0.58.
+From upstream commit 8854c50aaa135dd81350247dd6e803f10cbd6abc.
+
+Index: Applications/Cxx/CMakeLists.txt
+--- Applications/Cxx/CMakeLists.txt.orig
++++ 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 <poppler/Object.h>\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(
Index: patches/patch-Applications_Cxx_gdcminfo_cxx
===================================================================
RCS file: patches/patch-Applications_Cxx_gdcminfo_cxx
diff -N patches/patch-Applications_Cxx_gdcminfo_cxx
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Applications_Cxx_gdcminfo_cxx 20 Sep 2017 21:20:09 -0000
@@ -0,0 +1,86 @@
+$OpenBSD$
+
+Fix build with poppler->=0.58.
+From upstream commit 8854c50aaa135dd81350247dd6e803f10cbd6abc.
+
+Index: Applications/Cxx/gdcminfo.cxx
+--- Applications/Cxx/gdcminfo.cxx.orig
++++ Applications/Cxx/gdcminfo.cxx
+@@ -194,7 +194,11 @@ static std::string getInfoDate(Dict *infoDict, const c
+ //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())
++
No comments:
Post a Comment