Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691480 - media-libs/opencv-3.4.1-r6: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
Summary: media-libs/opencv-3.4.1-r6: error: invalid conversion from 'const char*' to '...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords: PATCH
: 691558 (view as bug list)
Depends on:
Blocks: 691460
  Show dependency tree
 
Reported: 2019-08-05 09:12 UTC by Helmut Jarausch
Modified: 2019-08-10 20:15 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
opencv build.log (build.log.bz2,495.46 KB, application/x-bzip)
2019-08-08 00:37 UTC, Kenton Groombridge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2019-08-05 09:12:04 UTC
This version (and some older versions) don't compile (with Python3.7)
due to
/var/tmp/portage/media-libs/opencv-3.4.1-r6/work/opencv-3.4.1/modules/python/src2/cv2.cpp: In function 'bool pyopencv_to(PyObject*, T&, const char*) [with T = cv::String; PyObject = _object]':
/var/tmp/portage/media-libs/opencv-3.4.1-r6/work/opencv-3.4.1/modules/python/src2/cv2.cpp:889:34: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]


This can be fixed by

--- a/modules/python/src2/cv2.cpp.ORIG	2019-04-23 18:21:34.011908756 +0200
+++ b/modules/python/src2/cv2.cpp	2019-04-23 18:28:52.520932776 +0200
@@ -886,7 +886,7 @@
     (void)name;
     if(!obj || obj == Py_None)
         return true;
-    char* str = PyString_AsString(obj);
+    const char* str = PyString_AsString(obj);
     if(!str)
         return false;
     value = String(str);
Comment 1 picarica 2019-08-05 13:33:55 UTC
i am unable to apply your suggested patch

http://dpaste.com/0BQFGT0 build log

http://dpaste.com/06AEWXF --info

http://dpaste.com/2KMZKJ6 -pqv
Comment 2 Alex 2019-08-05 22:05:43 UTC
it works, thanks!

@picarica: I've placed the patch in /etc/portage/patches/media-libs/opencv-3.4.1-r6/ , too - compiles fine.
Comment 3 Geoff Madden 2019-08-06 09:19:33 UTC
(In reply to Alex from comment #2)
> it works, thanks!
> 
> @picarica: I've placed the patch in
> /etc/portage/patches/media-libs/opencv-3.4.1-r6/ , too - compiles fine.

I can  also confirm the patch works .
Comment 4 Michael Brakemeier 2019-08-06 10:26:14 UTC
(In reply to Alex from comment #2)
> it works, thanks!
> 
> @picarica: I've placed the patch in
> /etc/portage/patches/media-libs/opencv-3.4.1-r6/ , too - compiles fine.

ACK. Works for me, too.
Comment 5 Andreas Sturmlechner gentoo-dev 2019-08-06 17:24:38 UTC
Thanks for your patch, but when did we stop attaching build.log to bugs?
Comment 6 Andreas Sturmlechner gentoo-dev 2019-08-06 17:25:27 UTC
*** Bug 691558 has been marked as a duplicate of this bug. ***
Comment 7 Kenton Groombridge 2019-08-08 00:37:50 UTC
Created attachment 586104 [details]
opencv build.log
Comment 8 Andrey Grozin gentoo-dev 2019-08-08 13:15:33 UTC
Yes, the proposed patch works
Comment 9 Larry the Git Cow gentoo-dev 2019-08-10 20:15:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f94b3d13ae8e6a49cea026ee62d70f2b07f9d2d7

commit f94b3d13ae8e6a49cea026ee62d70f2b07f9d2d7
Author:     Alexey Shvetsov <alexxy@gentoo.org>
AuthorDate: 2019-08-10 20:13:38 +0000
Commit:     Alexey Shvetsov <alexxy@gentoo.org>
CommitDate: 2019-08-10 20:14:51 +0000

    media-libs/opencv: Fix py3.7 build
    
    Follwoup to ac064acc48d43d7bfbf12c0985c5b0667454600b
    
    Closes: https://bugs.gentoo.org/691480
    Package-Manager: Portage-2.3.71, Repoman-2.3.17
    Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>

 media-libs/opencv/files/opencv-3.4.1-python37.patch | 12 ++++++++++++
 media-libs/opencv/opencv-3.4.1-r6.ebuild            |  1 +
 2 files changed, 13 insertions(+)