summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-14 22:13:35 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-14 22:13:35 +0000
commit726f929997736c0627cb53ac73342ec7ecb25c57 (patch)
tree4ec2f3bd6321d139f11ccd65cc0d7a2a8a615254 /dev-ruby/session
parentarm stable, bug #294958 (diff)
downloadgentoo-2-726f929997736c0627cb53ac73342ec7ecb25c57.tar.gz
gentoo-2-726f929997736c0627cb53ac73342ec7ecb25c57.tar.bz2
gentoo-2-726f929997736c0627cb53ac73342ec7ecb25c57.zip
Add a patch for JRuby compatibility by Charles Nutter (headius), and enable for JRuby target.
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/session')
-rw-r--r--dev-ruby/session/ChangeLog7
-rw-r--r--dev-ruby/session/files/session-2.4.0-jruby.patch61
-rw-r--r--dev-ruby/session/session-2.4.0.ebuild13
3 files changed, 77 insertions, 4 deletions
diff --git a/dev-ruby/session/ChangeLog b/dev-ruby/session/ChangeLog
index 404d4aca7ce5..f818bdb007da 100644
--- a/dev-ruby/session/ChangeLog
+++ b/dev-ruby/session/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-ruby/session
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/session/ChangeLog,v 1.2 2010/01/11 17:58:07 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/session/ChangeLog,v 1.3 2010/01/14 22:13:34 flameeyes Exp $
+
+ 14 Jan 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+ session-2.4.0.ebuild, +files/session-2.4.0-jruby.patch:
+ Add a patch for JRuby compatibility by Charles Nutter (headius), and
+ enable for JRuby target.
11 Jan 2010; Hans de Graaff <graaff@gentoo.org> session-2.4.0.ebuild:
Update license.
diff --git a/dev-ruby/session/files/session-2.4.0-jruby.patch b/dev-ruby/session/files/session-2.4.0-jruby.patch
new file mode 100644
index 000000000000..5827d4e1d08b
--- /dev/null
+++ b/dev-ruby/session/files/session-2.4.0-jruby.patch
@@ -0,0 +1,61 @@
+From 879f701c35699d194890c288a036b0037f6b3424 Mon Sep 17 00:00:00 2001
+From: Charles Oliver Nutter <headius@headius.com>
+Date: Thu, 14 Jan 2010 15:23:57 -0600
+Subject: [PATCH] Modifications to get session tests running green under JRuby.
+
+---
+ lib/session.rb | 16 +++++++++++-----
+ test/session.rb | 3 +++
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/lib/session.rb b/lib/session.rb
+index dffa1f3..824c76f 100755
+--- a/lib/session.rb
++++ b/lib/session.rb
+@@ -86,7 +86,9 @@ module Session
+ class << self
+ def default_prog
+ return @default_prog if defined? @default_prog and @default_prog
+- if defined? self::DEFAULT_PROG
++ # Workaround for http://jira.codehaus.org/browse/JRUBY-4479
++ if (self::DEFAULT_PROG rescue nil)
++# if defined? self::DEFAULT_PROG
+ return @default_prog = self::DEFAULT_PROG
+ else
+ @default_prog = ENV["SESSION_#{ self }_PROG"]
+@@ -150,10 +152,14 @@ module Session
+ @use_spawn = self.class::use_spawn unless self.class::use_spawn.nil?
+ @use_spawn = getopt('use_spawn', opts) if hasopt('use_spawn', opts)
+
+- @use_open3 = nil
+- @use_open3 = Session::use_open3 unless Session::use_open3.nil?
+- @use_open3 = self.class::use_open3 unless self.class::use_open3.nil?
+- @use_open3 = getopt('use_open3', opts) if hasopt('use_open3', opts)
++ if defined? JRUBY_VERSION
++ @use_open3 = true
++ else
++ @use_open3 = nil
++ @use_open3 = Session::use_open3 unless Session::use_open3.nil?
++ @use_open3 = self.class::use_open3 unless self.class::use_open3.nil?
++ @use_open3 = getopt('use_open3', opts) if hasopt('use_open3', opts)
++ end
+
+ @debug = nil
+ @debug = Session::debug unless Session::debug.nil?
+diff --git a/test/session.rb b/test/session.rb
+index 0b0f265..46fe19b 100644
+--- a/test/session.rb
++++ b/test/session.rb
+@@ -17,6 +17,9 @@ Session::debug = true
+ class TimeoutError < StandardError; end
+ def timeout n
+ #{{{
++ # JRuby does not support fork, so we stub out timeout here
++ return yield if defined? JRUBY_VERSION
++
+ ret = nil
+ cid = fork
+ unless cid
+--
+1.6.6
+
diff --git a/dev-ruby/session/session-2.4.0.ebuild b/dev-ruby/session/session-2.4.0.ebuild
index 38ca0aead69a..0429ab1777d2 100644
--- a/dev-ruby/session/session-2.4.0.ebuild
+++ b/dev-ruby/session/session-2.4.0.ebuild
@@ -1,11 +1,10 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/session/session-2.4.0.ebuild,v 1.2 2010/01/11 17:58:07 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/session/session-2.4.0.ebuild,v 1.3 2010/01/14 22:13:34 flameeyes Exp $
EAPI=2
-# jruby → “fork is unsafe and disabled by default on JRuby“
-USE_RUBY="ruby18 ruby19"
+USE_RUBY="ruby18 ruby19 jruby"
RUBY_FAKEGEM_TASK_TEST=""
RUBY_FAKEGEM_TASK_DOC=""
@@ -33,6 +32,14 @@ all_ruby_prepare() {
sed -i -e 's:TimeoutError:SessionTimeoutError:' test/session.rb || die
}
+each_ruby_prepare() {
+ case ${RUBY} in
+ *jruby)
+ epatch "${FILESDIR}"/${P}-jruby.patch
+ ;;
+ esac
+}
+
each_ruby_test() {
${RUBY} -Ilib test/*.rb || die "tests failed"
}