Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2013 22:03:28 +0000 (UTC)
From:      "Jason E. Hale" <jhale@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r331331 - in head/graphics/opencv: . files
Message-ID:  <201310222203.r9MM3SVx070688@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhale
Date: Tue Oct 22 22:03:28 2013
New Revision: 331331
URL: http://svnweb.freebsd.org/changeset/ports/331331

Log:
  - Fix typos in EIGEN option
  - Fix build with modern compilers in the contrib module [1]
  - Fix build of opencv-core with clang in the ts module [2]
  - Fix build with QT option [3]
  - Fix build of py-opencv with clang [4]
  
  Reported by:	avg [1], Robert Huff <roberthuff@rcn.com> [2]
  PR:		ports/182443 [3], ports/182837 [4]
  Submitted by:	O. Hartmann <ohartman@zedat.fu-berlin.de> [3], pawel [4]

Added:
  head/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp   (contents, props changed)
  head/graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp   (contents, props changed)
  head/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp   (contents, props changed)
Modified:
  head/graphics/opencv/Makefile

Modified: head/graphics/opencv/Makefile
==============================================================================
--- head/graphics/opencv/Makefile	Tue Oct 22 22:00:04 2013	(r331330)
+++ head/graphics/opencv/Makefile	Tue Oct 22 22:03:28 2013	(r331331)
@@ -17,7 +17,8 @@ LICENSE_FILE=	${WRKSRC}/doc/license.txt
 WANT_GSTREAMER=	yes
 MAKE_JOBS_UNSAFE=	yes
 USE_BZIP2=	yes
-USES=		cmake pkgconfig
+USES=		compiler:features cmake pkgconfig
+USE_DOS2UNIX=	yes
 USE_LDCONFIG=	yes
 
 WRKSRC=		${WRKDIR}/OpenCV-${DISTVERSION}
@@ -28,12 +29,6 @@ NOT_FOR_ARCHS_REASON_sparc64=	does not c
 DATADIR=	${PREFIX}/share/OpenCV
 PLIST_SUB+=	VERSION=${DISTVERSION}
 
-_COMPVERSION!=	${CC} --version
-.if ${_COMPVERSION:Mclang}
-USE_CXXSTD=	gnu++11
-CXXFLAGS+=	-Wno-error -Wno-c++11-narrowing
-.endif
-
 .if !defined(_BUILDING_OPENCV_CORE) && !defined(_BUILDING_OPENCV_PYTHON)
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-opencv
 LIB_DEPENDS+=	libopencv_core.so.2:${PORTSDIR}/graphics/opencv-core
@@ -41,14 +36,14 @@ LDFLAGS+=	-L${LOCALBASE}/lib -lopencv_co
 
 PORTDOCS=	*
 
-OPTIONS_DEFINE=		EIGEN2 FFMPEG GSTREAMER GTK2 JASPER JPEG OPENEXR PNG \
+OPTIONS_DEFINE=		EIGEN3 FFMPEG GSTREAMER GTK2 JASPER JPEG OPENEXR PNG \
 			QT4 TBB TIFF V4L XINE EXAMPLES
 OPTIONS_DEFAULT=	EIGEN3 JASPER JPEG PNG TIFF V4L
 
 EIGEN3_DESC=		Eigen 3 support
 EIGEN3_BUILD_DEPENDS=	${LOCALBASE}/include/eigen3/Eigen/Eigen:${PORTSDIR}/math/eigen3
 EIGEN3_CMAKE_ON=	-DWITH_EIGEN:BOOL=On
-EIGEN3_CMAKE_OFF=	-DDWITH_EIGEN:BOOL=Off
+EIGEN3_CMAKE_OFF=	-DWITH_EIGEN:BOOL=Off
 
 FFMPEG_LIB_DEPENDS=	libavcodec0.so:${PORTSDIR}/multimedia/ffmpeg0
 FFMPEG_CMAKE_ON=	-DWITH_FFMPEG:BOOL=On
@@ -143,7 +138,7 @@ RUN_DEPENDS+=	${PYNUMPY}
 CMAKE_ARGS+=	-DBUILD_EXAMPLES:BOOL=Off \
 		-DINSTALL_PYTHON_EXAMPLES:BOOL=Off \
 		-DBUILD_TESTS:BOOL=Off \
