Bug 196021

Summary: graphics/opencv: pkg-config file is broken
Product: Ports & Packages Reporter: Koop Mast <kwm>
Component: Individual Port(s)Assignee: Jason E. Hale <jhale>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (jhale)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
pkg-config patch from debian none

Description Koop Mast freebsd_committer freebsd_triage 2014-12-16 10:44:02 UTC
Created attachment 150636 [details]
pkg-config patch from debian

There are bugs with the pkg-config file supplied by the opencv[-core] ports. This makes it so that the gstreamer1-plugins-opencv doesn't actualy link against the needed libraries. Attached is a patch from debian which resolves this problem. The problem has also been reported upsteam.

The out put on Debian:
> pkg-config --libs opencv
/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/x86_64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/x86_64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab

The current result from our ports tree:
> pkg-config --libs opencv-core
/usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_imgproc.so
> pkg-config --libs opencv
/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_ocl.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so -lpthread -lm

> ldd /usr/local/lib/gstreamer-1.0/libgstopencv.so
/usr/local/lib/gstreamer-1.0/libgstopencv.so:
        libgstbase-1.0.so.0 => /usr/local/lib/libgstbase-1.0.so.0 (0x801626000)
        libgstreamer-1.0.so.0 => /usr/local/lib/libgstreamer-1.0.so.0 (0x801880000)
        libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x801b90000)
        libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x801dd8000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x8020df000)
        libthr.so.3 => /lib/libthr.so.3 (0x8022ea000)
        libgstvideo-1.0.so.0 => /usr/local/lib/libgstvideo-1.0.so.0 (0x80250f000)
        libc++.so.1 => /usr/lib/libc++.so.1 (0x80275b000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x802a1a000)
        libm.so.5 => /lib/libm.so.5 (0x802c36000)
        libc.so.7 => /lib/libc.so.7 (0x80081f000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x802e5f000)
        libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x80306d000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x803270000)
        libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x80356a000)
        libffi.so.6 => /usr/local/lib/libffi.so.6 (0x8037dd000)
        liborc-0.4.so.0 => /usr/local/lib/liborc-0.4.so.0 (0x8039e4000)


The result with the pkg-config patch applied.
> pkg-config --libs opencv-core
-L/usr/local/lib /usr/local/lib/libopencv_core.so -lopencv_core /usr/local/lib/libopencv_imgproc.so -lopencv_imgproc
> pkg-config --libs opencv
-L/usr/local/lib /usr/local/lib/libopencv_calib3d.so -lopencv_calib3d /usr/local/lib/libopencv_contrib.so -lopencv_contrib /usr/local/lib/libopencv_core.so -lopencv_core /usr/local/lib/libopencv_features2d.so -lopencv_features2d /usr/local/lib/libopencv_flann.so -lopencv_flann /usr/local/lib/libopencv_gpu.so -lopencv_gpu /usr/local/lib/libopencv_highgui.so -lopencv_highgui /usr/local/lib/libopencv_imgproc.so -lopencv_imgproc /usr/local/lib/libopencv_legacy.so -lopencv_legacy /usr/local/lib/libopencv_ml.so -lopencv_ml /usr/local/lib/libopencv_objdetect.so -lopencv_objdetect /usr/local/lib/libopencv_ocl.so -lopencv_ocl /usr/local/lib/libopencv_photo.so -lopencv_photo /usr/local/lib/libopencv_stitching.so -lopencv_stitching /usr/local/lib/libopencv_superres.so -lopencv_superres /usr/local/lib/libopencv_ts.a -lopencv_ts /usr/local/lib/libopencv_video.so -lopencv_video /usr/local/lib/libopencv_videostab.so -lopencv_videostab -lpthread -lm

