Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Apr 2013 18:11:28 +0900
From:      Hiroyuki Iwatsuki <don@na.rim.or.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/178022: [MAINTAINER] japanese/ja-ruby20-ming: Fix to work with Ruby 1.9
Message-ID:  <5173ad43.240b450a.1c16.4063@mx.google.com>
Resent-Message-ID: <201304210920.r3L9K13V085767@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         178022
>Category:       ports
>Synopsis:       [MAINTAINER] japanese/ja-ruby20-ming: Fix to work with Ruby 1.9
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 21 09:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Hiroyuki Iwatsuki
>Release:        FreeBSD 9.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD www21248u.sakura.ne.jp 9.1-STABLE FreeBSD 9.1-STABLE #23 r249335: Thu Apr 11 13:45:07 JST
>Description:
Fix to work with Ruby 1.9

- Use better macro/function/class for Ruby 1.9 and later.
- Use OPTIONS instead of NOPORTDOCS.

Generated with FreeBSD Port Tools 0.99_7 (mode: change, diff: SVN)
>How-To-Repeat:
>Fix:

--- ja-ruby20-ming-0.2a.0.1.6_2,1.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 316171)
+++ Makefile	(working copy)
@@ -8,18 +8,14 @@
 CATEGORIES=	japanese graphics ruby
 MASTER_SITES=	RF
 MASTER_SITE_SUBDIR=	mingruby
-PKGNAMEPREFIX=	ja-${RUBY_PKGNAMEPREFIX}
 DISTNAME=	${PORTNAME}-ruby-${RUBY_MING_VERSION}
 DIST_SUBDIR=	ruby
 
 MAINTAINER=	don@na.rim.or.jp
 COMMENT=	Yet another Ming module for Ruby built with Japanese support
 
-DEPRECATED=	Does not work with Ruby 1.9
-EXPIRATION_DATE=	2013-05-02
+LIB_DEPENDS=	ming:${PORTSDIR}/japanese/ming
 
-LIB_DEPENDS=	ming.3:${PORTSDIR}/japanese/ming
-
 RUBY_MING_VERSION=	0.1.6
 
 USE_RUBY=	yes
@@ -29,10 +25,19 @@
 DOCS_EN=	ChangeLog README.en Usage_en.txt fonts.en
 DOCS_JA=	README.ja Usage_ja.txt fonts.ja progress.rd
 
