pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/facedetect: support python 3.x and upgrade of opencv to 3.x



Module Name:	pkgsrc-wip
Committed By:	Adrian Steinmann <ast%NetBSD.org@localhost>
Pushed By:	ast
Date:		Sun Feb 14 16:28:53 2021 +0100
Changeset:	09a3e03a530f10f2bbabf62f1f922016d8ae5f5b

Modified Files:
	facedetect/Makefile
	facedetect/distinfo
Added Files:
	facedetect/patches/patch-facedetect

Log Message:
wip/facedetect: support python 3.x and upgrade of opencv to 3.x

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=09a3e03a530f10f2bbabf62f1f922016d8ae5f5b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 facedetect/Makefile                 |  3 ++-
 facedetect/distinfo                 |  1 +
 facedetect/patches/patch-facedetect | 35 +++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 1 deletion(-)

diffs:
diff --git a/facedetect/Makefile b/facedetect/Makefile
index 2993f15044..49b2233859 100644
--- a/facedetect/Makefile
+++ b/facedetect/Makefile
@@ -16,7 +16,8 @@ HOMEPAGE=	https://www.thregr.org/~wavexx/software/facedetect/
 COMMENT=	Simple face detector for batch processing
 LICENSE=	gnu-gpl-v2
 
-DEPENDS+=	opencv>=2.4:../../graphics/opencv2
+DEPENDS+=	opencv>=3.4.9:../../graphics/opencv
+DEPENDS+=	opencv-contrib-face>=3.4.9:../../graphics/opencv-contrib-face
 
 SUBST_CLASSES+=			fix-paths
 SUBST_STAGE.fix-paths=		post-extract
diff --git a/facedetect/distinfo b/facedetect/distinfo
index d942d1006f..5cad6a782f 100644
--- a/facedetect/distinfo
+++ b/facedetect/distinfo
@@ -4,3 +4,4 @@ SHA1 (facedetect-0.1.tar.gz) = 7b156b90c32f41150f5f35cd98cdc01e6902d8c1
 RMD160 (facedetect-0.1.tar.gz) = 0eeb9271b6162a213326e4015ddc7264279eab26
 SHA512 (facedetect-0.1.tar.gz) = 2e5e4a7584878a9330e002b5055c98fbdca2d3cdd2295e46dbbff750da7f9fc44049a9787cfe6b2d182679182017cf3e894f8169caf382100c4a06c8b502ef26
 Size (facedetect-0.1.tar.gz) = 121053 bytes
+SHA1 (patch-facedetect) = a71b77a22f74465c1a149e57e7530599eb3815c2
diff --git a/facedetect/patches/patch-facedetect b/facedetect/patches/patch-facedetect
new file mode 100644
index 0000000000..550bd9c0b0
--- /dev/null
+++ b/facedetect/patches/patch-facedetect
@@ -0,0 +1,35 @@
+$NetBSD$
+
+facedetect was written for python2 and now python3 doesn't support
+iteritems() anymore.
+
+--- facedetect.orig	2021-02-14 13:11:39.316639081 +0100
++++ facedetect	2021-02-14 13:14:15.345068937 +0100
+@@ -11,6 +11,9 @@
+ import sys
+ import os
+ 
++def get_items(dict_object):
++    for key in dict_object:
++        yield key, dict_object[key]
+ 
+ # CV compatibility stubs
+ if 'IMREAD_GRAYSCALE' not in dir(cv2):
+@@ -58,7 +61,7 @@
+ 
+ 
+ def load_cascades(data_dir):
+-    for k, v in PROFILES.iteritems():
++    for k, v in get_items(PROFILES):
+         v = os.path.join(data_dir, v)
+         try:
+             if not os.path.exists(v):
+@@ -258,7 +261,7 @@
+ 
+             if args.debug:
+                 lines = []
+-                for k, v in scores[i].iteritems():
++                for k, v in get_items(scores[i]):
+                     lines.append("{}: {}".format(k, v))
+                 h = rect[1] + rect[3] + fontHeight
+                 for line in lines:


Home | Main Index | Thread Index | Old Index