summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-14 19:25:58 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-14 19:25:58 +0000
commitef42eb1858c7b6e4a42849e5421326c552b9fa63 (patch)
tree8cb0f29b6c0326ee29d94a0ba5a60fb5d9e7d460 /dev-ruby/rcov
parentAdd prefix keywords (diff)
downloadgentoo-2-ef42eb1858c7b6e4a42849e5421326c552b9fa63.tar.gz
gentoo-2-ef42eb1858c7b6e4a42849e5421326c552b9fa63.tar.bz2
gentoo-2-ef42eb1858c7b6e4a42849e5421326c552b9fa63.zip
Add a patch to build properly with JRuby (sent upstream), and enable jruby target.
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/rcov')
-rw-r--r--dev-ruby/rcov/ChangeLog9
-rw-r--r--dev-ruby/rcov/files/rcov-0.9.7.1-jruby.patch48
-rw-r--r--dev-ruby/rcov/rcov-0.9.7.1.ebuild12
3 files changed, 61 insertions, 8 deletions
diff --git a/dev-ruby/rcov/ChangeLog b/dev-ruby/rcov/ChangeLog
index 8490736f2918..0a891de541a3 100644
--- a/dev-ruby/rcov/ChangeLog
+++ b/dev-ruby/rcov/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-ruby/rcov
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/rcov/ChangeLog,v 1.11 2009/12/29 19:29:13 flameeyes Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/rcov/ChangeLog,v 1.12 2010/01/14 19:25:57 flameeyes Exp $
+
+ 14 Jan 2010; Diego E. Pettenò <flameeyes@gentoo.org> rcov-0.9.7.1.ebuild,
+ +files/rcov-0.9.7.1-jruby.patch:
+ Add a patch to build properly with JRuby (sent upstream), and enable jruby
+ target.
*rcov-0.9.7.1 (29 Dec 2009)
diff --git a/dev-ruby/rcov/files/rcov-0.9.7.1-jruby.patch b/dev-ruby/rcov/files/rcov-0.9.7.1-jruby.patch
new file mode 100644
index 000000000000..53b98af5f4d3
--- /dev/null
+++ b/dev-ruby/rcov/files/rcov-0.9.7.1-jruby.patch
@@ -0,0 +1,48 @@
+From b2eaa10033e12ebc17542f0c16065519454a6a6b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Thu, 14 Jan 2010 20:15:29 +0100
+Subject: [PATCH] Use hpricot's classpath argument function to set the classpath.
+
+This solves problems of building the rcovrt.jar file with JRuby from Gentoo
+Linux.
+---
+ Rakefile | 16 +++++++++++++++-
+ 1 files changed, 15 insertions(+), 1 deletions(-)
+
+diff --git a/Rakefile b/Rakefile
+index 6cb27f0..7157a1c 100644
+--- a/Rakefile
++++ b/Rakefile
+@@ -41,6 +41,20 @@ end
+
+ desc "Run the unit tests with rcovrt."
+ if RUBY_PLATFORM == 'java'
++ def java_classpath_arg # myriad of ways to discover JRuby classpath
++ begin
++ cpath = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
++ cpath += Java::java.lang.System.getProperty('sun.boot.class.path').split(File::PATH_SEPARATOR)
++ jruby_cpath = cpath.compact.join(File::PATH_SEPARATOR)
++ rescue => e
++ end
++ unless jruby_cpath
++ jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
++ FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
++ end
++ jruby_cpath ? "-cp \"#{jruby_cpath}\"" : ""
++ end
++
+ Rake::TestTask.new(:test_rcovrt => ["lib/rcovrt.jar"]) do |t|
+ t.libs << "lib"
+ t.ruby_opts << "--debug"
+@@ -51,7 +65,7 @@ if RUBY_PLATFORM == 'java'
+ file "lib/rcovrt.jar" => FileList["ext/java/**/*.java"] do |t|
+ rm_f "lib/rcovrt.jar"
+ mkdir_p "pkg/classes"
+- sh "javac -classpath #{Java::JavaLang::System.getProperty('java.class.path')} -d pkg/classes #{t.prerequisites.join(' ')}"
++ sh "javac #{java_classpath_arg} -d pkg/classes #{t.prerequisites.join(' ')}"
+ sh "jar cf #{t.name} -C pkg/classes ."
+ end
+ else
+--
+1.6.6
+
diff --git a/dev-ruby/rcov/rcov-0.9.7.1.ebuild b/dev-ruby/rcov/rcov-0.9.7.1.ebuild
index 4676066399b9..6a9c212b8fc9 100644
--- a/dev-ruby/rcov/rcov-0.9.7.1.ebuild
+++ b/dev-ruby/rcov/rcov-0.9.7.1.ebuild
@@ -1,19 +1,17 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/rcov/rcov-0.9.7.1.ebuild,v 1.1 2009/12/29 19:29:13 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/rcov/rcov-0.9.7.1.ebuild,v 1.2 2010/01/14 19:25:57 flameeyes Exp $
EAPI=2
-# jruby → is supported but there is something strange, maybe we need a
-# newer version of it.
-USE_RUBY="ruby18 ruby19"
+USE_RUBY="ruby18 ruby19 jruby"
RUBY_FAKEGEM_TASK_TEST="test_rcovrt"
RUBY_FAKEGEM_DOCDIR="rdoc"
RUBY_FAKEGEM_EXTRADOC="THANKS BLURB"
-inherit ruby-fakegem versionator
+inherit ruby-fakegem versionator eutils
DESCRIPTION="A ruby code coverage analysis tool"
HOMEPAGE="http://eigenclass.org/hiki.rb?rcov"
@@ -34,6 +32,8 @@ IUSE=""
RESTRICT=test
all_ruby_prepare() {
+ epatch "${FILESDIR}"/${P}-jruby.patch
+
# Without this change, testing will always cause the extension to
# be rebuilt, and we don't want that.
sed -i -e '/:test_rcovrt =>/s| => \[.*\]||' Rakefile || "Rakefile fix failed"