[83478] trunk/dports/lang/ruby186

kimuraw at macports.org kimuraw at macports.org
Fri Sep 2 19:10:56 PDT 2011


Revision: 83478
          http://trac.macports.org/changeset/83478
Author:   kimuraw at macports.org
Date:     2011-09-02 19:10:52 -0700 (Fri, 02 Sep 2011)
Log Message:
-----------
lang/ruby186: upgrade to 1.8.6-p420.
  - refactoring verndor patches. gather into one file and let to work without
    re-autoconf.
  - remove variant thread_hooks. this feature for only rubycocoa(rb-rubycocoa)
    and rubycocoa requires ruby-1.8.7.
  - remove a patch ignore-gsetcontext.diff. 1.8.6-p420 allows to disable
    get/setcontext() via configure option.

Modified Paths:
--------------
    trunk/dports/lang/ruby186/Portfile

Added Paths:
-----------
    trunk/dports/lang/ruby186/files/patch-ruby_bug3674.diff
    trunk/dports/lang/ruby186/files/patch-vendordir.diff

Removed Paths:
-------------
    trunk/dports/lang/ruby186/files/ignore-gsetcontext.diff
    trunk/dports/lang/ruby186/files/patch-Makefile.in
    trunk/dports/lang/ruby186/files/patch-configure.in
    trunk/dports/lang/ruby186/files/patch-instruby.rb
    trunk/dports/lang/ruby186/files/patch-mkconfig.rb
    trunk/dports/lang/ruby186/files/patch-mkmf.rb
    trunk/dports/lang/ruby186/files/patch-ruby.c
    trunk/dports/lang/ruby186/files/patch-thread-hooks

Modified: trunk/dports/lang/ruby186/Portfile
===================================================================
--- trunk/dports/lang/ruby186/Portfile	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/Portfile	2011-09-03 02:10:52 UTC (rev 83478)
@@ -3,8 +3,8 @@
 PortSystem 1.0
 
 name			ruby186
-version			1.8.6-p399
-revision        1
+version			1.8.6-p420
+revision        0
 
 categories		lang ruby
 maintainers		kimuraw openmaintainer
@@ -24,9 +24,9 @@
 
 dist_subdir		ruby
 distname		ruby-${version}
-checksums		md5     f77c307cb72fb8808b0e85af5d05cefc \
-				sha1    4a7b5ec1ccbeb8c6c0c49c844471a5ee14cdaa98 \
-				rmd160  1c0bb41966c9f6011fa40b9de58ef95cb6610710
+checksums		md5     1c7a978e9ffd4f56dc2ad74bbd2c34f3 \
+				sha1    00e977ac46df0ccd1545657426439a82f44bf284 \
+				rmd160  2f76f19e0a3a35d92200769052d4a049c1478c42
 
 platforms		darwin
 
@@ -34,44 +34,53 @@
 				port:readline \
 				port:openssl \
 				port:zlib \
-				port:ncurses
+				port:ncurses \
+				port:gdbm
 
-patchfiles		patch-Makefile.in \
-				patch-configure.in \
-				patch-instruby.rb \
-				patch-mkconfig.rb \
-				patch-mkmf.rb \
-				patch-ruby.c
+# enable vendordir
+patchfiles		patch-vendordir.diff
 
 # bug15528: TCPServer.open('localhost', 0) fails on some Mac
 # [ruby-core:21033]: The DRb code in drb.rb does not correctly deal with
 #                    multiple network families if they're present.
 # #25647: build failure with openssl 1.0.0
 #         patch from http://redmine.ruby-lang.org/issues/show/2022
+# ruby_bug3674: http://redmine.ruby-lang.org/issues/show/3674
+### [ruby-core:25606]: Virtual Timer Expired when forking
 patchfiles-append \
 				patch-bug15528.diff \
 				patch-ruby_core21033.diff \
-				patch-bug25647.diff
+				patch-bug25647.diff \
+				patch-ruby_bug3674.diff
 
 # dot-darwin.diff: avoid "darwin" matches /win/ in lib/rdoc/options.rb
 # etc-irbrc.diff: require /etc/irbrc when the platform is not Windows