-		-DDWITH_EIGEN2:BOOL=Off \
+		-DWITH_EIGEN:BOOL=Off \
 		-DWITH_FFMPEG:BOOL=Off \
 		-DWITH_GSTREAMER:BOOL=Off \
 		-DWITH_GTK:BOOL=Off \
@@ -169,6 +164,11 @@ CMAKE_ARGS+=	-DBUILD_NEW_PYTHON_SUPPORT:
 
 .include <bsd.port.pre.mk>
 
+.if ${COMPILER_TYPE}=="clang"
+USE_CXXSTD=	c++11
+CXXFLAGS+=	-stdlib=libc++ -Wno-error -Wno-c++11-narrowing
+.endif
+
 post-patch:
 	@${MKDIR} ${CONFIGURE_WRKSRC}
 	@${REINPLACE_CMD} -e 's:set(OPENCV_SOVERSION.*:set(OPENCV_SOVERSION "$${OPENCV_VERSION_MAJOR}"):' \

Added: head/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp	Tue Oct 22 22:03:28 2013	(r331331)
@@ -0,0 +1,37 @@
+--- ./modules/contrib/src/spinimages.cpp.orig	2013-10-22 07:55:31.000000000 -0400
++++ ./modules/contrib/src/spinimages.cpp	2013-10-22 07:55:51.000000000 -0400
+@@ -85,7 +85,7 @@
+     };
+     size_t colors_mum = sizeof(colors)/sizeof(colors[0]);
+ 
+-template<class FwIt, class T> void iota(FwIt first, FwIt last, T value) { while(first != last) *first++ = value++; }
++template<class FwIt, class T> void _iota(FwIt first, FwIt last, T value) { while(first != last) *first++ = value++; }
+ 
+ void computeNormals( const Octree& Octree, const vector<Point3f>& centers, vector<Point3f>& normals, 
+                     vector<uchar>& mask, float normalRadius, int minNeighbors = 20)
+@@ -790,14 +790,14 @@
+     else if (setSize == vtxSize)
+     {
+         subset.resize(vtxSize);
+-        iota(subset.begin(), subset.end(), 0);
++        _iota(subset.begin(), subset.end(), 0);
+     }
+     else
+     {
+         RNG& rnd = theRNG();
+ 
+         vector<size_t> left(vtxSize);
+-        iota(left.begin(), left.end(), (size_t)0);
++        _iota(left.begin(), left.end(), (size_t)0);
+ 
+         subset.resize(setSize);
+         for(size_t i = 0; i < setSize; ++i)
+@@ -870,7 +870,7 @@
+     {
+         mesh.computeNormals(normalRadius, minNeighbors);
+         subset.resize(mesh.vtx.size());
+-        iota(subset.begin(), subset.end(), 0);
++        _iota(subset.begin(), subset.end(), 0);
+     }
+     else
+         mesh.computeNormals(subset, normalRadius, minNeighbors);

Added: head/graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp	Tue Oct 22 22:03:28 2013	(r331331)
@@ -0,0 +1,11 @@
+--- ./modules/highgui/src/window_QT.cpp.orig	2013-10-22 11:01:57.000000000 -0400
++++ ./modules/highgui/src/window_QT.cpp	2013-10-22 11:03:10.000000000 -0400
+@@ -46,6 +46,8 @@
+ #ifdef _WIN32
+ #include <windows.h>
+ #define usleep Sleep
++#else
++#include <unistd.h>
+ #endif
+ 
+ #ifndef M_PI

Added: head/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp	Tue Oct 22 22:03:28 2013	(r331331)
@@ -0,0 +1,11 @@
+--- ./modules/python/src2/cv2.cv.hpp.orig	2013-10-22 17:54:10.000000000 -0400
++++ ./modules/python/src2/cv2.cv.hpp	2013-10-22 17:55:03.000000000 -0400
+@@ -2169,7 +2169,7 @@
+ static int convert_to_CvNextEdgeType(PyObject *o, CvNextEdgeType *dst, const char *name = "no_name")
+ {
+   if (!PyInt_Check(o)) {
+-    *dst = (CvNextEdgeType)NULL;
++    *dst = (CvNextEdgeType)0;
+     return failmsg("Expected number for CvNextEdgeType argument '%s'", name);
+   } else {
+     *dst = (CvNextEdgeType)PyInt_AsLong(o);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310222203.r9MM3SVx070688>