Bug 253118

Summary: graphics/gstreamer1-plugins-opencv and graphics/frei0r-plugins-opencv: fails to build after update graphics/opencv to 4.5
Product: Ports & Packages Reporter: VVD <vvd>
Component: Individual Port(s)Assignee: freebsd-multimedia (Nobody) <multimedia>
Status: New ---    
Severity: Affects Some People CC: tcberner
Priority: --- Flags: bugzilla: maintainer-feedback? (multimedia)
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
Unbreak build graphics/gstreamer1-plugins-opencv: replace "opencv4 < 4.2.0" on "opencv4 < 5.0.0"
vvd: maintainer-approval?
Unbreak build of graphics/frei0r-plugins-opencv if math/vtk9 was installed before build of graphics/opencv vvd: maintainer-approval?

Description VVD 2021-01-31 11:05:50 UTC
Created attachment 222035 [details]
Unbreak build graphics/gstreamer1-plugins-opencv: replace "opencv4 < 4.2.0" on "opencv4 < 5.0.0"

Can't detect opencv 4.5.0 due limitation on < 4.2.0 in configure script.

There is 2nd bug: can't find -lopencv_viz - not installed by graphics/opencv, but exist in libdata/pkgconfig/opencv4.pc.

Testing graphics/opencv - very long build…
Comment 1 VVD 2021-01-31 12:00:44 UTC
make check-plist

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: include/opencv4/opencv2/viz.hpp
Error: Orphaned: include/opencv4/opencv2/viz/types.hpp
Error: Orphaned: include/opencv4/opencv2/viz/viz3d.hpp
Error: Orphaned: include/opencv4/opencv2/viz/vizcore.hpp
Error: Orphaned: include/opencv4/opencv2/viz/widget_accessor.hpp
Error: Orphaned: include/opencv4/opencv2/viz/widgets.hpp
Error: Orphaned: lib/libopencv_viz.so
Error: Orphaned: lib/libopencv_viz.so.4.5
Error: Orphaned: lib/libopencv_viz.so.4.5.1
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

make: stopped in /usr/ports/graphics/opencv
Comment 2 VVD 2021-01-31 13:06:07 UTC
graphics/frei0r-plugins-opencv fails to build too:

CMake Error at /usr/local/lib/cmake/opencv4/OpenCVModules.cmake:473 (message):
  The imported target "opencv_viz" references the file


  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained


  but not all the files it references.

Call Stack (most recent call first):
  /usr/local/lib/cmake/opencv4/OpenCVConfig.cmake:126 (include)
  CMakeLists.txt:11 (find_package)

-- Configuring incomplete, errors occurred!

/usr/local/lib/cmake/opencv4/OpenCVConfig.cmake and /usr/local/lib/cmake/opencv4/OpenCVModules-release.cmake have substring opencv_viz.
Comment 3 commit-hook freebsd_committer 2021-01-31 16:33:10 UTC
A commit references this bug:

Author: tcberner
Date: Sun Jan 31 16:32:31 UTC 2021
New revision: 563495
URL: https://svnweb.freebsd.org/changeset/ports/563495

  graphics/gstreamer*-plugins-opencv: fix fallout form OpenCV-4.5.1 upgrade

  * graphics/gstreamer-plugins-opencv: disabled, as it uses the no longer shipped OpenCV-1.0 API
  * graphics/gstreamer1-plugins-opencv: fix the configure script to not only look for OpenCV4 <= 4.2.0
    => this will be properly fixed with the next upgrade of gstreamer when switching to the meson
    build system.

  PR:		253118
  Submitted by:	VVD <vvd@unislabs.com>
  Reported by:	rhurlin, fluffy, VVD <vvd@unislabs.com>

Comment 4 VVD 2021-02-01 12:14:33 UTC
Created attachment 222068 [details]
Unbreak build of graphics/frei0r-plugins-opencv if math/vtk9 was installed before build of graphics/opencv

Suppress using GTK if installed.
Turn off search of WITH_GDAL and WITH_GDCM - they require other libraries.