> ldd /usr/local/lib/gstreamer-1.0/libgstopencv.so
/usr/local/lib/gstreamer-1.0/libgstopencv.so:
        libgstbase-1.0.so.0 => /usr/local/lib/libgstbase-1.0.so.0 (0x801626000)
        libgstreamer-1.0.so.0 => /usr/local/lib/libgstreamer-1.0.so.0 (0x801880000)
        libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x801b90000)
        libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x801dd8000)
        libintl.so.8 => /usr/local/lib/libintl.so.8 (0x8020df000)
        libopencv_calib3d.so.2 => /usr/local/lib/libopencv_calib3d.so.2 (0x8022ea000)
        libopencv_contrib.so.2 => /usr/local/lib/libopencv_contrib.so.2 (0x80258e000)
        libopencv_core.so.2 => /usr/local/lib/libopencv_core.so.2 (0x802a00000)
        libopencv_features2d.so.2 => /usr/local/lib/libopencv_features2d.so.2 (0x802e58000)
        libopencv_flann.so.2 => /usr/local/lib/libopencv_flann.so.2 (0x803100000)
        libopencv_gpu.so.2 => /usr/local/lib/libopencv_gpu.so.2 (0x80337a000)
        libopencv_highgui.so.2 => /usr/local/lib/libopencv_highgui.so.2 (0x803596000)
        libopencv_imgproc.so.2 => /usr/local/lib/libopencv_imgproc.so.2 (0x803800000)
        libopencv_legacy.so.2 => /usr/local/lib/libopencv_legacy.so.2 (0x803cad000)
        libopencv_ml.so.2 => /usr/local/lib/libopencv_ml.so.2 (0x803fb4000)
        libopencv_objdetect.so.2 => /usr/local/lib/libopencv_objdetect.so.2 (0x804230000)
        libopencv_ocl.so.2 => /usr/local/lib/libopencv_ocl.so.2 (0x8044af000)
        libopencv_photo.so.2 => /usr/local/lib/libopencv_photo.so.2 (0x80488f000)
        libopencv_stitching.so.2 => /usr/local/lib/libopencv_stitching.so.2 (0x804aac000)
        libopencv_superres.so.2 => /usr/local/lib/libopencv_superres.so.2 (0x804d26000)
        libopencv_video.so.2 => /usr/local/lib/libopencv_video.so.2 (0x804f5a000)
        libopencv_videostab.so.2 => /usr/local/lib/libopencv_videostab.so.2 (0x8051a5000)
        libthr.so.3 => /lib/libthr.so.3 (0x8053d4000)
        libgstvideo-1.0.so.0 => /usr/local/lib/libgstvideo-1.0.so.0 (0x8055f9000)
        libc++.so.1 => /usr/lib/libc++.so.1 (0x805845000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x805b04000)
        libm.so.5 => /lib/libm.so.5 (0x805d20000)
        libc.so.7 => /lib/libc.so.7 (0x80081f000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x805f49000)
        libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x806157000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80635a000)
        libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x806654000)
        libffi.so.6 => /usr/local/lib/libffi.so.6 (0x8068c7000)
        libz.so.6 => /lib/libz.so.6 (0x806ace000)
        libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x806ce4000)
        libpng15.so.15 => /usr/local/lib/libpng15.so.15 (0x806f1f000)
        libtiff.so.4 => /usr/local/lib/libtiff.so.4 (0x807151000)
        libjasper.so.4 => /usr/local/lib/libjasper.so.4 (0x8073c2000)
        libv4l1.so.0 => /usr/local/lib/libv4l1.so.0 (0x807620000)
        liborc-0.4.so.0 => /usr/local/lib/liborc-0.4.so.0 (0x807826000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x807abc000)
        libjbig.so.2 => /usr/local/lib/libjbig.so.2 (0x807ce1000)
        libv4l2.so.0 => /usr/local/lib/libv4l2.so.0 (0x807eee000)
        libv4lconvert.so.0 => /usr/local/lib/libv4lconvert.so.0 (0x8080fa000)
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-16 10:44:02 UTC
Auto-assigned to maintainer jhale@FreeBSD.org
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-04-16 08:02:11 UTC
A commit references this bug:

Author: kwm
Date: Thu Apr 16 08:01:50 UTC 2015
New revision: 384091
URL: https://svnweb.freebsd.org/changeset/ports/384091

Log:
  Add patch from debian to fix the installed pkg-config files.
  This allows the gstreamer plugin to actualy link to the needed opencv libraries.

  PR:		196021
  Approved by:	maintainer timeout (4 months)
  Obtained from:	debian

Changes:
  head/graphics/opencv/Makefile
  head/graphics/opencv/files/patch-pkg-config
  head/graphics/opencv-core/Makefile