svn commit: r334856 - in head/graphics/opencv: . files

Jason E. Hale jhale at FreeBSD.org
Mon Nov 25 15:19:01 UTC 2013


Author: jhale
Date: Mon Nov 25 15:19:00 2013
New Revision: 334856
URL: http://svnweb.freebsd.org/changeset/ports/334856

Log:
  - Allow build with clang without libc++ on 8.x and 9.x [1][2][3]
  - Fix build on powerpc64 [4]
  
  PR:		ports/183238 [1], ports/183954 [2], ports/182046 [4]
  Submitted by:	Chess Griffin <chess at chessgriffin.com> [1],
  		Guillaume Bibaut <yom at iaelu.net> [2],
  		jhibbits [4]
  Patched by:	tijl (via private mail) [3]

Modified:
  head/graphics/opencv/Makefile
  head/graphics/opencv/files/patch-modules__ts__include__opencv2__ts__ts_gtest.h

Modified: head/graphics/opencv/Makefile
==============================================================================
--- head/graphics/opencv/Makefile	Mon Nov 25 15:06:59 2013	(r334855)
+++ head/graphics/opencv/Makefile	Mon Nov 25 15:19:00 2013	(r334856)
@@ -17,12 +17,14 @@ LICENSE_FILE=	${WRKSRC}/doc/license.txt
 WANT_GSTREAMER=	yes
 MAKE_JOBS_UNSAFE=	yes
 USE_BZIP2=	yes
-USES=		compiler:features cmake pkgconfig
+USES=		cmake pkgconfig
 USE_DOS2UNIX=	yes
 USE_LDCONFIG=	yes
 
 WRKSRC=		${WRKDIR}/OpenCV-${DISTVERSION}
 
+CXXFLAGS+=	-DGTEST_USE_OWN_TR1_TUPLE=1
+
 NOT_FOR_ARCHS=	sparc64
 NOT_FOR_ARCHS_REASON_sparc64=	does not compile on sparc64
 
@@ -154,6 +156,9 @@ CMAKE_ARGS+=	-DBUILD_EXAMPLES:BOOL=Off \
 		-DWITH_PVAPI:BOOL=Off \
 		-DWITH_1394:BOOL=Off \
 		-DWITH_CUDA:BOOL=Off
+
+.include <bsd.port.options.mk>
+
 .endif # defined(_BUILDING_OPENCV_CORE) || defined(_BUILDING_OPENCV_PYTHON)
 
 .if defined(_BUILDING_OPENCV_PYTHON)
@@ -162,19 +167,13 @@ CMAKE_ARGS+=	-DBUILD_NEW_PYTHON_SUPPORT:
 CMAKE_ARGS+=	-DBUILD_NEW_PYTHON_SUPPORT:BOOL=Off
 .endif
 