-# ignore-gsetcontext.diff: do not use getcontext()/setcontext()
 # md5_sha1_commoncrypto.diff: use CommonCrypto when available
 # use-setreugid.diff: use setreuid()/setregid() on 10.5 or later
 # words-bigendian-from-arch.diff: [ruby-core:12895], [ruby-dev:32160]
 patchfiles-append      	dot-darwin.diff \
 						etc-irbrc.diff \
-						ignore-gsetcontext.diff \
 						md5_sha1_commoncrypto.diff \
 						use-setreugid.diff \
 						words-bigendian-from-arch.diff
 
-use_autoconf	yes
+# #30275: ruby built with clang or llvm-gcc does not work
+# see list "MacPorts on Lion (common issues, fixes, and workarounds)"
+# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
+if {${configure.compiler} == "clang" ||
+    ${configure.compiler} == "llvm-gcc-4.2"} {
+    configure.compiler gcc-4.2
+    if {![file executable ${configure.cc}]} {
+        depends_build-append port:apple-gcc42
+        configure.compiler apple-gcc-4.2
+    }
+}
 
 configure.args	--enable-shared \
 				--mandir="${prefix}/share/man" \
 				--enable-pthread \
-				--without-tk
+				--without-tk \
+				--disable-ucontext
 
 if {![variant_isset universal] && [info exists build_arch] && $build_arch != ""} {
 	configure.env-append ARCH_FLAG="-arch ${build_arch}"
@@ -117,12 +126,6 @@
 	configure.args-append   --enable-tcltk-framework
 }
 
