diff --git a/graphics/rubygem-objectdetect/Makefile b/graphics/rubygem-objectdetect/Makefile index e57e0f8b0675..d8b827f8edcd 100644 --- a/graphics/rubygem-objectdetect/Makefile +++ b/graphics/rubygem-objectdetect/Makefile @@ -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 -.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 diff --git a/graphics/rubygem-objectdetect/distinfo b/graphics/rubygem-objectdetect/distinfo index 1b6a01b1b590..c94c8a7a068c 100644 --- a/graphics/rubygem-objectdetect/distinfo +++ b/graphics/rubygem-objectdetect/distinfo @@ -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 diff --git a/graphics/rubygem-objectdetect/files/patch-ext-objectdetect.c b/graphics/rubygem-objectdetect/files/patch-ext-objectdetect.c new file mode 100644 index 000000000000..82842df61d5c --- /dev/null +++ b/graphics/rubygem-objectdetect/files/patch-ext-objectdetect.c @@ -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();