1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- Unbreak by adding patch

- Convert to new Makefile header
- Remove indefinate article from COMMENT
- Remove ABI version number from LIB_DEPENDS
This commit is contained in:
TAKATSU Tomonari 2013-05-04 23:10:25 +00:00
parent aab23b84db
commit 3e6f23411a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=317391
3 changed files with 54 additions and 16 deletions

View File

@ -3,34 +3,28 @@
PORTNAME= objectdetect
PORTVERSION= 0.0.3
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= graphics rubygems
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= mm
DISTFILES= ${PORTNAME}-${PORTVERSION}-opencv23.gem
MASTER_SITES= RG
MAINTAINER= tota@FreeBSD.org
COMMENT= A simple library for detecting objects in pictures
DEPRECATED= Does not work with Ruby 1.9
EXPIRATION_DATE= 2013-05-02
LIB_DEPENDS= opencv_legacy.2:${PORTSDIR}/graphics/opencv
COMMENT= Simple library for detecting objects in pictures
LICENSE= MIT
LIB_DEPENDS= opencv_legacy:${PORTSDIR}/graphics/opencv
USE_RUBY= yes
USE_RUBYGEMS= yes
RUBYGEM_AUTOPLIST= yes
.include <bsd.port.pre.mk>
.if ${RUBY_VER} == 1.9
BROKEN= does not work with ruby 1.9
.endif
.if ${OSVERSION} < 700000
BROKEN= does not compile on 6.X
.endif
post-patch:
${REINPLACE_CMD} -E 's|(objectdetect)|\1/version|' ${WRKSRC}/test/test_helper.rb
.include <bsd.port.post.mk>

View File

@ -1,2 +1,2 @@
SHA256 (rubygem/objectdetect-0.0.3-opencv23.gem) = c48b7540be661c2ef0f6483576f393c7c9ab14ae8de9f1c4e7ffea85dd895e64
SIZE (rubygem/objectdetect-0.0.3-opencv23.gem) = 16896
SHA256 (rubygem/objectdetect-0.0.3.gem) = f3ad7dc88e7b7c57c1d2686f197e9615d8d495e32ff12fbd2f44e4d348b19e36
SIZE (rubygem/objectdetect-0.0.3.gem) = 16896

View File

@ -0,0 +1,44 @@
--- ext/objectdetect.c.orig 2013-05-04 21:19:44.000000000 +0900
+++ ext/objectdetect.c 2013-05-04 21:53:21.000000000 +0900
@@ -5,7 +5,15 @@
#include "cv.h"
#include "highgui.h"
-#include "ruby.h"
+#ifdef HAVE_RUBY_ST_H
+# include "ruby/ruby.h"
+#else
+# include "ruby.h"
+#endif
+
+#ifndef RSTRING_PTR
+# define RSTRING_PTR(str) (RSTRING(str)->ptr)
+#endif
/*
call-seq:
@@ -25,13 +33,13 @@
Check_Type(target_path, T_STRING);
/* load the model */
- CvHaarClassifierCascade* cascade = cvLoad(RSTRING(model_path)->ptr, 0, 0, 0);
+ CvHaarClassifierCascade* cascade = cvLoad(RSTRING_PTR(model_path), 0, 0, 0);
if( cascade == 0 ) {
rb_raise(rb_eArgError, "Can't load the cascade file");
}
/* load the target picture */
- IplImage *img = cvLoadImage(RSTRING(target_path)->ptr, 1);
+ IplImage *img = cvLoadImage(RSTRING_PTR(target_path), 1);
if( !img ) {
cvReleaseHaarClassifierCascade(&cascade);
rb_raise(rb_eArgError, "Can't load the image file");
@@ -62,7 +70,7 @@
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq *faces = cvHaarDetectObjects(small_img, cascade, storage,
1.1, 2, CV_HAAR_DO_CANNY_PRUNING,
- cvSize(0,0) );
+ cvSize(0,0), cvSize(0,0) );
/* output */
VALUE results = rb_ary_new();