summaryrefslogtreecommitdiff
path: root/lang/ruby21-base
diff options
context:
space:
mode:
authortaca <taca>2014-12-14 13:59:53 +0000
committertaca <taca>2014-12-14 13:59:53 +0000
commit13fe53af453224dc28835c2437bce50c322b7727 (patch)
treefa36aa592e84b792e7b361c7bbdf89f2dc3d9e91 /lang/ruby21-base
parent393657680f35a1d123bf81f95106fb541ae5dd16 (diff)
downloadpkgsrc-13fe53af453224dc28835c2437bce50c322b7727.tar.gz
Add patches for supporting tcl/tk 8.6 on ruby-tk package.
Diffstat (limited to 'lang/ruby21-base')
-rw-r--r--lang/ruby21-base/distinfo12
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_extconf.rb19
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tk.rb56
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tk_autoload.rb15
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tk_fontchooser.rb17
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tk_tk__mac.rb165
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tcllib_validator.rb72
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tile_treeview.rb50
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_dted.rb40
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_raw.rb40
-rw-r--r--lang/ruby21-base/patches/patch-ext_tk_tcltklib.c170
11 files changed, 655 insertions, 1 deletions
diff --git a/lang/ruby21-base/distinfo b/lang/ruby21-base/distinfo
index 7b215237737..34b3442dfa5 100644
--- a/lang/ruby21-base/distinfo
+++ b/lang/ruby21-base/distinfo
@@ -1,9 +1,19 @@
-$NetBSD: distinfo,v 1.10 2014/11/15 14:42:20 taca Exp $
+$NetBSD: distinfo,v 1.11 2014/12/14 14:00:17 taca Exp $
SHA1 (ruby-2.1.5.tar.bz2) = d822e022bb8875724852f049f499f101d24a7fe5
RMD160 (ruby-2.1.5.tar.bz2) = 32019c949a8c9bb716f6683a20f19231da452fda
Size (ruby-2.1.5.tar.bz2) = 11994454 bytes
SHA1 (patch-configure) = 40da4aec83fcb9cf026d2b458ff3beb6dcf7776a
+SHA1 (patch-ext_tk_extconf.rb) = fc80ef5a2859736ae85303cfb2fc78ce8bc70fbc
+SHA1 (patch-ext_tk_lib_tk.rb) = 78034ed6fa0f24099ce06a717da2423731b276cb
+SHA1 (patch-ext_tk_lib_tk_autoload.rb) = e8bcb93feae90fd46531a412f6c963a6d5d2c132
+SHA1 (patch-ext_tk_lib_tk_fontchooser.rb) = cb0155332e5f519ada386fae770cd2f879527323
+SHA1 (patch-ext_tk_lib_tk_tk__mac.rb) = 24b9f282558200780adbf93e71edd1aa52d1c82b
+SHA1 (patch-ext_tk_lib_tkextlib_tcllib_validator.rb) = fb0cb5a138c2ae311d368ec4472ddd6bc36a0709
+SHA1 (patch-ext_tk_lib_tkextlib_tile_treeview.rb) = e31201b5d0f5c333f14b795ac5e670fdb9a250cf
+SHA1 (patch-ext_tk_lib_tkextlib_tkimg_dted.rb) = b0786f50ebab4b5a0ccf916054bc13fbd6820541
+SHA1 (patch-ext_tk_lib_tkextlib_tkimg_raw.rb) = 92a4bc7b995554b9933b1e9f9ce4df87e365bcfb
+SHA1 (patch-ext_tk_tcltklib.c) = 475affcb88a06ac6daf622814a9da5027ca3d34e
SHA1 (patch-lib_rdoc_ri_driver.rb) = 5bdd3ed6f50a2ea79f643c6bebd7ad0063e79051
SHA1 (patch-lib_rubygems.rb) = 9d27fa8c96f285461fbb08df7491a0a48ed612e1
SHA1 (patch-lib_rubygems_commands_setup__command.rb) = 46991d63256d0d3cc2f707fb286d1691331ad40e
diff --git a/lang/ruby21-base/patches/patch-ext_tk_extconf.rb b/lang/ruby21-base/patches/patch-ext_tk_extconf.rb
new file mode 100644
index 00000000000..389e31dac45
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_extconf.rb
@@ -0,0 +1,19 @@
+$NetBSD: patch-ext_tk_extconf.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- ext/tk/extconf.rb.orig 2013-11-30 02:46:47.000000000 +0000
++++ ext/tk/extconf.rb
+@@ -9,10 +9,10 @@ TkLib_Config['search_versions'] =
+ # %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2]
+ # %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0]
+ # %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps
+- %w[8.5 8.4] # At present, Tcl/Tk8.6 is not supported.
++ %w[8.6 8.5 8.4]
+
+ TkLib_Config['unsupported_versions'] =
+- %w[8.8 8.7 8.6] # At present, Tcl/Tk8.6 is not supported.
++ %w[8.8 8.7]
+
+ TkLib_Config['major_nums'] = '87'
+
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tk.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tk.rb
new file mode 100644
index 00000000000..6fbcd260969
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tk.rb
@@ -0,0 +1,56 @@
+$NetBSD: patch-ext_tk_lib_tk.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- ext/tk/lib/tk.rb.orig 2011-05-26 23:36:33.000000000 +0000
++++ ext/tk/lib/tk.rb
+@@ -1309,8 +1309,12 @@ EOS
+ end
+
+ unless interp.deleted?
+- #Thread.current[:status].value = TclTkLib.mainloop(false)
+- Thread.current[:status].value = interp.mainloop(false)
++ begin
++ #Thread.current[:status].value = TclTkLib.mainloop(false)
++ Thread.current[:status].value = interp.mainloop(false)
++ rescue Exception=>e
++ puts "ignore exception on interp: #{e.inspect}\n" if $DEBUG
++ end
+ end
+
+ ensure
+@@ -1569,7 +1573,15 @@ EOS
+ EOL
+ =end
+
+- at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
++ if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
++ at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
++ else
++ at_exit{
++ Tk.root.destroy
++ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME)
++ INTERP_THREAD.kill.join
++ }
++ end
+
+ EventFlag = TclTkLib::EventFlag
+
+@@ -5197,6 +5209,8 @@ class TkWindow<TkObject
+ TkWinfo.exist?(self)
+ end
+
++ alias subcommand tk_send
++
+ def bind_class
+ @db_class || self.class()
+ end
+@@ -5742,7 +5756,7 @@ TkWidget = TkWindow
+ #Tk.freeze
+
+ module Tk
+- RELEASE_DATE = '2010-06-03'.freeze
++ RELEASE_DATE = '2014-10-19'.freeze
+
+ autoload :AUTO_PATH, 'tk/variable'
+ autoload :TCL_PACKAGE_PATH, 'tk/variable'
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tk_autoload.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tk_autoload.rb
new file mode 100644
index 00000000000..b4911306297
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tk_autoload.rb
@@ -0,0 +1,15 @@
+$NetBSD: patch-ext_tk_lib_tk_autoload.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- ext/tk/lib/tk/autoload.rb.orig 2011-05-15 11:55:52.000000000 +0000
++++ ext/tk/lib/tk/autoload.rb
+@@ -94,6 +94,8 @@ module Tk
+ autoload :Y_Scrollable, 'tk/scrollable'
+ autoload :Scrollable, 'tk/scrollable'
+
++ autoload :Fontchooser, 'tk/fontchooser'
++
+ autoload :Wm, 'tk/wm'
+ autoload :Wm_for_General, 'tk/wm'
+
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tk_fontchooser.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tk_fontchooser.rb
new file mode 100644
index 00000000000..bb6446965e5
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tk_fontchooser.rb
@@ -0,0 +1,17 @@
+$NetBSD: patch-ext_tk_lib_tk_fontchooser.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- ext/tk/lib/tk/fontchooser.rb.orig 2011-05-15 11:55:52.000000000 +0000
++++ ext/tk/lib/tk/fontchooser.rb
+@@ -8,6 +8,10 @@ module TkFont::Chooser
+ extend TkCore
+ end
+
++module Tk
++ Fontchooser = TkFont::Chooser
++end
++
+ class << TkFont::Chooser
+ def method_missing(id, *args)
+ name = id.id2name
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tk_tk__mac.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tk_tk__mac.rb
new file mode 100644
index 00000000000..209cc402181
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tk_tk__mac.rb
@@ -0,0 +1,165 @@
+$NetBSD: patch-ext_tk_lib_tk_tk__mac.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- /dev/null 2014-12-14 12:34:31.000000000 +0000
++++ ext/tk/lib/tk/tk_mac.rb
+@@ -0,0 +1,158 @@
++#
++# tk/tk_mac.rb : Access Mac-Specific functionality on OS X from Tk
++# (supported by Tk8.6 or later)
++#
++# ATTENTION !!
++# This is NOT TESTED. Because I have no test-environment.
++#
++require 'tk'
++
++module Tk
++ module Mac
++ end
++end
++
++module Tk::Mac
++ extend TkCore
++
++ # event handler callbacks
++ def self.def_ShowPreferences(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::ShowPreferences {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++ def self.def_OpenApplication(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::OpenApplication {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++ def self.def_ReopenApplication(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::ReopenApplication {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++ def self.def_OpenDocument(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::OpenDocument {args} { eval #{install_cmd(cmd)} $args }")
++ nil
++ end
++
++ def self.def_PrintDocument(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::PrintDocument {args} { eval #{install_cmd(cmd)} $args }")
++ nil
++ end
++
++ def self.def_Quit(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::Quit {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++ def self.def_OnHide(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::OnHide {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++ def self.def_OnShow(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::OnShow {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++ def self.def_ShowHelp(cmd=Proc.new)
++ ip_eval("proc ::tk::mac::ShowHelp {} { #{install_cmd(cmd)} }")
++ nil
++ end
++
++
++ # additional dialogs
++ def self.standardAboutPanel
++ tk_call('::tk::mac::standardAboutPanel')
++ nil
++ end
++
++
++ # system configuration
++ def self.useCompatibilityMetrics(mode)
++ tk_call('::tk::mac::useCompatibilityMetrics', mode)
++ nil
++ end
++
++ def self.CGAntialiasLimit(limit)
++ tk_call('::tk::mac::CGAntialiasLimit', limit)
++ nil
++ end
++
++ def self.antialiasedtext(num)
++ tk_call('::tk::mac::antialiasedtext', num)
++ nil
++ end
++
++ def self.useThemedToplevel(mode)
++ tk_call('::tk::mac::useThemedToplevel', mode)
++ nil
++ end
++
++end
++
++class Tk::Mac::IconBitmap < TkImage
++ TkCommandNames = ['::tk::mac::iconBitmap'].freeze
++
++ def self.new(width, height, keys)
++ if keys.kind_of?(Hash)
++ name = nil
++ if keys.key?(:imagename)
++ name = keys[:imagename]
++ elsif keys.key?('imagename')
++ name = keys['imagename']
++ end
++ if name
++ if name.kind_of?(TkImage)
++ obj = name
++ else
++ name = _get_eval_string(name)
++ obj = nil
++ Tk_IMGTBL.mutex.synchronize{
++ obj = Tk_IMGTBL[name]
++ }
++ end
++ if obj
++ if !(keys[:without_creating] || keys['without_creating'])
++ keys = _symbolkey2str(keys)
++ keys.delete('imagename')
++ keys.delete('without_creating')
++ obj.instance_eval{
++ tk_call_without_enc('::tk::mac::iconBitmap',
++ @path, width, height, *hash_kv(keys, true))
++ }
++ end
++ return obj
++ end
++ end
++ end
++ (obj = self.allocate).instance_eval{
++ Tk_IMGTBL.mutex.synchronize{
++ initialize(width, height, keys)
++ Tk_IMGTBL[@path] = self
++ }
++ }
++ obj
++ end
++
++ def initialize(width, height, keys)
++ @path = nil
++ without_creating = false
++ if keys.kind_of?(Hash)
++ keys = _symbolkey2str(keys)
++ @path = keys.delete('imagename')
++ without_creating = keys.delete('without_creating')
++ end
++ unless @path
++ Tk_Image_ID.mutex.synchronize{
++ @path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
++ Tk_Image_ID[1].succ!
++ }
++ end
++ unless without_creating
++ tk_call_without_enc('::tk::mac::iconBitmap',
++ @path, width, height, *hash_kv(keys, true))
++ end
++ end
++end
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tcllib_validator.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tcllib_validator.rb
new file mode 100644
index 00000000000..8b3c51081e8
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tcllib_validator.rb
@@ -0,0 +1,72 @@
+$NetBSD: patch-ext_tk_lib_tkextlib_tcllib_validator.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- /dev/null 2014-12-14 12:38:18.000000000 +0000
++++ ext/tk/lib/tkextlib/tcllib/validator.rb
+@@ -0,0 +1,65 @@
++#
++# tkextlib/tcllib/validator.rb
++# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
++#
++# * Part of tcllib extension
++# * Provides a unified validation API
++#
++
++require 'tk'
++require 'tkextlib/tcllib.rb'
++
++# TkPackage.require('widget::validator', '0.1')
++TkPackage.require('widget::validator')
++
++module Tk::Tcllib
++ module Validator
++ PACKAGE_NAME = 'widget::validator'.freeze
++ def self.package_name
++ PACKAGE_NAME
++ end
++
++ def self.package_version
++ begin
++ TkPackage.require('widget::validator')
++ rescue
++ ''
++ end
++ end
++ end
++end
++
++module Tk::Tcllib::Validator
++ extend TkCore
++
++ def self.attach(widget, color, cmd=Proc.new)
++ tk_call_without_enc('::widget::validator', 'attach', widget, color, cmd)
++ nil
++ end
++
++ def self.detach(widget)
++ tk_call_without_enc('::widget::validator', 'detach', widget)
++ nil
++ end
++
++ def self.validate(widget)
++ tk_call_without_enc('::widget::validator', 'validate', widget)
++ nil
++ end
++
++ def attach_validator(color, cmd=Proc.new)
++ tk_call_without_enc('::widget::validator', 'attach', @path, color, cmd)
++ self
++ end
++
++ def detach_validator(color, cmd=Proc.new)
++ tk_call_without_enc('::widget::validator', 'detach', @path)
++ self
++ end
++
++ def invoke_validator(color, cmd=Proc.new)
++ tk_call_without_enc('::widget::validator', 'validate', @path)
++ self
++ end
++ alias validate_validator invoke_validator
++end
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tile_treeview.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tile_treeview.rb
new file mode 100644
index 00000000000..7f362119ca6
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tile_treeview.rb
@@ -0,0 +1,50 @@
+$NetBSD: patch-ext_tk_lib_tkextlib_tile_treeview.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- ext/tk/lib/tkextlib/tile/treeview.rb.orig 2009-10-02 10:45:39.000000000 +0000
++++ ext/tk/lib/tkextlib/tile/treeview.rb
+@@ -986,6 +986,18 @@ class Tk::Tile::Treeview::Tag < TkObject
+ end
+ alias added? tag_has?
+
++ def tag_has
++ @t.tag_has(@id)
++ end
++
++ def add(*items)
++ @t.tag_add(@id, *items)
++ end
++
++ def remove(*items)
++ @t.tag_remove(@id, *items)
++ end
++
+ def bind(seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+@@ -1299,6 +1311,24 @@ class Tk::Tile::Treeview < TkWindow
+ _bindinfo([@path, 'tag', 'bind', tag], context)
+ end
+ alias tagbindinfo tag_bindinfo
++
++ def tag_names
++ tk_split_simplelist(tk_send('tag', 'names')).collect{|id|
++ Tk::Tile::Treeview::Tag.id2obj(self, id)
++ }
++ end
++
++ def tag_add(tag, *items)
++ fail ArgumentError, "no target items" if items.empty?
++ tk_send('tag', 'add', tagid(tag), *(items.collect{|item| tagid(item)}))
++ self
++ end
++
++ def tag_remove(tag, *items)
++ tk_send('tag', 'remove', tagid(tag), *(items.collect{|item| tagid(item)}))
++ self
++ end
++
+ end
+
+ #Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_dted.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_dted.rb
new file mode 100644
index 00000000000..9cb77b3fa2c
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_dted.rb
@@ -0,0 +1,40 @@
+$NetBSD: patch-ext_tk_lib_tkextlib_tkimg_dted.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- /dev/null 2014-12-14 12:40:18.000000000 +0000
++++ ext/tk/lib/tkextlib/tkimg/dted.rb
+@@ -0,0 +1,33 @@
++#
++# TkImg - format 'DTED'
++# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
++#
++require 'tk'
++
++# call setup script for general 'tkextlib' libraries
++require 'tkextlib/setup.rb'
++
++# call setup script
++require 'tkextlib/tkimg/setup.rb'
++
++# TkPackage.require('img::dted', '1.4')
++TkPackage.require('img::dted')
++
++module Tk
++ module Img
++ module DTED
++ PACKAGE_NAME = 'img::dted'.freeze
++ def self.package_name
++ PACKAGE_NAME
++ end
++
++ def self.package_version
++ begin
++ TkPackage.require('img::dted')
++ rescue
++ ''
++ end
++ end
++ end
++ end
++end
diff --git a/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_raw.rb b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_raw.rb
new file mode 100644
index 00000000000..87cb223f4f3
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_lib_tkextlib_tkimg_raw.rb
@@ -0,0 +1,40 @@
+$NetBSD: patch-ext_tk_lib_tkextlib_tkimg_raw.rb,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- /dev/null 2014-12-14 12:40:52.000000000 +0000
++++ ext/tk/lib/tkextlib/tkimg/raw.rb
+@@ -0,0 +1,33 @@
++#
++# TkImg - format 'Raw Data'
++# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
++#
++require 'tk'
++
++# call setup script for general 'tkextlib' libraries
++require 'tkextlib/setup.rb'
++
++# call setup script
++require 'tkextlib/tkimg/setup.rb'
++
++# TkPackage.require('img::raw', '1.4')
++TkPackage.require('img::raw')
++
++module Tk
++ module Img
++ module Raw
++ PACKAGE_NAME = 'img::raw'.freeze
++ def self.package_name
++ PACKAGE_NAME
++ end
++
++ def self.package_version
++ begin
++ TkPackage.require('img::raw')
++ rescue
++ ''
++ end
++ end
++ end
++ end
++end
diff --git a/lang/ruby21-base/patches/patch-ext_tk_tcltklib.c b/lang/ruby21-base/patches/patch-ext_tk_tcltklib.c
new file mode 100644
index 00000000000..6a88d15d9cc
--- /dev/null
+++ b/lang/ruby21-base/patches/patch-ext_tk_tcltklib.c
@@ -0,0 +1,170 @@
+$NetBSD: patch-ext_tk_tcltklib.c,v 1.1 2014/12/14 14:00:17 taca Exp $
+
+* Add tcl/tk 8.6 support.
+
+--- ext/tk/tcltklib.c.orig 2014-02-10 11:45:14.000000000 +0000
++++ ext/tk/tcltklib.c
+@@ -6012,7 +6012,12 @@ ip_rbNamespaceObjCmd(clientData, interp,
+ Tcl_CmdInfo info;
+ int ret;
+
++ DUMP1("call ip_rbNamespaceObjCmd");
++ DUMP2("objc = %d", objc);
++ DUMP2("objv[0] = '%s'", Tcl_GetString(objv[0]));
++ DUMP2("objv[1] = '%s'", Tcl_GetString(objv[1]));
+ if (!Tcl_GetCommandInfo(interp, "__orig_namespace_command__", &(info))) {
++ DUMP1("fail to get __orig_namespace_command__");
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp,
+ "invalid command name \"namespace\"", (char*)NULL);
+@@ -6020,15 +6025,38 @@ ip_rbNamespaceObjCmd(clientData, interp,
+ }
+
+ rbtk_eventloop_depth++;
+- /* DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth); */
++ DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth);
+
+ if (info.isNativeObjectProc) {
++#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
++ DUMP1("call a native-object-proc");
+ ret = (*(info.objProc))(info.objClientData, interp, objc, objv);
++#else
++ /* Tcl8.6 or later */
++ int i;
++ Tcl_Obj **cp_objv;
++ char org_ns_cmd_name[] = "__orig_namespace_command__";
++
++ DUMP1("call a native-object-proc for tcl8.6 or later");
++ cp_objv = RbTk_ALLOC_N(Tcl_Obj *, (objc + 1));
++
++ cp_objv[0] = Tcl_NewStringObj(org_ns_cmd_name, strlen(org_ns_cmd_name));
++ for(i = 1; i < objc; i++) {
++ cp_objv[i] = objv[i];
++ }
++ cp_objv[objc] = (Tcl_Obj *)NULL;
++
++ /* ret = Tcl_EvalObjv(interp, objc, cp_objv, TCL_EVAL_DIRECT); */
++ ret = Tcl_EvalObjv(interp, objc, cp_objv, 0);
++
++ ckfree((char*)cp_objv);
++#endif
+ } else {
+ /* string interface */
+ int i;
+ char **argv;
+
++ DUMP1("call with the string-interface");
+ /* argv = (char **)Tcl_Alloc(sizeof(char *) * (objc + 1)); */
+ argv = RbTk_ALLOC_N(char *, (objc + 1));
+ #if 0 /* use Tcl_Preserve/Release */
+@@ -6056,9 +6084,10 @@ ip_rbNamespaceObjCmd(clientData, interp,
+ #endif
+ }
+
+- /* DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth); */
++ DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth);
+ rbtk_eventloop_depth--;
+
++ DUMP1("end of ip_rbNamespaceObjCmd");
+ return ret;
+ }
+ #endif
+@@ -6068,6 +6097,8 @@ ip_wrap_namespace_command(interp)
+ Tcl_Interp *interp;
+ {
+ #if TCL_MAJOR_VERSION >= 8
++
++#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
+ Tcl_CmdInfo orig_info;
+
+ if (!Tcl_GetCommandInfo(interp, "namespace", &(orig_info))) {
+@@ -6084,6 +6115,11 @@ ip_wrap_namespace_command(interp)
+ orig_info.deleteProc);
+ }
+
++#else /* tcl8.6 or later */
++ Tcl_GlobalEval(interp, "rename namespace __orig_namespace_command__");
++
++#endif
++
+ Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *)NULL);
+ #endif
+@@ -8448,15 +8484,28 @@ invoke_tcl_proc(arg)
+ #endif
+ {
+ struct invoke_info *inf = (struct invoke_info *)arg;
++
++#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION < 6
+ int i, len;
+-#if TCL_MAJOR_VERSION >= 8
+ int argc = inf->objc;
+ char **argv = (char **)NULL;
+ #endif
+
++ DUMP1("call invoke_tcl_proc");
++
++#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 6)
++
++ /* eval */
++ inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, TCL_EVAL_DIRECT);
++ /* inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, 0); */
++
++#else /* Tcl/Tk 7.x, 8.0 -- 8.5 */
++
+ /* memory allocation for arguments of this command */
+-#if TCL_MAJOR_VERSION >= 8
++#if TCL_MAJOR_VERSION == 8
++ /* Tcl/Tk 8.0 -- 8.5 */
+ if (!inf->cmdinfo.isNativeObjectProc) {
++ DUMP1("called proc is not a native-obj-proc");
+ /* string interface */
+ /* argv = (char **)ALLOC_N(char *, argc+1);*/ /* XXXXXXXXXX */
+ argv = RbTk_ALLOC_N(char *, (argc+1));
+@@ -8470,11 +8519,14 @@ invoke_tcl_proc(arg)
+ }
+ #endif
+
++ DUMP1("reset result of tcl-interp");
+ Tcl_ResetResult(inf->ptr->ip);
+
+ /* Invoke the C procedure */
+-#if TCL_MAJOR_VERSION >= 8
++#if TCL_MAJOR_VERSION == 8
++ /* Tcl/Tk 8.0 -- 8.5 */
+ if (inf->cmdinfo.isNativeObjectProc) {
++ DUMP1("call tcl_proc as a native-obj-proc");
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData,
+ inf->ptr->ip, inf->objc, inf->objv);
+@@ -8482,7 +8534,9 @@ invoke_tcl_proc(arg)
+ else
+ #endif
+ {
+-#if TCL_MAJOR_VERSION >= 8
++#if TCL_MAJOR_VERSION == 8
++ /* Tcl/Tk 8.0 -- 8.5 */
++ DUMP1("call tcl_proc as not a native-obj-proc");
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip,
+ argc, (CONST84 char **)argv);
+@@ -8505,6 +8559,9 @@ invoke_tcl_proc(arg)
+ #endif
+ }
+
++#endif /* Tcl/Tk 8.6 or later || Tcl 7.x, 8.0 -- 8.5 */
++
++ DUMP1("end of invoke_tcl_proc");
+ return Qnil;
+ }
+
+@@ -8644,7 +8701,9 @@ ip_invoke_core(interp, argc, argv)
+ #endif
+
+ /* invoke tcl-proc */
++ DUMP1("invoke tcl-proc");
+ rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
++ DUMP2("status of tcl-proc, %d", status);
+ switch(status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {