aboutsummaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorjhale <jhale@FreeBSD.org>2013-10-23 06:03:28 +0800
committerjhale <jhale@FreeBSD.org>2013-10-23 06:03:28 +0800
commitcb53a7dff62f0aba485d0447d22c52ced566838e (patch)
tree7a403317bdefd4c7d4a7d0973a6da6af48e07a0d /graphics
parente481b41836cb66a73d587d09b1800341c9ad9abe (diff)
downloadfreebsd-ports-gnome-cb53a7dff62f0aba485d0447d22c52ced566838e.tar.gz
freebsd-ports-gnome-cb53a7dff62f0aba485d0447d22c52ced566838e.tar.zst
freebsd-ports-gnome-cb53a7dff62f0aba485d0447d22c52ced566838e.zip
- 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]
Diffstat (limited to 'graphics')
-rw-r--r--graphics/opencv/Makefile20
-rw-r--r--graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp37
-rw-r--r--graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp11
-rw-r--r--graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp11
4 files changed, 69 insertions, 10 deletions
diff --git a/graphics/opencv/Makefile b/graphics/opencv/Makefile
index f42a00c87863..ccb34c0a19d0 100644
--- a/graphics/opencv/Makefile
+++ b/graphics/opencv/Makefile
@@ -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 compile on sparc64
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_core
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:BOOL=Off
.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}"):' \
diff --git a/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp b/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp
new file mode 100644
index 000000000000..51b0ad576920
--- /dev/null
+++ b/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp
@@ -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);
diff --git a/graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp b/graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp
new file mode 100644
index 000000000000..291e01174ea4
--- /dev/null
+++ b/graphics/opencv/files/patch-modules__highgui__src__window_QT.cpp
@@ -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
diff --git a/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp b/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp
new file mode 100644
index 000000000000..94780cc36351
--- /dev/null
+++ b/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp
@@ -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);