diff options
author | taca <taca@pkgsrc.org> | 2010-09-10 06:02:57 +0000 |
---|---|---|
committer | taca <taca@pkgsrc.org> | 2010-09-10 06:02:57 +0000 |
commit | a3e5ea56dcf5c17223bae6e0e459ef0fe02c3558 (patch) | |
tree | 5b6eeb3c152c7a81bb48bb44e51d8ed701be036c | |
parent | 26dfb4336fd3c295fcef5b619f4915f7cc306adb (diff) | |
download | pkgsrc-a3e5ea56dcf5c17223bae6e0e459ef0fe02c3558.tar.gz |
Update devel/ruby-ncurses to 1.2.4.
* Use lang/ruby/gem.mk instead of misc/rubygems/rubygem.mk.
* Add LICENSE.
* Remove default value of GEM_BUILD.
* Don't install by gem.
* Add patch to support both ruby18 and ruby19.
-rw-r--r-- | devel/ruby-ncurses/Makefile | 33 | ||||
-rw-r--r-- | devel/ruby-ncurses/PLIST | 48 | ||||
-rw-r--r-- | devel/ruby-ncurses/distinfo | 11 | ||||
-rw-r--r-- | devel/ruby-ncurses/files/gemspec | 25 | ||||
-rw-r--r-- | devel/ruby-ncurses/patches/patch-aa | 249 | ||||
-rw-r--r-- | devel/ruby-ncurses/patches/patch-ab | 56 | ||||
-rw-r--r-- | devel/ruby-ncurses/patches/patch-ac | 52 |
7 files changed, 405 insertions, 69 deletions
diff --git a/devel/ruby-ncurses/Makefile b/devel/ruby-ncurses/Makefile index 7cfdf4a2938..1edd1e67560 100644 --- a/devel/ruby-ncurses/Makefile +++ b/devel/ruby-ncurses/Makefile @@ -1,25 +1,36 @@ -# $NetBSD: Makefile,v 1.7 2008/04/04 15:30:00 jlam Exp $ +# $NetBSD: Makefile,v 1.8 2010/09/10 06:02:57 taca Exp $ -DISTNAME= ncurses-ruby-1.1 -PKGNAME= ${RUBY_PKGPREFIX}-${GEM_NAME} -PKGREVISION= 1 +DISTNAME= ncurses-ruby-${VER} +PKGNAME= ${RUBY_PKGPREFIX}-ncurses-${VER} CATEGORIES= devel MASTER_SITES= http://download.berlios.de/ncurses-ruby/ EXTRACT_SUFX= .tar.bz2 +LICENSE= gnu-lgpl-v2.1 OR gnu-lgpl-v3 MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://ncurses-ruby.berlios.de/ COMMENT= Ruby interface to ncurses -USE_NCURSES= yes # mouse functions -GEM_NAME= ${DISTNAME:S/-ruby//} -GEM_BUILD= gemspec -GEM_CLEANBUILD= Makefile *.o ncurses_bin.${RUBY_DLEXT} mkmf.log +PKG_DESTDIR_SUPPORT?= user-destdir -post-extract: - ${RUN} cp ${FILESDIR}/gemspec ${GEM_SPECFILE} +VER= 1.2.4 +USE_NCURSES= YES # mouse functions +USE_RUBY_EXTCONF= YES -.include "../../misc/rubygems/rubygem.mk" +DOCS= COPYING Changes MANIFEST README THANKS TODO VERSION +DOCDIR= ${RUBY_DOC}/ncurses +EGDIR= ${RUBY_EG}/ncurses +INSTALLATION_DIRS+= ${DOCDIR} ${EGDIR} +REPLACE_RUBY_DIRS= examples +PLIST_SUBST+= DOCDIR=${DOCDIR} EGDIR=${EGDIR} + +post-install: +.for f in ${DOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${DOCDIR} +.endfor + ${INSTALL_DATA} ${WRKSRC}/examples/* ${DESTDIR}${PREFIX}/${EGDIR} + +.include "../../lang/ruby/modules.mk" .include "../../devel/ncurses/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/devel/ruby-ncurses/PLIST b/devel/ruby-ncurses/PLIST index 0d64e1d108d..a73616a29e8 100644 --- a/devel/ruby-ncurses/PLIST +++ b/devel/ruby-ncurses/PLIST @@ -1,29 +1,19 @@ -@comment $NetBSD: PLIST,v 1.5 2009/06/14 18:48:17 joerg Exp $ -${GEM_HOME}/cache/ncurses-${PKGVERSION}.gem -${GEM_LIBDIR}/COPYING -${GEM_LIBDIR}/Changes -${GEM_LIBDIR}/MANIFEST -${GEM_LIBDIR}/README -${GEM_LIBDIR}/THANKS -${GEM_LIBDIR}/TODO -${GEM_LIBDIR}/VERSION -${GEM_LIBDIR}/examples/LICENSES_for_examples -${GEM_LIBDIR}/examples/example.rb -${GEM_LIBDIR}/examples/form.rb -${GEM_LIBDIR}/examples/form2.rb -${GEM_LIBDIR}/examples/hello_ncurses.rb -${GEM_LIBDIR}/examples/rain.rb -${GEM_LIBDIR}/examples/read_line.rb -${GEM_LIBDIR}/examples/tclock.rb -${GEM_LIBDIR}/examples/test_scanw.rb -${GEM_LIBDIR}/extconf.rb -${GEM_LIBDIR}/form_wrap.c -${GEM_LIBDIR}/form_wrap.h -${GEM_LIBDIR}/lib/ncurses.rb -${GEM_LIBDIR}/lib/ncurses_bin.${RUBY_DLEXT} -${GEM_LIBDIR}/make_dist.rb -${GEM_LIBDIR}/ncurses_wrap.c -${GEM_LIBDIR}/ncurses_wrap.h -${GEM_LIBDIR}/panel_wrap.c -${GEM_LIBDIR}/panel_wrap.h -${GEM_HOME}/specifications/ncurses-${PKGVERSION}.gemspec +@comment $NetBSD: PLIST,v 1.6 2010/09/10 06:02:57 taca Exp $ +${RUBY_VENDORLIB}/ncurses.rb +${RUBY_VENDORARCHLIB}/ncurses_bin.${RUBY_DLEXT} +${DOCDIR}/COPYING +${DOCDIR}/Changes +${DOCDIR}/MANIFEST +${DOCDIR}/README +${DOCDIR}/THANKS +${DOCDIR}/TODO +${DOCDIR}/VERSION +${EGDIR}/LICENSES_for_examples +${EGDIR}/example.rb +${EGDIR}/form.rb +${EGDIR}/form2.rb +${EGDIR}/hello_ncurses.rb +${EGDIR}/rain.rb +${EGDIR}/read_line.rb +${EGDIR}/tclock.rb +${EGDIR}/test_scanw.rb diff --git a/devel/ruby-ncurses/distinfo b/devel/ruby-ncurses/distinfo index 958ccff36e4..710dda954da 100644 --- a/devel/ruby-ncurses/distinfo +++ b/devel/ruby-ncurses/distinfo @@ -1,5 +1,8 @@ -$NetBSD: distinfo,v 1.3 2007/03/17 16:05:02 taca Exp $ +$NetBSD: distinfo,v 1.4 2010/09/10 06:02:57 taca Exp $ -SHA1 (ncurses-ruby-1.1.tar.bz2) = f50a6eaec836845cdebd116760ab0e1ce5c1d75b -RMD160 (ncurses-ruby-1.1.tar.bz2) = d9076cbbc28046d5017203049f4c0e026403ebc4 -Size (ncurses-ruby-1.1.tar.bz2) = 46327 bytes +SHA1 (ncurses-ruby-1.2.4.tar.bz2) = b34ff1cf1147ab551855a5b2c63d2a034119fee2 +RMD160 (ncurses-ruby-1.2.4.tar.bz2) = 8f08b6c919abdcd6c86fc9d08e293ca3e79ec010 +Size (ncurses-ruby-1.2.4.tar.bz2) = 50858 bytes +SHA1 (patch-aa) = e03d5f04364a24ebdbb7c1ae888ead7fb65e8e9b +SHA1 (patch-ab) = 53d40b6a1e2e12826249dba3c9d9c7c3d1d39afb +SHA1 (patch-ac) = fc0c8b3db447222189d0bdd3d950574d93103b09 diff --git a/devel/ruby-ncurses/files/gemspec b/devel/ruby-ncurses/files/gemspec deleted file mode 100644 index 5e9bc3193c1..00000000000 --- a/devel/ruby-ncurses/files/gemspec +++ /dev/null @@ -1,25 +0,0 @@ -require "rubygems" - -PLUGIN = "ncurses" -NAME = "ncurses" -VERSION = "1.1" -AUTHOR = "Tobias Peters" -EMAIL = "t-peters@users.berlios.de" -HOMEPAGE = "http://ncurses-ruby.berlios.de/" -SUMMARY = "This wrapper provides access to the functions, macros, global variables and constants of the ncurses library. These are mapped to a Ruby Module named \"Ncurses\": Functions and external variables are implemented as singleton functions of the Module Ncurses." - -spec = Gem::Specification.new do |s| - s.name = NAME - s.email = EMAIL - s.author = AUTHOR - s.version = VERSION - s.summary = SUMMARY - s.platform = Gem::Platform::RUBY - s.has_rdoc = false - s.homepage = HOMEPAGE - s.description = SUMMARY - s.autorequire = PLUGIN - s.require_paths = ["lib"] - s.files = Dir.glob("[A-Z]*") + Dir.glob("*.{c,h,rb}") + Dir.glob("{examples,lib}/**/*") - s.extensions = "extconf.rb" -end diff --git a/devel/ruby-ncurses/patches/patch-aa b/devel/ruby-ncurses/patches/patch-aa new file mode 100644 index 00000000000..d7f70dd9c81 --- /dev/null +++ b/devel/ruby-ncurses/patches/patch-aa @@ -0,0 +1,249 @@ +$NetBSD: patch-aa,v 1.3 2010/09/10 06:02:58 taca Exp $ + +--- ncurses_wrap.c.orig 2009-07-31 10:52:36.000000000 +0000 ++++ ncurses_wrap.c +@@ -475,7 +475,7 @@ static VALUE rbncurs_curses_version(){re + static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode) + { + return INT2NUM(define_key((definition != Qnil) +- ? STR2CSTR(definition) ++ ? StringValuePtr(definition) + : (char*)(NULL), + NUM2INT(keycode))); + } +@@ -580,10 +580,10 @@ static VALUE rbncurs_addchstr(VALUE dumm + return return_value; + } + static VALUE rbncurs_addnstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(addnstr(STR2CSTR(arg1), NUM2INT(arg2))); ++ return INT2NUM(addnstr(StringValuePtr(arg1), NUM2INT(arg2))); + } + static VALUE rbncurs_addstr(VALUE dummy, VALUE arg1) { +- return INT2NUM(addstr(STR2CSTR(arg1))); ++ return INT2NUM(addstr(StringValuePtr(arg1))); + } + static VALUE rbncurs_attroff(VALUE dummy, VALUE arg1) { + return INT2NUM(attroff(NUM2ULONG(arg1))); +@@ -1011,10 +1011,10 @@ static VALUE rbncurs_insertln(VALUE dumm + return INT2NUM(insertln()); + } + static VALUE rbncurs_insnstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(insnstr(STR2CSTR(arg1), NUM2INT(arg2))); ++ return INT2NUM(insnstr(StringValuePtr(arg1), NUM2INT(arg2))); + } + static VALUE rbncurs_insstr(VALUE dummy, VALUE arg1) { +- return INT2NUM(insstr(STR2CSTR(arg1))); ++ return INT2NUM(insstr(StringValuePtr(arg1))); + } + #ifdef HAVE_INTRFLUSH + static VALUE rbncurs_intrflush(VALUE dummy, VALUE arg1, VALUE arg2) { +@@ -1070,10 +1070,10 @@ static VALUE rbncurs_mvaddchstr(VALUE du + return return_value; + } + static VALUE rbncurs_mvaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); ++ return INT2NUM(mvaddnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); + } + static VALUE rbncurs_mvaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); ++ return INT2NUM(mvaddstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); + } + #ifdef HAVE_MVCHGAT + static VALUE rbncurs_mvchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6) { +@@ -1106,10 +1106,10 @@ static VALUE rbncurs_mvinsch(VALUE dummy + return INT2NUM(mvinsch(NUM2INT(arg1), NUM2INT(arg2), NUM2ULONG(arg3))); + } + static VALUE rbncurs_mvinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3), NUM2INT(arg4))); ++ return INT2NUM(mvinsnstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3), NUM2INT(arg4))); + } + static VALUE rbncurs_mvinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), STR2CSTR(arg3))); ++ return INT2NUM(mvinsstr(NUM2INT(arg1), NUM2INT(arg2), StringValuePtr(arg3))); + } + #ifdef HAVE_MVVLINE + static VALUE rbncurs_mvvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +@@ -1137,10 +1137,10 @@ static VALUE rbncurs_mvwaddchstr(VALUE d + return return_value; + } + static VALUE rbncurs_mvwaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +- return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); ++ return INT2NUM(mvwaddnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); + } + static VALUE rbncurs_mvwaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); ++ return INT2NUM(mvwaddstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); + } + #ifdef HAVE_MVWCHGAT + static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7) { +@@ -1171,10 +1171,10 @@ static VALUE rbncurs_mvwinsch(VALUE dumm + return INT2NUM(mvwinsch(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), NUM2ULONG(arg4))); + } + static VALUE rbncurs_mvwinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +- return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4), NUM2INT(arg5))); ++ return INT2NUM(mvwinsnstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4), NUM2INT(arg5))); + } + static VALUE rbncurs_mvwinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) { +- return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), STR2CSTR(arg4))); ++ return INT2NUM(mvwinsstr(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3), StringValuePtr(arg4))); + } + #ifdef HAVE_MVWVLINE + static VALUE rbncurs_mvwvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) { +@@ -1238,7 +1238,7 @@ static VALUE rbncurs_prefresh(VALUE dumm + } + #ifdef HAVE_PUTP + static VALUE rbncurs_putp(VALUE dummy, VALUE arg1) { +- return INT2NUM(putp(STR2CSTR(arg1))); ++ return INT2NUM(putp(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_QIFLUSH +@@ -1271,12 +1271,12 @@ static VALUE rbncurs_savetty(VALUE dummy + } + #ifdef HAVE_SCR_DUMP + static VALUE rbncurs_scr_dump(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_dump(STR2CSTR(arg1))); ++ return INT2NUM(scr_dump(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_SCR_INIT + static VALUE rbncurs_scr_init(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_init(STR2CSTR(arg1))); ++ return INT2NUM(scr_init(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_scrl(VALUE dummy, VALUE arg1) { +@@ -1290,12 +1290,12 @@ static VALUE rbncurs_scrollok(VALUE dumm + } + #ifdef HAVE_SCR_RESTORE + static VALUE rbncurs_scr_restore(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_restore(STR2CSTR(arg1))); ++ return INT2NUM(scr_restore(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_SCR_SET + static VALUE rbncurs_scr_set(VALUE dummy, VALUE arg1) { +- return INT2NUM(scr_set(STR2CSTR(arg1))); ++ return INT2NUM(scr_set(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_setscrreg(VALUE dummy, VALUE arg1, VALUE arg2) { +@@ -1352,7 +1352,7 @@ static VALUE rbncurs_slk_restore(VALUE d + return INT2NUM(slk_restore()); + } + static VALUE rbncurs_slk_set(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(slk_set(NUM2INT(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(slk_set(NUM2INT(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_slk_touch(VALUE dummy) { + return INT2NUM(slk_touch()); +@@ -1383,17 +1383,17 @@ static VALUE rbncurs_termname(VALUE dumm + } + #ifdef HAVE_TIGETFLAG + static VALUE rbncurs_tigetflag(VALUE dummy, VALUE arg1) { +- return INT2NUM(tigetflag(STR2CSTR(arg1))); ++ return INT2NUM(tigetflag(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_TIGETNUM + static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) { +- return INT2NUM(tigetnum(STR2CSTR(arg1))); ++ return INT2NUM(tigetnum(StringValuePtr(arg1))); + } + #endif + #ifdef HAVE_TIGETSTR + static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) { +- return rb_str_new2(tigetstr(STR2CSTR(arg1))); ++ return rb_str_new2(tigetstr(StringValuePtr(arg1))); + } + #endif + static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) { +@@ -1438,10 +1438,10 @@ static VALUE rbncurs_waddchstr(VALUE dum + return return_value; + } + static VALUE rbncurs_waddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(waddnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(waddnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_waddstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(waddstr(get_window(arg1), STR2CSTR(arg2))); ++ return INT2NUM(waddstr(get_window(arg1), StringValuePtr(arg2))); + } + static VALUE rbncurs_wattron(VALUE dummy, VALUE arg1, VALUE arg2) { + return INT2NUM(wattron(get_window(arg1), NUM2INT(arg2))); +@@ -1514,10 +1514,10 @@ static VALUE rbncurs_winsertln(VALUE dum + return INT2NUM(winsertln(get_window(arg1))); + } + static VALUE rbncurs_winsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { +- return INT2NUM(winsnstr(get_window(arg1), STR2CSTR(arg2), NUM2INT(arg3))); ++ return INT2NUM(winsnstr(get_window(arg1), StringValuePtr(arg2), NUM2INT(arg3))); + } + static VALUE rbncurs_winsstr(VALUE dummy, VALUE arg1, VALUE arg2) { +- return INT2NUM(winsstr(get_window(arg1), STR2CSTR(arg2))); ++ return INT2NUM(winsstr(get_window(arg1), StringValuePtr(arg2))); + } + static VALUE rbncurs_wmove(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) { + return INT2NUM(wmove(get_window(arg1), NUM2INT(arg2), NUM2INT(arg3))); +@@ -1619,7 +1619,7 @@ static VALUE rbncurs_unctrl(VALUE dummy, + { return rb_str_new2(unctrl(NUM2ULONG(ch))); } + static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE rb_infd) + { +- char * type = (rb_type == Qnil) ? (char*)0 : STR2CSTR(rb_type); ++ char * type = (rb_type == Qnil) ? (char*)0 : StringValuePtr(rb_type); + int outfd = NUM2INT(rb_funcall(rb_outfd, rb_intern("to_i"), 0)); + int infd = NUM2INT(rb_funcall(rb_infd, rb_intern("to_i"), 0)); + VALUE rb_screen = +@@ -2277,7 +2277,7 @@ static VALUE rbncurs_wmouse_trafo(VALUE + #ifdef HAVE_MCPRINT + static VALUE rbncurs_mcprint(VALUE dummy, VALUE data, VALUE len) + { +- return INT2NUM(mcprint(STR2CSTR(data), NUM2INT(len))); ++ return INT2NUM(mcprint(StringValuePtr(data), NUM2INT(len))); + } + #endif + #ifdef HAVE_HAS_KEY +@@ -2373,14 +2373,15 @@ static VALUE rbncurs_setsyx(VALUE dummy, + + static VALUE rbncurs_wprintw(int argc, VALUE * argv, VALUE dummy) + { ++ VALUE v; ++ + if (argc < 2) { + rb_raise(rb_eArgError, "function needs at least 2 arguments: a WINDOW" + " and a String"); + return Qnil; + } +- wprintw(get_window(argv[0]), "%s", +- STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, +- argv + 1))); ++ v = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, argv + 1); ++ wprintw(get_window(argv[0]), "%s", StringValuePtr(v)); + return Qnil; + } + +@@ -2394,14 +2395,14 @@ static VALUE rbncurs_tracef(int argc, VA + return Qnil; + } + _tracef("%s", +- STR2CSTR(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); ++ StringValuePtr(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv))); + return Qnil; + } + #endif /* HAVE__TRACEF */ + #ifdef HAVE__TRACEDUMP + static VALUE rbncurs_tracedump(VALUE dummy, VALUE rb_label, VALUE rb_win) + { +- _tracedump(STR2CSTR(rb_label), get_window(rb_win)); ++ _tracedump(StringValuePtr(rb_label), get_window(rb_win)); + } + #endif /* HAVE__TRACEDUMP */ + #ifdef HAVE__TRACEATTR +@@ -2706,7 +2707,7 @@ void init_SCREEN_methods(void) + + #ifdef HAVE_LOCALE_H + static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale) +-{ return rb_str_new2(setlocale(NUM2INT(category), STR2CSTR(locale)));} ++{ return rb_str_new2(setlocale(NUM2INT(category), StringValuePtr(locale)));} + #endif + + static void init_safe_functions(void) diff --git a/devel/ruby-ncurses/patches/patch-ab b/devel/ruby-ncurses/patches/patch-ab new file mode 100644 index 00000000000..53a9913f238 --- /dev/null +++ b/devel/ruby-ncurses/patches/patch-ab @@ -0,0 +1,56 @@ +$NetBSD: patch-ab,v 1.1 2010/09/10 06:02:58 taca Exp $ + +--- form_wrap.c.orig 2009-07-31 10:52:36.000000000 +0000 ++++ form_wrap.c +@@ -618,12 +618,14 @@ static VALUE rbncurs_c_set_field_type(in + rb_raise(rb_eArgError, "TYPE_ENUM requires three additional arguments"); + } + else { ++ VALUE v; + int n = rbncurs_array_length(arg3); + /* Will ncurses free this array of strings in free_field()? */ + char** list = ALLOC_N(char*, n+1); + int i; + for (i = 0; i < n; i++) { +- list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i)); ++ v = rb_ary_entry(arg3, (long)i); ++ list[i] = StringValuePtr(v); + } + list[n] = NULL; + return INT2NUM(set_field_type(field, ftype, +@@ -652,7 +654,7 @@ static VALUE rbncurs_c_set_field_type(in + if (argc != 2) + rb_raise(rb_eArgError, "TYPE_REGEXP requires one additional argument"); + return INT2NUM(set_field_type(field, ftype, +- STR2CSTR(arg3))); ++ StringValue(arg3))); + } + else if (ftype == TYPE_IPV4){ + if (argc != 1) +@@ -740,7 +742,7 @@ static VALUE rbncurs_m_field_pad(VALUE d + */ + static VALUE rbncurs_c_set_field_buffer(VALUE rb_field, VALUE buf, VALUE value) { + FIELD* field = get_field(rb_field); +- return INT2NUM(set_field_buffer(field, NUM2INT(buf), STR2CSTR(value))); ++ return INT2NUM(set_field_buffer(field, NUM2INT(buf), StringValuePtr(value))); + } + static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf, VALUE value) + { return rbncurs_c_set_field_buffer(rb_field, buf, value); } +@@ -1044,13 +1046,15 @@ static VALUE rbncurs_m_form_opts(VALUE d + * form_requestname + */ + static VALUE rbncurs_c_form_request_name(VALUE request) { +- return rb_str_new2(form_request_name(NUM2INT(request))); ++ const char *s; ++ s = form_request_name(NUM2INT(request)); ++ return rb_str_new2(s); + } + static VALUE rbncurs_m_form_request_name(VALUE dummy, VALUE request) + { return rbncurs_c_form_request_name(request); } + + static VALUE rbncurs_c_form_request_by_name(VALUE name) { +- return INT2NUM(form_request_by_name(STR2CSTR(name))); ++ return INT2NUM(form_request_by_name(StringValuePtr(name))); + } + static VALUE rbncurs_m_form_request_by_name(VALUE dummy, VALUE name) + { return rbncurs_c_form_request_by_name(name); } diff --git a/devel/ruby-ncurses/patches/patch-ac b/devel/ruby-ncurses/patches/patch-ac new file mode 100644 index 00000000000..8fed22ce5e1 --- /dev/null +++ b/devel/ruby-ncurses/patches/patch-ac @@ -0,0 +1,52 @@ +$NetBSD: patch-ac,v 1.1 2010/09/10 06:02:58 taca Exp $ + +Use modern Ruby API. + +--- menu_wrap.c.orig 2009-07-31 10:52:36.000000000 +0000 ++++ menu_wrap.c +@@ -370,7 +370,7 @@ static VALUE rbncurs_m_item_index(VALUE + * Item creation/destruction functions - mitem_new(3X) man page + */ + static VALUE rbncurs_m_new_item(VALUE dummy, VALUE name, VALUE description) +-{ return wrap_item(new_item(STR2CSTR(name), STR2CSTR(description))); } ++{ return wrap_item(new_item(StringValuePtr(name), StringValuePtr(description))); } + + static VALUE rbncurs_c_free_item(VALUE rb_item) + { +@@ -661,14 +661,16 @@ static VALUE rbncurs_m_menu_opts(VALUE d + */ + static VALUE rbncurs_c_menu_request_name(VALUE request) + { +- return rb_str_new2(menu_request_name(NUM2INT(request))); ++ const char *s; ++ s = menu_request_name(NUM2INT(request)); ++ return rb_str_new2(s); + } + static VALUE rbncurs_m_menu_request_name(VALUE dummy, VALUE request) + { return rbncurs_c_menu_request_name(request); } + + static VALUE rbncurs_c_menu_request_by_name(VALUE name) + { +- return INT2NUM(menu_request_by_name(STR2CSTR(name))); ++ return INT2NUM(menu_request_by_name(StringValuePtr(name))); + } + static VALUE rbncurs_m_menu_request_by_name(VALUE dummy, VALUE name) + { return rbncurs_c_menu_request_by_name(name); } +@@ -907,7 +909,7 @@ static VALUE rbncurs_m_menu_format(VALUE + static VALUE rbncurs_c_set_menu_mark(VALUE rb_menu, VALUE value) + { + MENU *menu = get_menu(rb_menu); +- return INT2NUM(set_menu_mark(menu, STR2CSTR(value))); ++ return INT2NUM(set_menu_mark(menu, StringValuePtr(value))); + } + static VALUE rbncurs_m_set_menu_mark(VALUE dummy, VALUE rb_field, VALUE value) + { return rbncurs_c_set_menu_mark(rb_field, value); } +@@ -927,7 +929,7 @@ static VALUE rbncurs_m_menu_mark(VALUE d + static VALUE rbncurs_c_set_menu_pattern(VALUE rb_menu, VALUE pattern) + { + MENU *menu = get_menu(rb_menu); +- return INT2NUM(set_menu_pattern(menu, STR2CSTR(pattern))); ++ return INT2NUM(set_menu_pattern(menu, StringValuePtr(pattern))); + } + static VALUE rbncurs_m_set_menu_pattern(VALUE dummy, VALUE rb_menu, VALUE pattern) + { return rbncurs_c_set_menu_pattern(rb_menu, pattern); } |