+OPTIONS_DEFINE=	DOCS EXAMPLES
+OPTIONSFILE=	${PORT_DBDIR}/ja-ruby-${PORTNAME}/options
+
+.include <bsd.port.pre.mk>
+
+PKGNAMEPREFIX:=	${PKGNAMEPREFIX}${RUBY_PKGNAMEPREFIX}
+
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MEXAMPLES}
 	${MKDIR} ${RUBY_MODEXAMPLESDIR}
 	${INSTALL_DATA} ${WRKSRC}/examples/* ${RUBY_MODEXAMPLESDIR}/
+.endif
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${RUBY_MODDOCDIR}/ja
 .for f in ${DOCS_EN}
 	${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/
@@ -42,8 +47,4 @@
 .endfor
 .endif
 
-.include <bsd.port.pre.mk>
-.if ${RUBY_VER} == 1.9
-BROKEN=	does not build with ruby 1.9
-.endif
 .include <bsd.port.post.mk>
Index: files/patch-ext-ming-ming-ming.c
===================================================================
--- files/patch-ext-ming-ming-ming.c	(revision 0)
+++ files/patch-ext-ming-ming-ming.c	(working copy)
@@ -0,0 +1,28 @@
+--- ext/ming/ming/ming.c~	2003-09-28 13:51:44.000000000 +0900
++++ ext/ming/ming/ming.c	2013-04-16 20:05:48.000000000 +0900
+@@ -56,10 +56,10 @@
+ {
+   if(TYPE(c) != T_STRING)
+ 	rb_raise(rb_eMingError, "Argument must be a character on keyboard.");
+-  if(RSTRING(c)->len != 1)
++  if(RSTRING_LEN(c) != 1)
+ 	rb_raise(rb_eMingError, "Size of argument must be just 1.");
+   
+-  return INT2FIX(SWFBUTTON_KEYPRESS(RSTRING(c)->ptr[0]));
++  return INT2FIX(SWFBUTTON_KEYPRESS(RSTRING_PTR(c)[0]));
+ }
+ 
+ static VALUE
+@@ -68,10 +68,10 @@
+ {
+   if(TYPE(c) != T_STRING)
+ 	rb_raise(rb_eMingError, "Argument must be character on keyboard.");
+-  if(RSTRING(c)->len != 1)
++  if(RSTRING_LEN(c) != 1)
+ 	rb_raise(rb_eMingError, "Size of argument must be just 1.");
+ 
+-  return INT2FIX(SWFBUTTON_ONKEYPRESS(RSTRING(c)->ptr[0]));
++  return INT2FIX(SWFBUTTON_ONKEYPRESS(RSTRING_PTR(c)[0]));
+ }
+ 
+ void rb_Ming_raise(char *msg, ...)
Index: files/patch-ext-ming-ming-swfaction.c
===================================================================
--- files/patch-ext-ming-ming-swfaction.c	(revision 0)
+++ files/patch-ext-ming-ming-swfaction.c	(working copy)
@@ -0,0 +1,11 @@
+--- ext/ming/ming/swfaction.c~	2003-09-28 13:30:00.000000000 +0900
++++ ext/ming/ming/swfaction.c	2013-04-16 20:14:23.000000000 +0900
+@@ -36,7 +36,7 @@
+ rb_SWFAction_s_new(self, s)
+ 	 VALUE self, s;
+ {
+-  char *script = STR2CSTR(s);
++  char *script = StringValuePtr(s);
+   struct RSWFAction *a = ALLOC(struct RSWFAction);
+   VALUE obj;
+ 
Index: files/patch-ext-ming-ming-swfbitmap.c
===================================================================
--- files/patch-ext-ming-ming-swfbitmap.c	(revision 0)
+++ files/patch-ext-ming-ming-swfbitmap.c	(working copy)
@@ -0,0 +1,27 @@
+--- ext/ming/ming/swfbitmap.c.orig	2003-09-28 11:54:54.000000000 +0900
++++ ext/ming/ming/swfbitmap.c	2013-04-16 20:14:57.000000000 +0900
+@@ -39,13 +39,13 @@
+ 
+   rb_scan_args(argc, argv, "11", &f, &a);
+ 
+-  filename = STR2CSTR(f);
++  filename = StringValuePtr(f);
+   fp = fopen(filename, "rb");
+   if (fp == NULL)
+     RAISE_NOF(filename);
+ 
+   if(NIL_P(a)) {
+-    len = RSTRING(f)->len;
++    len = RSTRING_LEN(f);
+     if(len > 5) {
+       ext = &filename[len - 5];
+       if(strncmp_ignore_case(ext, ".jpeg", 5) == 0) {
+@@ -64,7 +64,7 @@
+     }
+   } else {
+     
+-    alpha_filename = STR2CSTR(a);
++    alpha_filename = StringValuePtr(a);
+     afp = fopen(alpha_filename, "rb");
+     if (afp == NULL) RAISE_NOF(alpha_filename);
+     
Index: files/patch-ext-ming-ming-swfdisplayitem.c
===================================================================
--- files/patch-ext-ming-ming-swfdisplayitem.c	(revision 0)
+++ files/patch-ext-ming-ming-swfdisplayitem.c	(working copy)
@@ -0,0 +1,11 @@
+--- ext/ming/ming/swfdisplayitem.c~	2003-09-28 14:40:42.000000000 +0900
++++ ext/ming/ming/swfdisplayitem.c	2013-04-16 20:14:56.000000000 +0900
+@@ -190,7 +190,7 @@
+   struct RSWFDisplayItem *i;
+ 
+   Data_Get_Struct(self, struct RSWFDisplayItem, i);
+-  SWFDisplayItem_setName(i->this, STR2CSTR(n));
++  SWFDisplayItem_setName(i->this, StringValuePtr(n));
+ 
+   return self;
+ }
Index: files/patch-ext-ming-ming-swffont.c
===================================================================
--- files/patch-ext-ming-ming-swffont.c	(revision 0)
+++ files/patch-ext-ming-ming-swffont.c	(working copy)
@@ -0,0 +1,31 @@
+--- ext/ming/ming/swffont.c.orig	2003-09-28 12:51:28.000000000 +0900
++++ ext/ming/ming/swffont.c	2013-04-16 20:15:05.000000000 +0900
+@@ -44,16 +44,16 @@
+ 	 VALUE self, n;
+ {
+   struct RSWFFont *f = ALLOC(struct RSWFFont);
+-  char *name = STR2CSTR(n), *ext;
++  char *name = StringValuePtr(n), *ext;
+   size_t len;
+   FILE *fp;
+   VALUE obj;
+ 
+   VALUE path = rb_cv_get(rb_cSWFFont, "@@font_path");
+-  len = RSTRING(n)->len;
++  len = RSTRING_LEN(n);
+ 
+   if(len > 4) {
+-    ext = &name[RSTRING(n)->len - 4];
++    ext = &name[RSTRING_LEN(n) - 4];
+ 
+     if (strncmp_ignore_case(ext, ".fdb", 4) == 0) {
+       fp = search_file(path, name, "rb");
+@@ -92,7 +92,7 @@
+ 
+   Data_Get_Struct(self, struct RSWFFont, f);
+ 
+-  return rb_float_new(SWFFont_getStringWidth(f->this, STR2CSTR(s)));
++  return rb_float_new(SWFFont_getStringWidth(f->this, StringValuePtr(s)));
+ }
+ 
+ static VALUE
Index: files/patch-ext-ming-ming-swfmovie.c
===================================================================
--- files/patch-ext-ming-ming-swfmovie.c	(revision 0)
+++ files/patch-ext-ming-ming-swfmovie.c	(working copy)
@@ -0,0 +1,47 @@
+--- ext/ming/ming/swfmovie.c~	2003-09-28 13:22:16.000000000 +0900
++++ ext/ming/ming/swfmovie.c	2013-04-16 20:15:18.000000000 +0900
+@@ -108,7 +108,7 @@
+   int count;
+ 
+   Data_Get_Struct(self, struct RSWFMovie, m);
+-  count = SWFMovie_save(m->this, STR2CSTR(s));
++  count = SWFMovie_save(m->this, StringValuePtr(s));
+ 
+   return INT2NUM(count);
+ }
+@@ -226,7 +226,7 @@
+   struct RSWFMovie *m;
+ 
+   Data_Get_Struct(self, struct RSWFMovie, m);
+-  SWFMovie_labelFrame(m->this, STR2CSTR(label));
++  SWFMovie_labelFrame(m->this, StringValuePtr(label));
+ 
+   return self;
+ }
+@@ -248,7 +248,7 @@
+ 	 VALUE self, n;
+ {
+   struct RSWFMovie *m;
+-  char *name = STR2CSTR(n);
++  char *name = StringValuePtr(n);
+   FILE *fp;
+   VALUE path = rb_cv_get(rb_cSWFMovie, "@@mp3_path");
+ #ifdef SUPPORT_PCM
+@@ -286,7 +286,7 @@
+   Data_Get_Struct(block, struct RSWFBlock, b);
+ 
+   regist_references(m->table, n);
+-  SWFMovie_addExport(m->this, b->this, STR2CSTR(n));
++  SWFMovie_addExport(m->this, b->this, StringValuePtr(n));
+   
+   return self;
+ }
+@@ -331,7 +331,7 @@
+ {
+   struct RSWFMovie *m;
+   struct RSWFDisplayItem *i;
+-  char *name = STR2CSTR(n);
++  char *name = StringValuePtr(n);
+   FILE *fp;
+   VALUE obj, path = rb_cv_get(rb_cSWFMovie, "@@mp3_path");
+   SWFSound sound;
Index: files/patch-ext-ming-ming-swfmovieclip.c
===================================================================
--- files/patch-ext-ming-ming-swfmovieclip.c	(revision 0)
+++ files/patch-ext-ming-ming-swfmovieclip.c	(working copy)
@@ -0,0 +1,20 @@
+--- ext/ming/ming/swfmovieclip.c~	2003-09-28 12:33:14.000000000 +0900
++++ ext/ming/ming/swfmovieclip.c	2013-04-16 20:20:00.000000000 +0900
+@@ -135,7 +135,7 @@
+ 
+   Data_Get_Struct(self, struct RSWFMovieClip, m);
+ 
+-  SWFMovieClip_labelFrame(m->this, STR2CSTR(s));
++  SWFMovieClip_labelFrame(m->this, StringValuePtr(s));
+ 
+   return self;
+ }
+@@ -158,7 +158,7 @@
+ 	 VALUE self, n, r;
+ {
+   struct RSWFMovie *m;
+-  char *name = STR2CSTR(n);
++  char *name = StringValuePtr(n);
+   FILE *fp;
+   VALUE path = rb_cv_get(rb_cSWFMovie, "@@mp3_path");
+ #ifdef SUPPORT_PCM
Index: files/patch-ext-ming-ming-swftext.c
===================================================================
--- files/patch-ext-ming-ming-swftext.c	(revision 0)
+++ files/patch-ext-ming-ming-swftext.c	(working copy)
@@ -0,0 +1,20 @@
+--- ext/ming/ming/swftext.c~	2003-09-28 13:30:34.000000000 +0900
++++ ext/ming/ming/swftext.c	2013-04-16 20:19:32.000000000 +0900
+@@ -143,7 +143,7 @@
+ 
+   Data_Get_Struct(self, struct RSWFText, p);
+ 
+-  SWFText_addString(p->this, STR2CSTR(s), NULL);
++  SWFText_addString(p->this, StringValuePtr(s), NULL);
+   return self;
+ }
+ 
+@@ -154,7 +154,7 @@
+   struct RSWFText *p;
+ 
+   Data_Get_Struct(self, struct RSWFText, p);
+-  return rb_float_new(SWFText_getStringWidth(p->this, STR2CSTR(s)));
++  return rb_float_new(SWFText_getStringWidth(p->this, StringValuePtr(s)));
+ }
+ 
+ static VALUE
Index: files/patch-ext-ming-ming-swftextfield.c
===================================================================
--- files/patch-ext-ming-ming-swftextfield.c	(revision 0)
+++ files/patch-ext-ming-ming-swftextfield.c	(working copy)
@@ -0,0 +1,20 @@
+--- ext/ming/ming/swftextfield.c~	2003-09-28 12:01:42.000000000 +0900
++++ ext/ming/ming/swftextfield.c	2013-04-16 20:19:44.000000000 +0900
+@@ -209,7 +209,7 @@
+   struct RSWFTextField *t;
+ 
+   Data_Get_Struct(self, struct RSWFTextField, t);
+-  SWFTextField_addString(t->this, STR2CSTR(s));
++  SWFTextField_addString(t->this, StringValuePtr(s));
+ 
+   return self;
+ }
+@@ -245,7 +245,7 @@
+   struct RSWFTextField *t;
+ 
+   Data_Get_Struct(self, struct RSWFTextField, t);
+-  SWFTextField_setVariableName(t->this, STR2CSTR(n));
++  SWFTextField_setVariableName(t->this, StringValuePtr(n));
+ 
+   return self;
+ }
Index: files/patch-ext-ming-ming-util.c
===================================================================
--- files/patch-ext-ming-ming-util.c	(revision 0)
+++ files/patch-ext-ming-ming-util.c	(working copy)
@@ -0,0 +1,17 @@
+--- ext/ming/ming/util.c.orig	2003-09-28 13:30:20.000000000 +0900
++++ ext/ming/ming/util.c	2013-04-16 20:19:54.000000000 +0900
+@@ -83,10 +83,10 @@
+   if (fp != NULL)
+ 	return fp;
+   
+-  for(i = 0; i < RARRAY(path)->len; i++) {
+-	item = RARRAY(path)->ptr[i];
+-	dir = STR2CSTR(item);
+-	dir_len = RSTRING(item)->len;
++  for(i = 0; i < RARRAY_LEN(path); i++) {
++	item = RARRAY_PTR(path)[i];
++	dir = StringValuePtr(item);
++	dir_len = RSTRING_LEN(item);
+ 
+ 	if(strncmp(&dir[dir_len - 1], delimiter, 1) != 0) {
+ 	  total_len = dir_len + len + 2;
Index: files/patch-setup.rb
===================================================================
--- files/patch-setup.rb	(revision 0)
+++ files/patch-setup.rb	(working copy)
@@ -0,0 +1,20 @@
+--- setup.rb.orig	2003-09-28 15:35:08.000000000 +0900
++++ setup.rb	2013-04-16 20:12:45.000000000 +0900
+@@ -204,7 +204,7 @@
+ 
+ class ConfigTable
+ 
+-  c = ::Config::CONFIG
++  c = ::RbConfig::CONFIG
+ 
+   rubypath = c['bindir'] + '/' + c['ruby_install_name']
+ 
+@@ -787,7 +787,7 @@
+         raise InstallError, "no ruby extention exists: 'ruby #{$0} setup' first"
+   end
+ 
+-  DLEXT = /\.#{ ::Config::CONFIG['DLEXT'] }\z/
++  DLEXT = /\.#{ ::RbConfig::CONFIG['DLEXT'] }\z/
+ 
+   def _ruby_extentions( dir )
+     Dir.open(dir) {|d|
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 316171)
+++ pkg-plist	(working copy)
@@ -1,18 +1,18 @@
 %%RUBY_SITEARCHLIBDIR%%/ming/ming.so
 @dirrm %%RUBY_SITEARCHLIBDIR%%/ming
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/README
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/action.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/button.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/drag.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/gradient.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/gradientxform.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/keypress.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/mousetrack.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/newbutton.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/shape.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/sparks.rb
-%%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/sprite.rb
-%%PORTDOCS%%@dirrm %%RUBY_MODEXAMPLESDIR%%
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/README
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/action.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/button.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/drag.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/gradient.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/gradientxform.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/keypress.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/mousetrack.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/newbutton.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/shape.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/sparks.rb
+%%PORTEXAMPLES%%%%RUBY_MODEXAMPLESDIR%%/sprite.rb
+%%PORTEXAMPLES%%@dirrm %%RUBY_MODEXAMPLESDIR%%
 %%PORTDOCS%%%%RUBY_MODDOCDIR%%/ChangeLog
 %%PORTDOCS%%%%RUBY_MODDOCDIR%%/README.en
 %%PORTDOCS%%%%RUBY_MODDOCDIR%%/Usage_en.txt
--- ja-ruby20-ming-0.2a.0.1.6_2,1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5173ad43.240b450a.1c16.4063>