Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 593504 - media-libs/opencv-3.1.0-r4 patch to enable multiple python versions
Summary: media-libs/opencv-3.1.0-r4 patch to enable multiple python versions
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
Depends on:
Blocks:
 
Reported: 2016-09-11 17:18 UTC by Karsten Merkle
Modified: 2016-10-29 10:12 UTC (History)
3 users (show)

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


Attachments
multipy.patch (multipy.patch,2.08 KB, patch)
2016-09-11 17:18 UTC, Karsten Merkle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Merkle 2016-09-11 17:18:30 UTC
Created attachment 445488 [details, diff]
multipy.patch

This patch for the opencv-3.1.0-r4.ebuild enabled the cv2 module in python2.7 and python3.4 on my PC.
It shouldn't change anything else, please give it a try.
Comment 1 Jonathan Scruggs (RETIRED) gentoo-dev 2016-09-13 18:00:22 UTC
I've been helping Amynka with this. When I helped with the -r4 ebuild, I wanted to try to have it install the module for all versions of python a person wanted, but the build system had ... limitations.

Just a couple of notes about the patch:
1) run_in_build_dir is no longer a function in python-r1.eclass, or others. I looked through them, but couldn't find it. Don't know why they removed it.
2) Since the above function doesn't work, new build dirs are defined for each impl of python.
3) Means that OpenCV compiles for each impl. CMake is smart enough to not recompile already compiled objects.
4) If in theory the source was built in the same directory, it would not compile or install all versions, just the latest impl as the configure would overwrite the previous ones.

It took awhile, but I propose this one:
https://github.com/dracwyrm/gentoo-ebuilds/blob/master/media-libs/opencv/opencv-3.1.0-r5.ebuild
It does the configure, compile, and install in the same function so the configure phase doesn't overwrite before the compile and install phases. This also means that opencv main part is compiled once, then the modules. It should be quicker.

Let me know if this works. For some reason the modules are installed in the right directories, but each have a different name. I may need to tweak it a bit more, but it's a start. Unless your ebuild has the modules as weird names as well.
Comment 2 Amy Liffey gentoo-dev 2016-10-29 10:12:47 UTC
author	Jonathan Scruggs <j.scruggs@gmail.com>	2016-09-22 17:08:23 (GMT)
committer	Amy Winston <amynka@gentoo.org>	2016-09-27 14:22:31 (GMT)
commit	366480ac81d84673ffbbfcfff277a91d6c6041df 

media-libs/opencv: revision bump to 3.1.0-r5
- Feature: added in support for installing the Python module for each
  implementation selected
  Gentoo-Bug: 593504

- Bug fix: under certain conditions the HDF5 library isn't found
  Gentoo-Bug: 588850

- Bug fix: OpenGL needs Qt or Gtk+ otherwise it's disabled

- Misc: cleaned up usex expressions
        added qtwidgets depend
        moved openmp detection to pkg_pretend as per Gentoo style guidelines

Signed off by Jonathan Scruggs (j.scruggs@gmail.com, irc: Dracwyrm)