diff options
author | wiz <wiz@pkgsrc.org> | 2018-02-16 17:13:58 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2018-02-16 17:13:58 +0000 |
commit | ab7d7819692057214e6b5b264624931016141e7b (patch) | |
tree | 2d7de0f086238a6e30ba6d214e8a76b710a81adb /graphics | |
parent | 4f3a5d3bf8c2d692cefcd9a37e9547b83e0999f3 (diff) | |
download | pkgsrc-ab7d7819692057214e6b5b264624931016141e7b.tar.gz |
opencv2: fix build on NetBSD-8.99.12 with gcc6.
Some advice from https://github.com/opencv/opencv/issues/6517
Bump PKGREVISION.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/opencv2/Makefile | 6 | ||||
-rw-r--r-- | graphics/opencv2/distinfo | 3 | ||||
-rw-r--r-- | graphics/opencv2/patches/patch-modules_contrib_src_chamfermatching.cpp | 44 |
3 files changed, 49 insertions, 4 deletions
diff --git a/graphics/opencv2/Makefile b/graphics/opencv2/Makefile index 831bb29b964..6a13c15266a 100644 --- a/graphics/opencv2/Makefile +++ b/graphics/opencv2/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.12 2017/11/15 22:16:47 wiz Exp $ +# $NetBSD: Makefile,v 1.13 2018/02/16 17:13:58 wiz Exp $ DISTNAME= opencv-2.4.11 -PKGREVISION= 6 +PKGREVISION= 7 CATEGORIES= graphics devel MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=opencvlibrary/} EXTRACT_SUFX= .zip @@ -36,7 +36,7 @@ CHECK_WRKREF_SKIP= ${PREFIX}/lib/libopencv_core.* .include "options.mk" CMAKE_ARGS+= -DZLIB_ROOT=${BUILDLINK_PREFIX.zlib} -CMAKE_ARGS.SunOS+= -DENABLE_PRECOMPILED_HEADERS=NO +CMAKE_ARGS+= -DENABLE_PRECOMPILED_HEADERS=NO PLIST_VARS+= opencl diff --git a/graphics/opencv2/distinfo b/graphics/opencv2/distinfo index 0aff9aa555d..5fb810d229d 100644 --- a/graphics/opencv2/distinfo +++ b/graphics/opencv2/distinfo @@ -1,9 +1,10 @@ -$NetBSD: distinfo,v 1.2 2015/11/03 21:34:11 agc Exp $ +$NetBSD: distinfo,v 1.3 2018/02/16 17:13:58 wiz Exp $ SHA1 (opencv-2.4.11.zip) = d6e3048416d42213c204f89b9dfe39742f9a708c RMD160 (opencv-2.4.11.zip) = 793391b05b571859005b98612cb176c02352a94f SHA512 (opencv-2.4.11.zip) = 748f6b939200a7ad2c2ae2531bf9bf38b82a576530f10691c13a0ad52568a7eb8b9d312e946ba8e78f592ef05ae389ecb982544f0c00cb83a2d87ae4b4da61b0 Size (opencv-2.4.11.zip) = 91671436 bytes +SHA1 (patch-modules_contrib_src_chamfermatching.cpp) = 65a2c72934a840ac05f8ca06dfad92bc75b81ea9 SHA1 (patch-modules_contrib_src_inputoutput.cpp) = 57255cda71854e490d83602828299f0ab6420887 SHA1 (patch-modules_contrib_src_spinimages.cpp) = b3e465700059616be991d597230bc8dc42f15be1 SHA1 (patch-modules_core_include_opencv2_core_types_c.h) = c056068c01c417dc262f21c00324da7f86c0cd8e diff --git a/graphics/opencv2/patches/patch-modules_contrib_src_chamfermatching.cpp b/graphics/opencv2/patches/patch-modules_contrib_src_chamfermatching.cpp new file mode 100644 index 00000000000..705c80ead40 --- /dev/null +++ b/graphics/opencv2/patches/patch-modules_contrib_src_chamfermatching.cpp @@ -0,0 +1,44 @@ +$NetBSD: patch-modules_contrib_src_chamfermatching.cpp,v 1.1 2018/02/16 17:13:58 wiz Exp $ + +Address of variable is never NULL; some compilers error out about this. + +--- modules/contrib/src/chamfermatching.cpp.orig 2015-02-25 12:10:31.000000000 +0000 ++++ modules/contrib/src/chamfermatching.cpp +@@ -966,10 +966,8 @@ void ChamferMatcher::Matching::computeDi + for (int y=0;y<h;++y) { + for (int x=0;x<w;++x) { + // initialize +- if (&annotate_img!=NULL) { + annotate_img.at<Vec2i>(y,x)[0]=x; + annotate_img.at<Vec2i>(y,x)[1]=y; +- } + + uchar edge_val = edges_img.at<uchar>(y,x); + if( (edge_val!=0) ) { +@@ -1013,10 +1011,8 @@ void ChamferMatcher::Matching::computeDi + dist_img.at<float>(ny,nx) = dist; + q.push(std::make_pair(nx,ny)); + +- if (&annotate_img!=NULL) { + annotate_img.at<Vec2i>(ny,nx)[0]=annotate_img.at<Vec2i>(y,x)[0]; + annotate_img.at<Vec2i>(ny,nx)[1]=annotate_img.at<Vec2i>(y,x)[1]; +- } + } + } + } +@@ -1108,7 +1104,6 @@ ChamferMatcher::Match* ChamferMatcher::M + float cost = (sum_distance/truncate_)/addr.size(); + + +- if (&orientation_img!=NULL) { + float* optr = orientation_img.ptr<float>(y)+x; + float sum_orientation = 0; + int cnt_orientation = 0; +@@ -1127,7 +1122,6 @@ ChamferMatcher::Match* ChamferMatcher::M + cost = (float)(beta*cost+alpha*(sum_orientation/(2*CV_PI))/cnt_orientation); + } + +- } + + if(cost > 0){ + ChamferMatcher::Match* istance = new ChamferMatcher::Match(); |