-variant thread_hooks description {Enable thread hooks} {
-	patchfiles-append		patch-thread-hooks
-}
-
-default_variants	+thread_hooks
-
 livecheck.type	regex
 livecheck.url	http://www.ruby-lang.org/en/downloads/
 livecheck.regex	{>Ruby (.*?)</a> \\\(md5:}

Deleted: trunk/dports/lang/ruby186/files/ignore-gsetcontext.diff
===================================================================
--- trunk/dports/lang/ruby186/files/ignore-gsetcontext.diff	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/ignore-gsetcontext.diff	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,23 +0,0 @@
---- node.h.orig	2007-10-23 17:09:10.000000000 +0200
-+++ node.h	2007-10-23 17:08:19.000000000 +0200
-@@ -374,9 +374,17 @@
- void rb_add_event_hook _((rb_event_hook_func_t,rb_event_t));
- int rb_remove_event_hook _((rb_event_hook_func_t));
- 
--#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
--#include <ucontext.h>
--#define USE_CONTEXT
-+#if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT) 
-+# if defined(__APPLE__)
-+#   include <AvailabilityMacros.h>
-+#   if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
-+#     include <ucontext.h>
-+#     define USE_CONTEXT
-+#   endif
-+# else
-+#   include <ucontext.h>
-+#   define USE_CONTEXT
-+# endif
- #endif
- #include <setjmp.h>
- #include "st.h"

Deleted: trunk/dports/lang/ruby186/files/patch-Makefile.in
===================================================================
--- trunk/dports/lang/ruby186/files/patch-Makefile.in	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-Makefile.in	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,25 +0,0 @@
---- Makefile.in.orig	2007-02-13 08:01:19.000000000 +0900
-+++ Makefile.in	2007-03-15 14:19:03.000000000 +0900
-@@ -24,6 +24,8 @@
- arch = @arch@
- sitearch = @sitearch@
- sitedir = @sitedir@
-+vendorarch = @vendorarch@
-+vendordir = @vendordir@
- 
- TESTUI = console
- TESTS =
-@@ -98,11 +100,11 @@
- 
- miniruby$(EXEEXT):
- 		@$(RM) $@
--		$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
-+		$(PURIFY) $(CC) $(XLDFLAGS) $(LDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
- 
- $(PROGRAM):
- 		@$(RM) $@
--		$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
-+		$(PURIFY) $(CC) $(XLDFLAGS) $(LDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
- 
- # We must `rm' the library each time this rule is invoked because "updating" a
- # MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not

Deleted: trunk/dports/lang/ruby186/files/patch-configure.in
===================================================================
--- trunk/dports/lang/ruby186/files/patch-configure.in	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-configure.in	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,58 +0,0 @@
---- configure.in.orig	2006-08-07 19:37:43.000000000 -0700
-+++ configure.in	2006-09-20 16:57:30.000000000 -0700
-@@ -1575,9 +1575,28 @@
- AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
- AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
- 
-+AC_ARG_WITH(vendordir,
-+	    [  --with-vendordir=DIR      vendor libraries in DIR [PREFIX/lib/ruby/vendor_ruby]],
-+            [vendordir=$withval],
-+            [vendordir='${prefix}/lib/ruby/vendor_ruby'])
-+VENDOR_DIR="`eval \"echo ${vendordir}\"`"
-+case "$target_os" in
-+  cygwin*|mingw*|*djgpp*|os2_emx*)
-+    RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
-+    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
-+  *)
-+    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
-+esac
-+RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
-+
-+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
-+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
-+
- AC_SUBST(arch)dnl
- AC_SUBST(sitearch)dnl
-+AC_SUBST(vendorarch)dnl
- AC_SUBST(sitedir)dnl
-+AC_SUBST(vendordir)dnl
- 
- configure_args=$ac_configure_args
- AC_SUBST(configure_args)dnl
-@@ -1590,6 +1609,8 @@
- 
-     AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
-                  "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
-+    AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
-+                 "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
-     AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
- else
-     arch="${target_cpu}-${target_os}"
-@@ -1597,12 +1618,15 @@
- fi
- 
- case "$target_os" in
--  mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
--  *) sitearch="${arch}" ;;
-+  mingw*) sitearch="i386-$rb_cv_msvcrt"
-+  		  vendorarch="i386-$rb_cv_msvcrt" ;;
-+  *) sitearch="${arch}"
-+     vendorarch="${arch}" ;;
- esac
- 
- AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
- AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
-+AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${vendorarch}")
- 
- AC_ARG_WITH(search-path,
- 		[  --with-search-path=DIR specify the additional search path],

Deleted: trunk/dports/lang/ruby186/files/patch-instruby.rb
===================================================================
--- trunk/dports/lang/ruby186/files/patch-instruby.rb	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-instruby.rb	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,29 +0,0 @@
---- instruby.rb.orig	2007-03-15 13:25:14.000000000 +0900
-+++ instruby.rb	2007-03-15 13:31:29.000000000 +0900
-@@ -162,6 +162,8 @@
- archlibdir = CONFIG["archdir"]
- sitelibdir = CONFIG["sitelibdir"]
- sitearchlibdir = CONFIG["sitearchdir"]
-+vendorlibdir = CONFIG["vendorlibdir"]
-+vendorarchlibdir = CONFIG["vendorarchdir"]
- mandir = File.join(CONFIG["mandir"], "man")
- configure_args = Shellwords.shellwords(CONFIG["configure_args"])
- enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
-@@ -202,7 +204,7 @@
-   extout = "#$extout"
-   install?(:ext, :arch, :'ext-arch') do
-     puts "installing extension objects"
--    makedirs [archlibdir, sitearchlibdir]
-+    makedirs [archlibdir, sitearchlibdir, vendorarchlibdir]
-     if noinst = CONFIG["no_install_files"] and noinst.empty?
-       noinst = nil
-     end
-@@ -210,7 +212,7 @@
-   end
-   install?(:ext, :comm, :'ext-comm') do
-     puts "installing extension scripts"
--    makedirs [rubylibdir, sitelibdir]
-+    makedirs [rubylibdir, sitelibdir, vendorlibdir]
-     install_recursive("#{extout}/common", rubylibdir)
-   end
- end

Deleted: trunk/dports/lang/ruby186/files/patch-mkconfig.rb
===================================================================
--- trunk/dports/lang/ruby186/files/patch-mkconfig.rb	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-mkconfig.rb	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,17 +0,0 @@
---- mkconfig.rb.orig	2005-11-10 15:22:03.000000000 -0800
-+++ mkconfig.rb	2006-01-08 08:36:13.000000000 -0800
-@@ -143,6 +143,14 @@
-   CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
-   CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
-   CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
-+  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
-+  CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(vendorarch)"
-+  if defined?(VENDOR_SPECIFIC) && VENDOR_SPECIFIC
-+ 	CONFIG["sitearch"] = CONFIG["vendorarch"]
-+ 	CONFIG["sitedir"] = CONFIG["vendordir"]
-+ 	CONFIG["sitelibdir"] = CONFIG["vendorlibdir"]
-+ 	CONFIG["sitearchdir"] = CONFIG["vendorarchdir"]
-+  end
-   CONFIG["topdir"] = File.dirname(__FILE__)
-   MAKEFILE_CONFIG = {}
-   CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}

