From swell.k@gmail.com  Mon Jul 26 10:39:42 2010
Return-Path: <swell.k@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9DCC1065674
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Jul 2010 10:39:42 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 448778FC1F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Jul 2010 10:39:41 +0000 (UTC)
Received: by fxm13 with SMTP id 13so6512551fxm.13
        for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Jul 2010 03:39:41 -0700 (PDT)
Received: by 10.223.111.78 with SMTP id r14mr6107686fap.29.1280140780775;
        Mon, 26 Jul 2010 03:39:40 -0700 (PDT)
Received: from localhost ([95.143.193.145])
        by mx.google.com with ESMTPS id r10sm1326169faq.29.2010.07.26.03.39.37
        (version=SSLv3 cipher=RC4-MD5);
        Mon, 26 Jul 2010 03:39:39 -0700 (PDT)
Message-Id: <86wrsi3504.fsf@gmail.com>
Date: Mon, 26 Jul 2010 14:35:23 +0400
From: Anonymous <swell.k@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] graphics/opencv: use libv4l, fix gcc45 build

>Number:         148955
>Category:       ports
>Synopsis:       [patch] graphics/opencv: use libv4l, fix gcc45 build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    avilla
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 26 10:40:03 UTC 2010
>Closed-Date:    Fri Aug 27 18:43:21 UTC 2010
>Last-Modified:  Fri Aug 27 18:43:21 UTC 2010
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->avilla 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jul 26 10:40:21 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148955 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/148955: commit references a PR
Date: Fri, 27 Aug 2010 18:16:28 +0000 (UTC)

 avilla      2010-08-27 18:16:16 UTC
 
   FreeBSD ports repository
 
   Modified files:
     graphics/opencv      Makefile distinfo pkg-plist 
   Added files:
     graphics/opencv/files patch-apps-traincascade-imagestorage.h 
                           patch-samples-c-image.cpp 
   Log:
   - Upgrade to 2.1.0.
   - Fix build on 6.X.
   - Fix build with GCC 4.5. [1]
   - Fix dependency on Video4Linux. [1]
   - Add LICENSE.
   - Use bsd.port.options.mk.
   
   PR:             ports/148955 [1]
   Submitted by:   swell.k@gmail.com [1]
   Approved by:    tabthorpe (mentor)
   
   Revision  Changes    Path
   1.23      +57 -32    ports/graphics/opencv/Makefile
   1.4       +3 -3      ports/graphics/opencv/distinfo
   1.1       +10 -0     ports/graphics/opencv/files/patch-apps-traincascade-imagestorage.h (new)
   1.1       +7 -0      ports/graphics/opencv/files/patch-samples-c-image.cpp (new)
   1.5       +6 -5      ports/graphics/opencv/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: avilla 
State-Changed-When: Fri Aug 27 18:43:20 UTC 2010 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148955 
>Unformatted:
