By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 2957 - tdegraphics patches when building with poppler 0.64+
Summary: tdegraphics patches when building with poppler 0.64+
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdegraphics (show other bugs)
Version: R14.0.x [Trinity]
Hardware: amd64 Slackware 14
: P5 normal
Assignee: Slávek Banko
URL:
: 2954 (view as bug list)
Depends on:
Blocks: R14.0.6
  Show dependency treegraph
 
Reported: 2018-08-05 10:33 CDT by Ray Vine
Modified: 2018-09-08 07:45 CDT (History)
5 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
Fix FTBFS with poppler 064 (7.55 KB, patch)
2018-09-05 17:19 CDT, Slávek Banko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Vine 2018-08-05 10:33:49 CDT
I had these build errors with poppler 0.67, but believe they'd occur for versions 0.64 onwards.

poppler-document.cc:180:23: error: invalid conversion from ‘const GooString*’ to ‘GooString*’ [-fpermissive]
     s1 = obj.getString();
          ~~~~~~~~~~~~~^~
+ 2 more


poppler-private.cc:99:50: error: invalid conversion from ‘const Unicode*’ {aka ‘const unsigned int*’} to ‘Unicode*’ {aka ‘unsigned int*’} [-fpermissive]
         Unicode * uniChar = outlineItem->getTitle();
                             ~~~~~~~~~~~~~~~~~~~~~^~
+ 4 more

Patches applied - based on https://git.archlinux.org/svntogit/packages.git/plain/trunk/noconst.patch?h=packages/inkscape

--- tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
+++ tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
@@ -180 +180 @@
-    s1 = obj.getString();
+    s1 = (GooString *)obj.getString();
@@ -252 +252 @@
-    TQString s = UnicodeParsedString(obj.getString());
+    TQString s = UnicodeParsedString((GooString *)obj.getString());
@@ -323 +323 @@
-  GooList * items = outline->getItems();
+  GooList * items = (GooList *)outline->getItems();

--- tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc
+++ tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc
@@ -99 +99 @@
-        Unicode * uniChar = outlineItem->getTitle();
+        Unicode * uniChar = (Unicode *)outlineItem->getTitle();
@@ -109 +109 @@
-        ::LinkAction * a = outlineItem->getAction();
+        ::LinkAction * a = (::LinkAction *)outlineItem->getAction();
@@ -114 +114 @@
-            LinkDest * destination = g->getDest();
+            LinkDest * destination = (LinkDest *)g->getDest();
@@ -120 +120 @@
-                GooString *s = g->getNamedDest();
+                GooString *s = (GooString *)g->getNamedDest();
@@ -141 +141 @@
-        GooList * children = outlineItem->getKids();
+        GooList * children = (GooList *)outlineItem->getKids();
Comment 1 Michele Calgaro 2018-08-06 06:21:54 CDT
Perhaps related to bug 2954?
Comment 2 Michele Calgaro 2018-08-06 06:23:56 CDT
*** Bug 2954 has been marked as a duplicate of this bug. ***
Comment 3 Francois Andriot 2018-08-06 13:53:39 CDT
OK for me, this patch is working well on opensuse TW.
Comment 4 Slávek Banko 2018-08-06 18:53:15 CDT
Although the patch works, this is not a good solution. We can not simply cast const to non-const and hope it does not break anything. It needs more work!
Comment 5 Ray Vine 2018-08-07 08:14:53 CDT
In case you do decide that this is the way to go, I'd just like to post these patch updates which I'd already set up and tested. I've had no problems printing to pdf from kate or opening in kpdf or a konqueror tab.

The patch above only applies to poppler-0.64+

This patch applies for early versions as well, except for 0.58 and 0.59.

--- config.h.cmake
+++ config.h.cmake
@@ -3,0 +4 @@
+#cmakedefine HAVE_POPPLER_064
--- tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
+++ tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
@@ -36,0 +37,11 @@
+
+if( NOT DEFINED HAVE_POPPLER_064 )
+  message( STATUS "Performing Test HAVE_POPPLER_064" )
+  if( NOT POPPLER_VERSION VERSION_LESS "0.64" )
+    set( HAVE_POPPLER_064 1 CACHE INTERNAL "" FORCE )
+    message( STATUS "Performing Test HAVE_POPPLER_064 - Success" )
+  else( )
+    set( HAVE_POPPLER_064 "" CACHE INTERNAL "" FORCE )
+    message( STATUS "Performing Test HAVE_POPPLER_064 - Failed" )
+  endif( )
+endif( )
--- tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
+++ tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
@@ -179,0 +180,3 @@
+#   if defined(HAVE_POPPLER_064)
+    s1 = (GooString *)obj.getString();
+#   else
@@ -180,0 +184 @@
+#   endif
@@ -251,0 +256,3 @@
+#   if defined(HAVE_POPPLER_064)
+    TQString s = UnicodeParsedString((GooString *)obj.getString());
+#   else
@@ -252,0 +260 @@
+#   endif
@@ -322,0 +331,3 @@
+#   if defined(HAVE_POPPLER_064)
+  GooList * items = (GooList *)outline->getItems();
+#   else
@@ -323,0 +335 @@
+#   endif
--- tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc
+++ tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc
@@ -98,0 +99,3 @@
+#   if defined(HAVE_POPPLER_064)
+        Unicode * uniChar = (Unicode *)outlineItem->getTitle();
+#   else
@@ -99,0 +103 @@
+#   endif
@@ -108,0 +113,3 @@
+#   if defined(HAVE_POPPLER_064)
+        ::LinkAction * a = (::LinkAction *)outlineItem->getAction();
+#   else
@@ -109,0 +117 @@
+#   endif
@@ -113,0 +122,3 @@
+#   if defined(HAVE_POPPLER_064)
+            LinkDest * destination = (LinkDest *)g->getDest();
+#   else
@@ -114,0 +126 @@
+#   endif
@@ -119,0 +132,3 @@
+#   if defined(HAVE_POPPLER_064)
+                GooString *s = (GooString *)g->getNamedDest();
+#   else
@@ -120,0 +136 @@
+#   endif
@@ -140,0 +157,3 @@
+#   if defined(HAVE_POPPLER_064)
+        GooList * children = (GooList *)outlineItem->getKids();
+#   else
@@ -141,0 +161 @@
+#   endif