-.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}"):' \
 		-e 's:-pthread:${PTHREAD_LIBS}:g' \
 		-e 's:$${OPENCV_LIB_INSTALL_PATH}/pkgconfig:$${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig:g' \
 		-e 's:share/OpenCV/doc:share/doc/opencv:g' \
+		-e 's:-mcpu=G3::g' \
 		${WRKSRC}/CMakeLists.txt
 	@${REINPLACE_CMD} -e 's|${PORTNAME}/samples|examples/${PORTNAME}|g' \
 		${WRKSRC}/samples/*/CMakeLists.txt \
@@ -210,4 +209,4 @@ post-patch:
 		${WRKSRC}/CMakeLists.txt
 .endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Modified: head/graphics/opencv/files/patch-modules__ts__include__opencv2__ts__ts_gtest.h
==============================================================================
--- head/graphics/opencv/files/patch-modules__ts__include__opencv2__ts__ts_gtest.h	Mon Nov 25 15:06:59 2013	(r334855)
+++ head/graphics/opencv/files/patch-modules__ts__include__opencv2__ts__ts_gtest.h	Mon Nov 25 15:19:00 2013	(r334856)
@@ -8,265 +8,3 @@
  
  // Copyright 2005, Google Inc.
  // All rights reserved.
-@@ -543,7 +544,7 @@
- // Author: wan at google.com (Zhanyong Wan)
- 
- // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
--
-+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ 1
- #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
- #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
- 
-@@ -1504,11 +1505,35 @@
- // <tr1/functional>.  Hence the following #define is a hack to prevent
- // <tr1/functional> from being included.
- #define _TR1_FUNCTIONAL 1
-+#ifdef __clang__
-+#if __has_include(<tuple>)
-+#include <tuple>
-+namespace gtest {
-+	using ::std::tuple;
-+}
-+#endif
-+#else
- #include <tr1/tuple>
-+namespace gtest {
-+	using ::std::tr1::tuple;
-+}
-+#endif
- #undef _TR1_FUNCTIONAL  // Allows the user to #include
-                         // <tr1/functional> if he chooses to.
- #else
--#include <tr1/tuple>  // NOLINT
-+#if defined(__clang__)
-+#if __has_include(<tuple>)
-+#include <tuple>
-+namespace gtest {
-+	using ::std::tuple;
-+}
-+#endif
-+#else
-+#include <tr1/tuple>
-+namespace gtest {
-+	using ::std::tr1::tuple;
-+}
-+#endif
- #endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
- 
- #else
-@@ -11951,9 +11976,9 @@
- //
- template <typename T1, typename T2>
- class CartesianProductGenerator2
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2> ParamType;
-+  typedef gtest::tuple<T1, T2> ParamType;
- 
-   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2)
-@@ -12066,9 +12091,9 @@
- 
- template <typename T1, typename T2, typename T3>
- class CartesianProductGenerator3
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
-+  typedef gtest::tuple<T1, T2, T3> ParamType;
- 
-   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
-@@ -12198,9 +12223,9 @@
- 
- template <typename T1, typename T2, typename T3, typename T4>
- class CartesianProductGenerator4
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4> ParamType;
- 
-   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -12349,9 +12374,9 @@
- 
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- class CartesianProductGenerator5
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4, T5> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4, T5> ParamType;
- 
-   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -12517,10 +12542,10 @@
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
-     typename T6>
- class CartesianProductGenerator6
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4, T5,
-         T6> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4, T5, T6> ParamType;
- 
-   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -12703,10 +12728,10 @@
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
-     typename T6, typename T7>
- class CartesianProductGenerator7
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4, T5, T6,
-         T7> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
- 
-   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -12906,10 +12931,10 @@
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
-     typename T6, typename T7, typename T8>
- class CartesianProductGenerator8
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4, T5, T6,
-         T7, T8> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
- 
-   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -13128,10 +13153,10 @@
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
-     typename T6, typename T7, typename T8, typename T9>
- class CartesianProductGenerator9
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4, T5, T6,
-         T7, T8, T9> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
- 
-   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -13367,10 +13392,10 @@
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
-     typename T6, typename T7, typename T8, typename T9, typename T10>
- class CartesianProductGenerator10
--    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
-+    : public ParamGeneratorInterface< gtest::tuple<T1, T2, T3, T4, T5, T6,
-         T7, T8, T9, T10> > {
-  public:
--  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
-+  typedef gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
- 
-   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
-       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
-@@ -13632,8 +13657,8 @@
- CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
-       : g1_(g1), g2_(g2) {}
-   template <typename T1, typename T2>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
-+  operator ParamGenerator< gtest::tuple<T1, T2> >() const {
-+    return ParamGenerator< gtest::tuple<T1, T2> >(
-         new CartesianProductGenerator2<T1, T2>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_)));
-@@ -13654,8 +13679,8 @@
-     const Generator3& g3)
-       : g1_(g1), g2_(g2), g3_(g3) {}
-   template <typename T1, typename T2, typename T3>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3> >() const {
-+    return ParamGenerator< gtest::tuple<T1, T2, T3> >(
-         new CartesianProductGenerator3<T1, T2, T3>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_),
-@@ -13679,8 +13704,8 @@
-     const Generator3& g3, const Generator4& g4)
-       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
-   template <typename T1, typename T2, typename T3, typename T4>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4> >() const {
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4> >(
-         new CartesianProductGenerator4<T1, T2, T3, T4>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_),
-@@ -13706,8 +13731,8 @@
-     const Generator3& g3, const Generator4& g4, const Generator5& g5)
-       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
-   template <typename T1, typename T2, typename T3, typename T4, typename T5>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5> >() const {
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5> >(
-         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_),
-@@ -13737,8 +13762,8 @@
-       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
-   template <typename T1, typename T2, typename T3, typename T4, typename T5,
-       typename T6>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6> >() const {
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6> >(
-         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_),
-@@ -13770,9 +13795,9 @@
-       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
-   template <typename T1, typename T2, typename T3, typename T4, typename T5,
-       typename T6, typename T7>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6,
-       T7> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7> >(
-         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_),
-@@ -13808,9 +13833,9 @@
-           g8_(g8) {}
-   template <typename T1, typename T2, typename T3, typename T4, typename T5,
-       typename T6, typename T7, typename T8>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7,
-       T8> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
-         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
-         static_cast<ParamGenerator<T1> >(g1_),
-         static_cast<ParamGenerator<T2> >(g2_),
-@@ -13849,9 +13874,9 @@
-           g9_(g9) {}
-   template <typename T1, typename T2, typename T3, typename T4, typename T5,
-       typename T6, typename T7, typename T8, typename T9>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-       T9> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-         T9> >(
-         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
-         static_cast<ParamGenerator<T1> >(g1_),
-@@ -13893,9 +13918,9 @@
-           g9_(g9), g10_(g10) {}
-   template <typename T1, typename T2, typename T3, typename T4, typename T5,
-       typename T6, typename T7, typename T8, typename T9, typename T10>
--  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-+  operator ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-       T9, T10> >() const {
--    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-+    return ParamGenerator< gtest::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-         T9, T10> >(
-         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
-             T10>(


More information about the svn-ports-head mailing list