pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/ruby-eet Make ruby-eet build with ruby-2.x



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8813297785a7
branches:  trunk
changeset: 361136:8813297785a7
user:      minskim <minskim%pkgsrc.org@localhost>
date:      Fri Apr 14 21:35:34 2017 +0000

description:
Make ruby-eet build with ruby-2.x

This no longer builds with ruby-1.8.x, which will be removed soon.

diffstat:

 devel/ruby-eet/Makefile                            |   4 +-
 devel/ruby-eet/PLIST                               |   4 +-
 devel/ruby-eet/distinfo                            |   8 +-
 devel/ruby-eet/patches/patch-Rakefile              |  36 +++++++-
 devel/ruby-eet/patches/patch-ext_ext.c             |  95 ++++++++++++++++++++++
 devel/ruby-eet/patches/patch-rake_configuretask.rb |  13 +++
 devel/ruby-eet/patches/patch-rake_extensiontask.rb |  25 +++++-
 7 files changed, 172 insertions(+), 13 deletions(-)

diffs (253 lines):

diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/Makefile
--- a/devel/ruby-eet/Makefile   Fri Apr 14 21:17:19 2017 +0000
+++ b/devel/ruby-eet/Makefile   Fri Apr 14 21:35:34 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2016/09/08 15:19:16 joerg Exp $
+# $NetBSD: Makefile,v 1.17 2017/04/14 21:35:34 minskim Exp $
 
 DISTNAME=      ruby-eet-0.1.4
 PKGNAME=       ${RUBY_PKGPREFIX}-${DISTNAME:S/ruby-//}
@@ -11,8 +11,6 @@
 COMMENT=       Ruby module to read and write EET files
 LICENSE=       mit
 
-RUBY_VERSIONS_ACCEPTED= 18
-
 RUBY_RDOC_REQD=        2.0.0
 USE_RAKE=      YES
 USE_TOOLS+=    pkg-config
diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/PLIST
--- a/devel/ruby-eet/PLIST      Fri Apr 14 21:17:19 2017 +0000
+++ b/devel/ruby-eet/PLIST      Fri Apr 14 21:35:34 2017 +0000
@@ -1,3 +1,3 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2008/10/26 06:12:29 minskim Exp $
+@comment $NetBSD: PLIST,v 1.2 2017/04/14 21:35:34 minskim Exp $
 ${RUBY_SITELIB}/eet.rb
-${RUBY_SITEARCHLIB}/eet_ext.${RUBY_DLEXT}
+${RUBY_SITEARCHLIB}/eet_ext.so
diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/distinfo
--- a/devel/ruby-eet/distinfo   Fri Apr 14 21:17:19 2017 +0000
+++ b/devel/ruby-eet/distinfo   Fri Apr 14 21:35:34 2017 +0000
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.4 2015/11/03 03:29:22 agc Exp $
+$NetBSD: distinfo,v 1.5 2017/04/14 21:35:34 minskim Exp $
 
 SHA1 (ruby-eet-0.1.4.tar.gz) = 16e1824179b019f48a554388aadf5168521cad51
 RMD160 (ruby-eet-0.1.4.tar.gz) = 10521754510e8f8bd00372031d663c0ebdae41c2
 SHA512 (ruby-eet-0.1.4.tar.gz) = 0f6cac9e981a8cc0c1614111e4d7aa9f3f80e2080aed3fa0cbc6ac7aa689ba95e854b53859ebb7ff9904f9b9b94916e0e86f1a1c47d15c00e86d0493ede9e2f5
 Size (ruby-eet-0.1.4.tar.gz) = 19972 bytes
-SHA1 (patch-Rakefile) = 5991edede98deb936702f775ec38b9e3a7ca68eb
-SHA1 (patch-rake_extensiontask.rb) = 89ab3da8bcbf2e1ec5a8ca4f9047ec19698f4392
+SHA1 (patch-Rakefile) = 2b9ccd581f75ce04d03889ffd58ad4072a8a6fd7
+SHA1 (patch-ext_ext.c) = 5bb8a156415b960e369d1f3cf637f07dbaed3c3c
+SHA1 (patch-rake_configuretask.rb) = 04b836c314954cee4b1ced214fbd5eafca6b77a9
+SHA1 (patch-rake_extensiontask.rb) = d6b15569753b2475a833a7b33ef8344b48696650
diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/patches/patch-Rakefile
--- a/devel/ruby-eet/patches/patch-Rakefile     Fri Apr 14 21:17:19 2017 +0000
+++ b/devel/ruby-eet/patches/patch-Rakefile     Fri Apr 14 21:35:34 2017 +0000
@@ -1,10 +1,10 @@
-$NetBSD: patch-Rakefile,v 1.1 2013/03/07 17:00:44 taca Exp $
+$NetBSD: patch-Rakefile,v 1.2 2017/04/14 21:35:34 minskim Exp $
 
 * Require modern task rule from rdoc.
 
 --- Rakefile.orig      2007-03-23 11:32:09.000000000 +0000
 +++ Rakefile
-@@ -1,7 +1,7 @@
+@@ -1,13 +1,13 @@
  require "rbconfig"
  require "rake/clean"
  require "rake/testtask"
@@ -13,3 +13,35 @@
  require "rake/packagetask"
  require "rake/contrib/compositepublisher"
  require "rake/contrib/sshpublisher"
+ 
+-require "rake/configuretask"
+-require "rake/extensiontask"
++require_relative "rake/configuretask"
++require_relative "rake/extensiontask"
+ 
+ PKG_NAME = "ruby-eet"
+ PKG_VERSION = File.read("lib/eet.rb").
+@@ -43,6 +43,9 @@ task :pre_ext => [:configure] do
+ 
+       cflags = [
+               ext.env[:cflags],
++              "-I#{RbConfig::CONFIG["rubyhdrdir"]}",
++              "-I#{RbConfig::CONFIG["rubyhdrdir"]}/ruby",
++              "-I#{RbConfig::CONFIG["rubyhdrdir"]}/#{RbConfig::CONFIG["arch"]}",
+               config.eet.cflags
+       ]
+ 
+@@ -52,11 +55,11 @@ end
+ task :install => [:ext] do |t|
+       destdir = ENV["DESTDIR"] || ""
+ 
+-      ddir = destdir + Config::CONFIG["sitearchdir"]
++      ddir = destdir + RbConfig::CONFIG["sitearchdir"]
+       FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
+       FileUtils::Verbose.install(ext.lib_name, ddir, :mode => 0755)
+ 
+-      ddir = destdir + Config::CONFIG["sitelibdir"]
++      ddir = destdir + RbConfig::CONFIG["sitelibdir"]
+       FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
+       FileUtils::Verbose.install("lib/eet.rb", ddir, :mode => 0644)
+ end
diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/patches/patch-ext_ext.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/ruby-eet/patches/patch-ext_ext.c    Fri Apr 14 21:35:34 2017 +0000
@@ -0,0 +1,95 @@
+$NetBSD: patch-ext_ext.c,v 1.1 2017/04/14 21:35:34 minskim Exp $
+
+--- ext/ext.c.orig     2007-03-23 11:21:39.000000000 +0000
++++ ext/ext.c
+@@ -334,7 +334,7 @@ c_write (int argc, VALUE *argv, VALUE se
+       cbuf = StringValuePtr (buf);
+ 
+       n = eet_write (*ef, ckey,
+-                     cbuf, RSTRING (buf)->len,
++                     cbuf, RSTRING_LENINT(buf),
+                      comp == Qtrue);
+       if (!n)
+               rb_raise (rb_eIOError, "couldn't write to file");
+@@ -445,7 +445,7 @@ c_write_image (int argc, VALUE *argv, VA
+                       quality = FIX2INT (tmp);
+       }
+ 
+-      if (!RSTRING (buf)->len)
++      if (!RSTRING_LEN(buf))
+               return INT2FIX (0);
+ 
+       n = eet_data_image_write (*ef, ckey, cbuf,
+@@ -472,8 +472,8 @@ chunk_init (VALUE self, VALUE tag, VALUE
+       /* libeet uses a signed 32bit integer to store the
+        * chunk size, so make sure we don't overflow it
+        */
+-      tag_len = RSTRING (tag)->len;
+-      data_len = RSTRING (data)->len;
++      tag_len = RSTRING_LEN(tag);
++      data_len = RSTRING_LEN(data);
+       tmp = tag_len + 1 + data_len;
+ 
+       if (tmp < tag_len || tmp < data_len || tmp < 1 || tmp >= 2147483647L)
+@@ -499,26 +499,25 @@ chunk_to_s (VALUE self)
+       tmp = rb_ivar_get (self, id_data);
+       data = RSTRING (tmp);
+ 
+-      buf_len = 9 + tag->len + data->len;
++      buf_len = 9 + RSTRING_LENINT(tag) + RSTRING_LENINT(data);
+       ret = rb_str_buf_new (buf_len);
+ 
+-      buf = (unsigned char *) RSTRING (ret)->ptr;
+-      RSTRING (ret)->len = buf_len;
++      buf = (unsigned char *) RSTRING_PTR(ret);
+ 
+       memcpy (buf, "CHnK", 4);
+       buf += 4;
+ 
+-      size = tag->len + data->len + 1;
++      size = RSTRING_LENINT(tag) + RSTRING_LENINT(data) + 1;
+       size = BSWAP32 (size);
+       memcpy (buf, &size, 4);
+       buf += 4;
+ 
+-      memcpy (buf, tag->ptr, tag->len);
+-      buf += tag->len;
++      memcpy (buf, RSTRING_PTR(tag), RSTRING_LEN(tag));
++      buf += RSTRING_LEN(tag);
+ 
+       *buf++ = 0;
+ 
+-      memcpy (buf, data->ptr, data->len);
++      memcpy (buf, RSTRING_PTR(data), RSTRING_LEN(data));
+ 
+       return ret;
+ }
+@@ -561,13 +560,13 @@ c_to_eet (VALUE self)
+       props = rb_funcall (self, id_to_eet_properties, 0);
+ 
+       if (rb_obj_is_kind_of (props, rb_cHash) == Qfalse ||
+-          !RHASH (props)->tbl->num_entries)
++          !RHASH_TBL(props)->num_entries)
+               rb_raise (ePropError, "invalid EET properties");
+ 
+       name = rb_funcall (self, id_to_eet_name, 0);
+       StringValue (name);
+ 
+-      if (!RSTRING (name)->len ||
++      if (!RSTRING_LEN(name) ||
+           rb_funcall (name, id_include, 1, INT2FIX (0)))
+               rb_raise (eNameError, "invalid EET name");
+ 
+@@ -578,9 +577,9 @@ c_to_eet (VALUE self)
+ #else
+       keys = RARRAY (rb_funcall (props, id_keys, 0));
+ 
+-      for (i = 0; i < keys->len; i++)
+-              for_each_prop (keys->ptr[i],
+-                             rb_hash_aref (props, keys->ptr[i]),
++      for (i = 0; i < RARRAY_LENINT(keys); i++)
++              for_each_prop (RARRAY_PTR(keys)[i],
++                             rb_hash_aref (props, RARRAY_PTR(keys)[i]),
+                              stream);
+ #endif
+ 
diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/patches/patch-rake_configuretask.rb
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/ruby-eet/patches/patch-rake_configuretask.rb        Fri Apr 14 21:35:34 2017 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-rake_configuretask.rb,v 1.1 2017/04/14 21:35:34 minskim Exp $
+
+--- rake/configuretask.rb.orig 2007-03-23 11:05:12.000000000 +0000
++++ rake/configuretask.rb
+@@ -244,7 +244,7 @@ module Rake
+ 
+                               cc = ENV["CC"] || "cc"
+                               flags = (ENV["CFLAGS"] || "").dup
+-                              flags << " -I" + Config::CONFIG["archdir"]
++                              flags << " -I" + RbConfig::CONFIG["includedir"]
+ 
+                               unless @opts[:try_link]
+                                       flags << " -c"
diff -r ace76152d278 -r 8813297785a7 devel/ruby-eet/patches/patch-rake_extensiontask.rb
--- a/devel/ruby-eet/patches/patch-rake_extensiontask.rb        Fri Apr 14 21:17:19 2017 +0000
+++ b/devel/ruby-eet/patches/patch-rake_extensiontask.rb        Fri Apr 14 21:35:34 2017 +0000
@@ -1,15 +1,34 @@
-$NetBSD: patch-rake_extensiontask.rb,v 1.1 2011/08/12 16:29:04 taca Exp $
+$NetBSD: patch-rake_extensiontask.rb,v 1.2 2017/04/14 21:35:34 minskim Exp $
 
 * Add proper compiler flags.
 
 --- rake/extensiontask.rb.orig 2007-03-23 11:05:12.000000000 +0000
 +++ rake/extensiontask.rb
-@@ -98,7 +98,7 @@ module Rake
+@@ -98,15 +98,15 @@ module Rake
      def define_rules
        for ext in env[:c_exts]
          Rake::Task.create_rule '.'+env[:objext] => '.'+ext do |r|
 -          sh_cmd :cc, :cflags, :cppflags, {'-D' => :defines}, {'-I' => :includedirs}, {'-I' => :topdir},
+-                '-c', '-o', r.name, r.sources
 +          sh_cmd :cc, :cflags, :ccdlflags, :cppflags, {'-D' => :defines}, {'-I' => :includedirs}, {'-I' => :topdir},
-                 '-c', '-o', r.name, r.sources
++                '-c', '-o', r.name, r.sources.join(' ')
          end
        end
+ 
+       for ext in env[:cpp_exts]
+         Rake::Task.create_rule '.'+env[:objext] => '.'+ext do |r|
+           sh_cmd :cxx, :cxxflags, :cppflags, {'-D' => :defines}, {'-I' => :includedirs}, {'-I' => :topdir},
+-                '-o', r.name, '-c', r.sources
++                '-o', r.name, '-c', r.sources.join(' ')
+         end
+       end
+     end
+@@ -121,7 +121,7 @@ module Rake
+         @@DefaultEnv = e
+       end
+ 
+-      Config::CONFIG.merge(ENV).each { |k, v| @@DefaultEnv[k.downcase.to_sym] = v }
++      RbConfig::CONFIG.merge(ENV).each { |k, v| @@DefaultEnv[k.downcase.to_sym] = v }
+       @@DefaultEnv = {
+         :cxx => 'c++',
+         :cxxflags => '',



Home | Main Index | Thread Index | Old Index