It seems that the code changes required for poppler 0.60 actually relate to 0.58, and HAVE_POPPLER_060 tests should be HAVE_POPPLER_058.

Building with 0.58/9 produces errors:

/tmp/build/tmp-tdegraphics/tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc: In member function ‘TQString Poppler::Document::getInfo(const TQString&) const’:
/tmp/build/tmp-tdegraphics/tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc:159:31: error: no matching function for call to ‘PDFDoc::getDocInfo(Object*)’
   data->doc.getDocInfo( &info );
                               ^
In file included from /tmp/build/tmp-tdegraphics/tdegraphics/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc:27:
/usr/include/poppler/PDFDoc.h:232:10: note: candidate: ‘Object PDFDoc::getDocInfo()’
   Object getDocInfo() { return xref->getDocInfo(); }
          ^~~~~~~~~~

.. and more

This additional patch addresses that but is probably of little significance now because if no-one has flagged a problem so far they're not likely to now that poppler is at version 0.67.

--- config.h.cmake
+++ config.h.cmake
@@ -5 +5 @@
-#cmakedefine HAVE_POPPLER_060
+#cmakedefine HAVE_POPPLER_058
--- tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
+++ tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
@@ -27,3 +27,3 @@
-if( NOT DEFINED HAVE_POPPLER_060 )
-  message( STATUS "Performing Test HAVE_POPPLER_060" )
-  if( NOT POPPLER_VERSION VERSION_LESS "0.60" )
+if( NOT DEFINED HAVE_POPPLER_058 )
+  message( STATUS "Performing Test HAVE_POPPLER_058" )
+  if( NOT POPPLER_VERSION VERSION_LESS "0.58" )
@@ -30,2 +30,2 @@
-    set( HAVE_POPPLER_060 1 CACHE INTERNAL "" FORCE )
-    message( STATUS "Performing Test HAVE_POPPLER_060 - Success" )
+    set( HAVE_POPPLER_058 1 CACHE INTERNAL "" FORCE )
+    message( STATUS "Performing Test HAVE_POPPLER_058 - Success" )
@@ -33,2 +33,2 @@
-    set( HAVE_POPPLER_060 "" CACHE INTERNAL "" FORCE )
-    message( STATUS "Performing Test HAVE_POPPLER_060 - Failed" )
+    set( HAVE_POPPLER_058 "" CACHE INTERNAL "" FORCE )
+    message( STATUS "Performing Test HAVE_POPPLER_058 - Failed" )
--- tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
+++ tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
@@ -156 +156 @@
-# if defined(HAVE_POPPLER_060)
+# if defined(HAVE_POPPLER_058)
@@ -173 +173 @@
-#   if defined(HAVE_POPPLER_060)
+#   if defined(HAVE_POPPLER_058)
@@ -209 +209 @@
-#   if !defined(HAVE_POPPLER_060)
+#   if !defined(HAVE_POPPLER_058)
@@ -215 +215 @@
-# if !defined(HAVE_POPPLER_060)
+# if !defined(HAVE_POPPLER_058)
@@ -230 +230 @@
-# if defined(HAVE_POPPLER_060)
+# if defined(HAVE_POPPLER_058)
@@ -236 +236 @@
-#   if !defined(HAVE_POPPLER_060)
+#   if !defined(HAVE_POPPLER_058)
@@ -249 +249 @@
-#   if defined(HAVE_POPPLER_060)
+#   if defined(HAVE_POPPLER_058)
@@ -267 +267 @@
-#	if !defined(HAVE_POPPLER_060)
+#	if !defined(HAVE_POPPLER_058)
@@ -275 +275 @@
-# if !defined(HAVE_POPPLER_060)
+# if !defined(HAVE_POPPLER_058)
@@ -362 +362 @@
-#if defined(HAVE_POPPLER_060) || defined(HAVE_POPPLER_030)
+#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030)
--- tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc
+++ tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc
@@ -132 +132 @@
-#if defined(HAVE_POPPLER_060) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
+#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
@@ -167 +167 @@
-#if defined(HAVE_POPPLER_060) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
+#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
@@ -208 +208 @@
-#   if defined(HAVE_POPPLER_060)
+#   if defined(HAVE_POPPLER_058)
@@ -215 +215 @@
-#   if !defined(HAVE_POPPLER_060)
+#   if !defined(HAVE_POPPLER_058)
Comment 6 Slávek Banko 2018-09-05 17:19:12 CDT
Created attachment 2896 [details]
Fix FTBFS with poppler 064

I have tested that for all the related places we can change the variables to 'const'. Unfortunately, it not matter only to us, and the use of 'const' would cause FTBFS with older versions of Poppler. Therefore, I made the CONST_064 constant, which can be used on these places. In all cases, there is no need to force a cast now.

Please test attached patch.
Comment 7 Slávek Banko 2018-09-08 07:44:10 CDT
Pushed to GIT in commits 594387b4 and a0163f4c (master), 8063c4fe and 1b6cfc41 (r14.0.x).