Opened 8 years ago

Closed 8 years ago

#53022 closed defect (fixed)

opencv @3.1.0_6+python34: Portfile broken for variant +python34

Reported by: detlevd (Detlev Droege) Owned by: mkae (Marko Käning)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: stromnov (Andrey Stromnov)
Port: opencv

Description

On macOS 10.11 I installed opencv +python34, but the portfile causes python35 and friends to be installed (alltough for py34 everything is there):

me@mymac> sudo port install opencv +python34
--->  Computing dependencies for opencv
--->  Dependencies to be installed: py35-numpy py35-cython python35 py35-nose py35-setuptools
  ...

Furthermore, the stuff is then installed in .../3.5/lib/python3.5/site-packages where my python 3.4 scripts don't find them.

Compared to earlier versions of the Portfile (opencv @3.1.0_4+python34), instead of explicit variant descriptions, the current one (opencv @3.1.0_6+python34) contains some loop over python versions

set pythonversions {3.4 3.5}
foreach pdv ${pythonversions} {
    set pv [join [lrange [split ${pdv} .] 0 1] ""]
    set conflist ""
    foreach v ${pythonversions} {
      ...

which apparently does not work as expected.

Workaround: delete '3.5' from the 'pythonversions' list to get a working "+python34" variant.

Attachments (1)

opencv-python-fix.diff (2.1 KB) - added by RJVB (René Bertin) 8 years ago.
fix the +python34 build issue (and removes an inexistant CMake option). A revbump is not required.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Owner: set to stromnov
Status: newassigned

In the future, please Cc the port maintainers (port info --maintainers opencv), if any.

comment:2 Changed 8 years ago by RJVB (René Bertin)

My bad, defining variants (or subports) in a loop that set dependencies or configure arguments that contain loop variables can lead to unexpected results, and I've already been bitten by it before. If it's that the fix is easy enough and I'll upload a patch shortly.

detlevd, you seem handy enough to tinker around in Portfiles, could you apply and test the patch when you see it please?

Changed 8 years ago by RJVB (René Bertin)

Attachment: opencv-python-fix.diff added

fix the +python34 build issue (and removes an inexistant CMake option). A revbump is not required.

comment:3 Changed 8 years ago by detlevd (Detlev Droege)

René - thanks for the patch! I applied it to the opencv Portfile and performed an upgrade --force on opencv. Everything works as expected now. No more dependecies on python35 in variant +python34. Scripts using 'import cv2' now work as before. I did not check it for +python35 though.

comment:4 Changed 8 years ago by mkae (Marko Käning)

Cc: mkae added

comment:5 Changed 8 years ago by mkae (Marko Käning)

Cc: stromnov added
Owner: changed from stromnov to mkae

comment:6 Changed 8 years ago by mkae (Marko Käning)

Cc: mkae removed
Version: 2.3.4

comment:7 Changed 8 years ago by mkae (Marko Käning)

Resolution: fixed
Status: assignedclosed

In 26d39ec4/macports-ports:

opencv: fix broken variant handling

revbump to force rebuild due to wrongly spelled configure option

Closes: #53022

Note: See TracTickets for help on using tickets.