Deleted: trunk/dports/lang/ruby186/files/patch-mkmf.rb
===================================================================
--- trunk/dports/lang/ruby186/files/patch-mkmf.rb	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-mkmf.rb	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,41 +0,0 @@
---- lib/mkmf.rb.orig	2007-02-28 22:23:42.000000000 +0900
-+++ lib/mkmf.rb	2007-03-15 13:39:26.000000000 +0900
-@@ -51,6 +51,9 @@
- $sitedir = CONFIG["sitedir"]
- $sitelibdir = CONFIG["sitelibdir"]
- $sitearchdir = CONFIG["sitearchdir"]
-+$vendordir = CONFIG["vendordir"]
-+$vendorlibdir = CONFIG["vendorlibdir"]
-+$vendorarchdir = CONFIG["vendorarchdir"]
- 
- $mswin = /mswin/ =~ RUBY_PLATFORM
- $bccwin = /bccwin/ =~ RUBY_PLATFORM
-@@ -417,7 +420,7 @@
- 
- def try_func(func, libs, headers = nil, &b)
-   headers = cpp_include(headers)
--  try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b)
-+  try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b)
- #{COMMON_HEADERS}
- #{headers}
- /*top*/
-@@ -429,6 +435,11 @@
- int main() { return 0; }
- int t() { #{func}(); return 0; }
- SRC
-+int #{func}();
-+/*top*/
-+int main() { return 0; }
-+int t() { #{func}(); return 0; }
-+SRC
- end
- 
- def try_var(var, headers = nil, &b)
-@@ -1097,6 +1105,7 @@
- RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
- arch = #{CONFIG['arch']}
- sitearch = #{CONFIG['sitearch']}
-+vendorarch = #{CONFIG['vendorarch']}
- ruby_version = #{Config::CONFIG['ruby_version']}
- ruby = #{$ruby}
- RUBY = $(ruby#{sep})

Deleted: trunk/dports/lang/ruby186/files/patch-ruby.c
===================================================================
--- trunk/dports/lang/ruby186/files/patch-ruby.c	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-ruby.c	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,16 +0,0 @@
---- ruby.c.orig	2006-08-15 19:11:21.000000000 -0700
-+++ ruby.c	2006-09-20 17:32:18.000000000 -0700
-@@ -322,6 +32,13 @@
-     incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
-     incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
- 
-+    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
-+#ifdef RUBY_VENDOR_THIN_ARCHLIB
-+    incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
-+#endif
-+    incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
-+    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
-+    
-     incpush(RUBY_RELATIVE(RUBY_LIB));
- #ifdef RUBY_THIN_ARCHLIB
-     incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));

Added: trunk/dports/lang/ruby186/files/patch-ruby_bug3674.diff
===================================================================
--- trunk/dports/lang/ruby186/files/patch-ruby_bug3674.diff	                        (rev 0)
+++ trunk/dports/lang/ruby186/files/patch-ruby_bug3674.diff	2011-09-03 02:10:52 UTC (rev 83478)
@@ -0,0 +1,18 @@
+--- lib/drb/drb.rb.orig	2009-02-16 22:22:09.000000000 +0900
++++ lib/drb/drb.rb	2010-12-31 17:41:41.000000000 +0900
+@@ -1416,8 +1416,14 @@
+ 	grp.add(Thread.current)
+ 	list = @grp.list
+ 	while list.size > 0
++          list = list.map do |th|
++            th.kill if th.alive?
++          end.compact
+ 	  list.each do |th|
+-	    th.kill if th.alive?
++            begin
++              th.join
++            rescue Exception
++            end
+ 	  end
+ 	  list = @grp.list
+ 	end

Deleted: trunk/dports/lang/ruby186/files/patch-thread-hooks
===================================================================
--- trunk/dports/lang/ruby186/files/patch-thread-hooks	2011-09-02 20:30:15 UTC (rev 83477)
+++ trunk/dports/lang/ruby186/files/patch-thread-hooks	2011-09-03 02:10:52 UTC (rev 83478)
@@ -1,132 +0,0 @@
-diff -ur ../ruby-1.8.6-p368.org/eval.c ./eval.c
---- ../ruby-1.8.6-p368.org/eval.c	2009-03-23 18:26:03.000000000 +0900
-+++ ./eval.c	2009-06-11 23:08:09.000000000 +0900
-@@ -220,6 +220,25 @@
- 
- #include <sys/stat.h>
- 
-+
-+typedef struct threadswitch_hook {
-+    rb_threadswitch_hook_func_t func;
-+    struct threadswitch_hook *next;
-+} rb_threadswitch_hook_t;
-+
-+static rb_threadswitch_hook_t *threadswitch_hooks;
-+
-+#define EXEC_THREADSWITCH_HOOK(event, thread) \
-+    do { \
-+	rb_threadswitch_hook_t *hook = threadswitch_hooks; \
-+	\
-+	while (hook) { \
-+	    (*hook->func)(event, thread); \
-+            hook = hook->next; \
-+	} \
-+    } while (0)
-+
-+
- VALUE rb_cProc;
- VALUE rb_cBinding;
- static VALUE proc_invoke _((VALUE,VALUE,VALUE,VALUE));
-@@ -10232,6 +10251,8 @@
- stack_free(th)
-     rb_thread_t th;
- {
-+    EXEC_THREADSWITCH_HOOK(RUBY_THREADSWITCH_FREE,th->thread);
-+
-     if (th->stk_ptr) free(th->stk_ptr);
-     th->stk_ptr = 0;
- #ifdef __ia64
-@@ -10291,6 +10312,8 @@
-     VALUE *pos;
-     size_t len;
-     static VALUE tval;
-+    
-+    EXEC_THREADSWITCH_HOOK(RUBY_THREADSWITCH_SAVE,th->thread);
- 
-     len = ruby_stack_length(&pos);
-     th->stk_len = 0;
-@@ -10485,6 +10508,8 @@
- #define STACK_PAD_SIZE 1024
-     volatile VALUE space[STACK_PAD_SIZE], *sp = space;
- 
-+    EXEC_THREADSWITCH_HOOK(RUBY_THREADSWITCH_RESTORE,th->thread);
-+
- #if !STACK_GROW_DIRECTION
-     if (space < rb_gc_stack_start) {
-         /* Stack grows downward */
-@@ -10614,6 +10639,41 @@
-     rb_thread_main_jump(e, RESTORE_RAISE);
- }
- 
-+void *
-+rb_add_threadswitch_hook(func)
-+    rb_threadswitch_hook_func_t func;
-+{
-+    rb_threadswitch_hook_t *hook;
-+    rb_thread_t th;
-+
-+    hook = ALLOC(rb_threadswitch_hook_t);
-+    hook->func = func;
-+    hook->next = threadswitch_hooks;
-+    threadswitch_hooks = hook;
-+
-+    FOREACH_THREAD(th) {
-+    	(*func)(RUBY_THREADSWITCH_INIT, th->thread);
-+    } END_FOREACH(th);
-+
-+    return hook;
-+}
-+
-+void
-+rb_remove_threadswitch_hook(handle)
-+    void *handle;
-+{
-+    rb_threadswitch_hook_t **hook_p, *hook;
-+	
-+    for (hook_p = &threadswitch_hooks; *hook_p; hook_p = &hook->next) {
-+	hook = *hook_p;
-+	if (hook == (rb_threadswitch_hook_t*)handle) {
-+	    *hook_p = hook->next;
-+	    xfree(hook);
-+	    return;
-+	}
-+    }
-+}
-+
- static void
- copy_fds(dst, src, max)
-     fd_set *dst, *src;
-@@ -11869,6 +11929,8 @@
-     THREAD_ALLOC(th);
-     th->thread = Data_Wrap_Struct(klass, thread_mark, thread_free, th);
- 
-+    EXEC_THREADSWITCH_HOOK(RUBY_THREADSWITCH_INIT,th->thread);
-+
-     for (vars = th->dyna_vars; vars; vars = vars->next) {
- 	if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
- 	FL_SET(vars, DVAR_DONT_RECYCLE);
-Only in .: eval.c.orig
-diff -ur ../ruby-1.8.6-p368.org/ruby.h ./ruby.h
---- ../ruby-1.8.6-p368.org/ruby.h	2008-07-10 13:52:35.000000000 +0900
-+++ ./ruby.h	2009-06-11 23:08:09.000000000 +0900
-@@ -749,6 +749,19 @@
- void ruby_native_thread_kill _((int));
- #endif
- 
-+
-+typedef unsigned int rb_threadswitch_event_t;
-+
-+#define RUBY_THREADSWITCH_INIT 0x01
-+#define RUBY_THREADSWITCH_FREE 0x02
-+#define RUBY_THREADSWITCH_SAVE 0x04
-+#define RUBY_THREADSWITCH_RESTORE 0x08
-+
-+typedef void (*rb_threadswitch_hook_func_t) _((rb_threadswitch_event_t,VALUE));
-+
-+void *rb_add_threadswitch_hook _((rb_threadswitch_hook_func_t func));
-+void rb_remove_threadswitch_hook _((void *handle));
-+
- #if defined(__cplusplus)
- #if 0
- { /* satisfy cc-mode */
-Only in .: ruby.h.orig

Added: trunk/dports/lang/ruby186/files/patch-vendordir.diff
===================================================================
--- trunk/dports/lang/ruby186/files/patch-vendordir.diff	                        (rev 0)
+++ trunk/dports/lang/ruby186/files/patch-vendordir.diff	2011-09-03 02:10:52 UTC (rev 83478)
@@ -0,0 +1,233 @@
+diff -ur ../ruby-1.8.6-p420.org/Makefile.in ./Makefile.in
+--- ../ruby-1.8.6-p420.org/Makefile.in	2008-06-04 16:41:47.000000000 +0900
++++ ./Makefile.in	2011-08-25 00:19:40.000000000 +0900
+@@ -24,6 +24,8 @@
+ arch = @arch@
+ sitearch = @sitearch@
+ sitedir = @sitedir@
++vendorarch = @vendorarch@
++vendordir = @vendordir@
+ 
+ TESTUI = console
+ TESTS =
+@@ -98,11 +100,11 @@
+ 
+ miniruby$(EXEEXT):
+ 		@$(RM) $@
+-		$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
++		$(PURIFY) $(CC) $(XLDFLAGS) $(LDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
+ 
+ $(PROGRAM):
+ 		@$(RM) $@
+-		$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
++		$(PURIFY) $(CC) $(XLDFLAGS) $(LDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
+ 
+ # We must `rm' the library each time this rule is invoked because "updating" a
+ # MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
+diff -ur ../ruby-1.8.6-p420.org/configure ./configure
+--- ../ruby-1.8.6-p420.org/configure	2010-09-22 02:26:51.000000000 +0900
++++ ./configure	2011-08-25 00:20:24.000000000 +0900
+@@ -591,7 +591,9 @@
+ MANTYPE
+ NROFF
+ configure_args
++vendordir
+ sitedir
++vendorarch
+ sitearch
+ arch
+ MAKEFILES
+@@ -747,6 +749,7 @@
+ enable_shared
+ enable_install_doc
+ with_sitedir
++with_vendordir
+ with_search_path
+ with_mantype
+ '
+@@ -1409,6 +1412,7 @@
+   --with-dln-a-out        use dln_a_out if possible
+   --with-static-linked-ext link external modules statically
+   --with-sitedir=DIR      site libraries in DIR PREFIX/lib/ruby/site_ruby
++  --with-vendordir=DIR      vendor libraries in DIR PREFIX/lib/ruby/vendor_ruby
+   --with-search-path=DIR specify the additional search path
+   --with-mantype=TYPE specify man page type; TYPE is one of man and doc
+ 
+@@ -9909,6 +9913,33 @@
+ 
+ 
+ 
++# Check whether --with-vendordir was given.
++if test "${with_vendordir+set}" = set; then :
++  withval=$with_vendordir; vendordir=$withval
++else
++  vendordir='${prefix}/lib/ruby/vendor_ruby'
++fi
++
++VENDOR_DIR="`eval \"echo ${vendordir}\"`"
++case "$target_os" in
++  cygwin*|mingw*|*djgpp*|os2_emx*)
++    RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
++    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
++  *)
++    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
++esac
++RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
++
++cat >>confdefs.h <<_ACEOF
++#define RUBY_VENDOR_LIB "${RUBY_VENDOR_LIB_PATH}"
++_ACEOF
++
++cat >>confdefs.h <<_ACEOF
++#define RUBY_VENDOR_LIB2 "${RUBY_VENDOR_LIB_PATH2}"
++_ACEOF
++
++
++
+ configure_args=$ac_configure_args
+ 
+ if test "$fat_binary" != no ; then
+@@ -9924,6 +9955,10 @@
+ _ACEOF
+ 
+     cat >>confdefs.h <<_ACEOF
++#define RUBY_VENDOR_THIN_ARCHLIB "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}"
++_ACEOF
++
++    cat >>confdefs.h <<_ACEOF
+ #define RUBY_PLATFORM __ARCHITECTURE__ "-${target_os}"
+ _ACEOF
+ 
+@@ -9936,8 +9971,10 @@
+ fi
+ 
+ case "$target_os" in
+-  mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
+-  *) sitearch="${arch}" ;;
++  mingw*) sitearch="i386-$rb_cv_msvcrt"
++  		  vendorarch="i386-$rb_cv_msvcrt" ;;
++  *) sitearch="${arch}"
++     vendorarch="${arch}" ;;
+ esac
+ 
+ cat >>confdefs.h <<_ACEOF
+@@ -9948,6 +9985,10 @@
+ #define RUBY_SITE_ARCHLIB "${RUBY_SITE_LIB_PATH2}/${sitearch}"
+ _ACEOF
+ 
++cat >>confdefs.h <<_ACEOF
++#define RUBY_VENDOR_ARCHLIB "${RUBY_VENDOR_LIB_PATH2}/${vendorarch}"
++_ACEOF
++
+ 
+ 
+ # Check whether --with-search-path was given.
+Only in .: configure.orig
+diff -ur ../ruby-1.8.6-p420.org/instruby.rb ./instruby.rb
+--- ../ruby-1.8.6-p420.org/instruby.rb	2007-02-13 08:01:19.000000000 +0900
++++ ./instruby.rb	2011-08-25 00:19:48.000000000 +0900
+@@ -162,6 +162,8 @@
+ archlibdir = CONFIG["archdir"]
+ sitelibdir = CONFIG["sitelibdir"]
+ sitearchlibdir = CONFIG["sitearchdir"]
++vendorlibdir = CONFIG["vendorlibdir"]
++vendorarchlibdir = CONFIG["vendorarchdir"]
+ mandir = File.join(CONFIG["mandir"], "man")
+ configure_args = Shellwords.shellwords(CONFIG["configure_args"])
+ enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
+@@ -202,7 +204,7 @@
+   extout = "#$extout"
+   install?(:ext, :arch, :'ext-arch') do
+     puts "installing extension objects"
+-    makedirs [archlibdir, sitearchlibdir]
++    makedirs [archlibdir, sitearchlibdir, vendorarchlibdir]
+     if noinst = CONFIG["no_install_files"] and noinst.empty?
+       noinst = nil
+     end
+@@ -210,7 +212,7 @@
+   end
+   install?(:ext, :comm, :'ext-comm') do
+     puts "installing extension scripts"
+-    makedirs [rubylibdir, sitelibdir]
++    makedirs [rubylibdir, sitelibdir, vendorlibdir]
+     install_recursive("#{extout}/common", rubylibdir)
+   end
+ end
+diff -ur ../ruby-1.8.6-p420.org/lib/mkmf.rb ./lib/mkmf.rb
+--- ../ruby-1.8.6-p420.org/lib/mkmf.rb	2009-03-31 18:19:39.000000000 +0900
++++ ./lib/mkmf.rb	2011-08-25 00:20:02.000000000 +0900
+@@ -51,6 +51,9 @@
+ $sitedir = CONFIG["sitedir"]
+ $sitelibdir = CONFIG["sitelibdir"]
+ $sitearchdir = CONFIG["sitearchdir"]
++$vendordir = CONFIG["vendordir"]
++$vendorlibdir = CONFIG["vendorlibdir"]
++$vendorarchdir = CONFIG["vendorarchdir"]
+ 
+ $mswin = /mswin/ =~ RUBY_PLATFORM
+ $bccwin = /bccwin/ =~ RUBY_PLATFORM
+@@ -417,7 +420,7 @@
+ 
+ def try_func(func, libs, headers = nil, &b)
+   headers = cpp_include(headers)
+-  try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b)
++  try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b)
+ #{COMMON_HEADERS}
+ #{headers}
+ /*top*/
+@@ -429,6 +432,11 @@
+ int main() { return 0; }
+ int t() { #{func}(); return 0; }
+ SRC
++int #{func}();
++/*top*/
++int main() { return 0; }
++int t() { #{func}(); return 0; }
++SRC
+ end
+ 
+ def try_var(var, headers = nil, &b)
+@@ -1121,6 +1129,7 @@
+ RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
+ arch = #{CONFIG['arch']}
+ sitearch = #{CONFIG['sitearch']}
++vendorarch = #{CONFIG['vendorarch']}
+ ruby_version = #{Config::CONFIG['ruby_version']}
+ ruby = #{$ruby}
+ RUBY = $(ruby#{sep})
+Only in ./lib: mkmf.rb.orig
+diff -ur ../ruby-1.8.6-p420.org/mkconfig.rb ./mkconfig.rb
+--- ../ruby-1.8.6-p420.org/mkconfig.rb	2008-06-08 01:37:10.000000000 +0900
++++ ./mkconfig.rb	2011-08-25 00:19:55.000000000 +0900
+@@ -143,6 +143,14 @@
+   CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+   CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
+   CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
++  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
++  CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(vendorarch)"
++  if defined?(VENDOR_SPECIFIC) && VENDOR_SPECIFIC
++ 	CONFIG["sitearch"] = CONFIG["vendorarch"]
++ 	CONFIG["sitedir"] = CONFIG["vendordir"]
++ 	CONFIG["sitelibdir"] = CONFIG["vendorlibdir"]
++ 	CONFIG["sitearchdir"] = CONFIG["vendorarchdir"]
++  end
+   CONFIG["topdir"] = File.dirname(__FILE__)
+   MAKEFILE_CONFIG = {}
+   CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
+diff -ur ../ruby-1.8.6-p420.org/ruby.c ./ruby.c
+--- ../ruby-1.8.6-p420.org/ruby.c	2008-07-10 18:36:08.000000000 +0900
++++ ./ruby.c	2011-08-25 00:20:12.000000000 +0900
+@@ -322,6 +322,13 @@
+     incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
+     incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
+ 
++    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
++#ifdef RUBY_VENDOR_THIN_ARCHLIB
++    incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
++#endif
++    incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
++    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
++    
+     incpush(RUBY_RELATIVE(RUBY_LIB));
+ #ifdef RUBY_THIN_ARCHLIB
+     incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110902/dbab1742/attachment-0001.html>


More information about the macports-changes mailing list