ports/148955: [patch] graphics/opencv: use libv4l, fix gcc45 build

Anonymous swell.k at gmail.com
Mon Jul 26 10:40:03 UTC 2010


>Number:         148955
>Category:       ports
>Synopsis:       [patch] graphics/opencv: use libv4l, fix gcc45 build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 26 10:40:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
>Description:
When libv4l is installed this ports unconditionally links against it
when V4L option is enabled.
>How-To-Repeat:
1. install multimedia/libv4l
2. install graphics/opencv
3. deinstall multimedia/libv4l
4. check ldd

----

  $ make CC=gcc45 CXX=g++45
  ...
  In file included from /a/OpenCV-2.0.0/apps/traincascade/features.h:4:0,
                   from /a/OpenCV-2.0.0/apps/traincascade/cascadeclassifier.h:5,
                   from /a/OpenCV-2.0.0/apps/traincascade/traincascade.cpp:2:
  /a/OpenCV-2.0.0/apps/traincascade/imagestorage.h:27:9: error: 'FILE' does not name a type
  /a/OpenCV-2.0.0/samples/c/image.cpp: In function 'int main(int, char**)':
  /a/OpenCV-2.0.0/samples/c/image.cpp:16:17: error: 'stderr' was not declared in this scope
  /a/OpenCV-2.0.0/samples/c/image.cpp:16:61: error: 'fprintf' was not declared in this scope
>Fix:
--- a.diff begins here ---
Index: graphics/opencv/Makefile
===================================================================
RCS file: /a/.cvsup/ports/graphics/opencv/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- graphics/opencv/Makefile	24 Jul 2010 16:38:13 -0000	1.22
+++ graphics/opencv/Makefile	26 Jul 2010 10:25:58 -0000
@@ -135,7 +135,7 @@ CMAKE_ARGS+=	-DWITH_TIFF:BOOL=Off
 .endif
 
 .if !defined(WITHOUT_V4L)
-BUILD_DEPENDS+=	${LOCALBASE}/include/linux/videodev.h:${PORTSDIR}/multimedia/v4l_compat
+LIB_DEPENDS+=	v4l2.0:${PORTSDIR}/multimedia/libv4l
 CMAKE_ARGS+=	-DWITH_V4L:BOOL=On \
 		-DCMAKE_REQUIRED_INCLUDES:STRING="${LOCALBASE}/include"
 .else
Index: graphics/opencv/files/patch-apps-traincascade-imagestorage.h
===================================================================
RCS file: graphics/opencv/files/patch-apps-traincascade-imagestorage.h
diff -N graphics/opencv/files/patch-apps-traincascade-imagestorage.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ graphics/opencv/files/patch-apps-traincascade-imagestorage.h	26 Jul 2010 10:14:03 -0000
@@ -0,0 +1,10 @@
+--- apps/traincascade/imagestorage.h~
++++ apps/traincascade/imagestorage.h
+@@ -1,6 +1,7 @@
+ #ifndef _OPENCV_IMAGESTORAGE_H_
+ #define _OPENCV_IMAGESTORAGE_H_
+ 
++#include <cstdio>
+ #include <highgui.h>
+ 
+ using namespace cv;
Index: graphics/opencv/files/patch-samples-c-image.cpp
===================================================================
RCS file: graphics/opencv/files/patch-samples-c-image.cpp
diff -N graphics/opencv/files/patch-samples-c-image.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ graphics/opencv/files/patch-samples-c-image.cpp	26 Jul 2010 10:13:54 -0000
@@ -0,0 +1,7 @@
+--- samples/c/image.cpp~
++++ samples/c/image.cpp
+@@ -1,3 +1,4 @@
++#include <cstdio>
+ #include "cv.h" // include standard OpenCV headers, same as before
+ #include "highgui.h"
+ 
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list