pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/47215: print/poppler-cpp fails with error: invalid conversion from 'const char**' to 'char**' [-fpermissive]



>Number:         47215
>Category:       pkg
>Synopsis:       print/poppler-cpp fails with  error: invalid conversion from 
>'const char**' to 'char**' [-fpermissive]
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 19 09:55:00 +0000 2012
>Originator:     Richard PALO
>Release:        pkgsrc trunk
>Organization:
>Environment:
SunOS devzone 5.11 oi_151a7 i86pc i386 i86pc Solaris

>Description:
building print/poppler-cpp errors with:
gmake[1]: Entering directory 
`/tmp/pkgsrc/print/poppler-cpp/work/poppler-0.20.5/cpp'
  CXX    libpoppler_cpp_la-poppler-document.lo
  CXX    libpoppler_cpp_la-poppler-font.lo
  CXX    libpoppler_cpp_la-PNMWriter.lo
  CXX    libpoppler_cpp_la-poppler-embedded-file.lo
  CXX    libpoppler_cpp_la-poppler-global.lo
  CXX    libpoppler_cpp_la-poppler-image.lo
poppler-global.cpp: In member function 'poppler::byte_array 
poppler::ustring::to_utf8() const':
poppler-global.cpp:228:96: error: invalid conversion from 'const char**' to 
'char**' [-fpermissive]
In file included from poppler-global.cpp:29:0:
/usr/include/iconv.h:44:15: error:   initializing argument 2 of 'ulong_t 
iconv(iconv_t, char**, ulong_t*, char**, ulong_t*)' [-fpermissive]
poppler-global.cpp:234:93: error: invalid conversion from 'const char**' to 
'char**' [-fpermissive]
In file included from poppler-global.cpp:29:0:
/usr/include/iconv.h:44:15: error:   initializing argument 2 of 'ulong_t 
iconv(iconv_t, char**, ulong_t*, char**, ulong_t*)' [-fpermissive]
poppler-global.cpp: In static member function 'static poppler::ustring 
poppler::ustring::from_utf8(const char*, int)':
poppler-global.cpp:279:98: error: invalid conversion from 'const char**' to 
'char**' [-fpermissive]
In file included from poppler-global.cpp:29:0:
/usr/include/iconv.h:44:15: error:   initializing argument 2 of 'ulong_t 
iconv(iconv_t, char**, ulong_t*, char**, ulong_t*)' [-fpermissive]
poppler-global.cpp:285:95: error: invalid conversion from 'const char**' to 
'char**' [-fpermissive]
In file included from poppler-global.cpp:29:0:
/usr/include/iconv.h:44:15: error:   initializing argument 2 of 'ulong_t 
iconv(iconv_t, char**, ulong_t*, char**, ulong_t*)' [-fpermissive]
gmake[1]: *** [libpoppler_cpp_la-poppler-global.lo] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory 
`/tmp/pkgsrc/print/poppler-cpp/work/poppler-0.20.5/cpp'
gmake: *** [all-recursive] Error 1
*** Error code 2

Stop.
bmake: stopped in /home/richard/src/pkgsrc/print/poppler-cpp
*** Error code 1

Stop.
bmake: stopped in /home/richard/src/pkgsrc/print/poppler-cpp

>How-To-Repeat:
bmake clean
bmake
>Fix:
I was able to patch poppler-global.cpp replacing 'ICONV_CONST char **' with 
just 'char **' with as follows (in print/poppler):

richard@devzone:~/src/pkgsrc/print/poppler$ git diff master .
diff --git a/print/poppler/distinfo b/print/poppler/distinfo
index 3a19cf6..8d9107a 100644
--- a/print/poppler/distinfo
+++ b/print/poppler/distinfo
@@ -9,3 +9,4 @@ SHA1 (patch-ag) = 4b914e85bb08ce83305d20de9c0a3e74d3cabdd2
 SHA1 (patch-aq) = 17db7fb50937611ff253f48241503281fb642f63
 SHA1 (patch-ar) = 4799e084c83167fcd54832c172c2662c745cdba1
 SHA1 (patch-as) = f0f4f8d9f5a49173a27e2349be4b7536ed77eaae
+SHA1 (patch-cpp_poppler-global.cpp) = 19999e99db9424289f44ce224a4c4c6f8c506cfc
diff --git a/print/poppler/patches/patch-cpp_poppler-global.cpp 
b/print/poppler/patches/patch-cpp_poppler-global.cpp
new file mode 100644
index 0000000..13bb338
--- /dev/null
+++ b/print/poppler/patches/patch-cpp_poppler-global.cpp
@@ -0,0 +1,36 @@
+$NetBSD$
+
+--- cpp/poppler-global.cpp.orig        2012-05-10 20:05:44.000000000 +0000
++++ cpp/poppler-global.cpp
+@@ -225,13 +225,13 @@ byte_array ustring::to_utf8() const
+     char *str_data = &str[0];
+     size_t me_len_char = size();
+     size_t str_len_left = str.size();
+-    size_t ir = iconv(ic, (ICONV_CONST char **)&me_data, &me_len_char, 
&str_data, &str_len_left);
++    size_t ir = iconv(ic, (char **)&me_data, &me_len_char, &str_data, 
&str_len_left);
+     if ((ir == (size_t)-1) && (errno == E2BIG)) {
+         const size_t delta = str_data - &str[0];
+         str_len_left += str.size();
+         str.resize(str.size() * 2);
+         str_data = &str[delta];
+-        ir = iconv(ic, (ICONV_CONST char **)&me_data, &me_len_char, 
&str_data, &str_len_left);
++        ir = iconv(ic, (char **)&me_data, &me_len_char, &str_data, 
&str_len_left);
+         if (ir == (size_t)-1) {
+             return byte_array();
+         }
+@@ -276,13 +276,13 @@ ustring ustring::from_utf8(const char *s
+     char *str_data = const_cast<char *>(str);
+     size_t str_len_char = len;
+     size_t ret_len_left = ret.size();
+-    size_t ir = iconv(ic, (ICONV_CONST char **)&str_data, &str_len_char, 
&ret_data, &ret_len_left);
++    size_t ir = iconv(ic, (char **)&str_data, &str_len_char, &ret_data, 
&ret_len_left);
+     if ((ir == (size_t)-1) && (errno == E2BIG)) {
+         const size_t delta = ret_data - reinterpret_cast<char *>(&ret[0]);
+         ret_len_left += ret.size();
+         ret.resize(ret.size() * 2);
+         ret_data = reinterpret_cast<char *>(&ret[delta]);
+-        ir = iconv(ic, (ICONV_CONST char **)&str_data, &str_len_char, 
&ret_data, &ret_len_left);
++        ir = iconv(ic, (char **)&str_data, &str_len_char, &ret_data, 
&ret_len_left);
+         if (ir == (size_t)-1) {
+             return ustring();
+         }



Home | Main Index | Thread Index | Old Index