diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-12-25 17:01:02 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-12-25 17:01:02 +0000 |
commit | 67e28e1deea8e3995f303b7476e60c3b76e9d528 (patch) | |
tree | c75d925ba72be88c1c9caf63670673648e1f97fd /dev-ruby | |
parent | Depend on the minitest virtual, add ruby19 to the list of supported implement... (diff) | |
download | gentoo-2-67e28e1deea8e3995f303b7476e60c3b76e9d528.tar.gz gentoo-2-67e28e1deea8e3995f303b7476e60c3b76e9d528.tar.bz2 gentoo-2-67e28e1deea8e3995f303b7476e60c3b76e9d528.zip |
Add support for JRuby (json_pure); make sure to test the new build rather than the old one; avoid building the extensions twice.
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby')
-rw-r--r-- | dev-ruby/json/ChangeLog | 7 | ||||
-rw-r--r-- | dev-ruby/json/json-1.2.0-r1.ebuild | 39 |
2 files changed, 40 insertions, 6 deletions
diff --git a/dev-ruby/json/ChangeLog b/dev-ruby/json/ChangeLog index 59b9e5f78063..add385f39cbd 100644 --- a/dev-ruby/json/ChangeLog +++ b/dev-ruby/json/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-ruby/json # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/json/ChangeLog,v 1.12 2009/12/25 15:43:01 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/json/ChangeLog,v 1.13 2009/12/25 17:01:02 flameeyes Exp $ + + 25 Dec 2009; Diego E. Pettenò <flameeyes@gentoo.org> + json-1.2.0-r1.ebuild: + Add support for JRuby (json_pure); make sure to test the new build rather + than the old one; avoid building the extensions twice. 25 Dec 2009; Diego E. Pettenò <flameeyes@gentoo.org> json-1.2.0-r1.ebuild: diff --git a/dev-ruby/json/json-1.2.0-r1.ebuild b/dev-ruby/json/json-1.2.0-r1.ebuild index 3a8353d5c650..9db72f02ac6f 100644 --- a/dev-ruby/json/json-1.2.0-r1.ebuild +++ b/dev-ruby/json/json-1.2.0-r1.ebuild @@ -1,9 +1,9 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/json/json-1.2.0-r1.ebuild,v 1.4 2009/12/25 15:43:01 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/json/json-1.2.0-r1.ebuild,v 1.5 2009/12/25 17:01:02 flameeyes Exp $ EAPI=2 -USE_RUBY="ruby18 ruby19" +USE_RUBY="ruby18 ruby19 jruby" RUBY_FAKEGEM_EXTRADOC="CHANGES TODO README" RUBY_FAKEGEM_DOCDIR="doc" @@ -22,12 +22,41 @@ IUSE="" RDEPEND="" DEPEND="dev-util/ragel" +ruby_add_bdepend test virtual/ruby-test-unit + +all_ruby_prepare() { + # Avoid building the extension twice! + sed -i \ + -e 's| => :compile_ext||' \ + -e 's| => :clean||' \ + Rakefile || die "rakefile fix failed" +} + each_ruby_compile() { - ${RUBY} -S rake compile_ext || die "extension compile failed" + if [[ $(basename ${RUBY}) != "jruby" ]]; then + ${RUBY} -S rake compile_ext || die "extension compile failed" + fi +} + +each_ruby_test() { + # We have to set RUBYLIB because otherwise the tests will run + # against the sytem-installed json; at the same time, we cannot + # use the -I parameter because rake won't let it pass to the + # testrb call that is executed down the road. + + RUBYLIB="${RUBYLIB}${RUBYLIB+:}lib:ext/json/ext" \ + ${RUBY} -S rake test_pure || die "pure ruby tests failed" + + if [[ $(basename ${RUBY}) != "jruby" ]]; then + RUBYLIB="${RUBYLIB}${RUBYLIB+:}lib:ext/json/ext" \ + ${RUBY} -Ilib:ext/json/ext -S rake test_ext || die " ruby extension tests failed" + fi } each_ruby_install() { each_fakegem_install - ruby_fakegem_newins ext/json/ext/generator.so lib/json/generator.so - ruby_fakegem_newins ext/json/ext/parser.so lib/json/parser.so + if [[ $(basename ${RUBY}) != "jruby" ]]; then + ruby_fakegem_newins ext/json/ext/generator.so lib/json/generator.so + ruby_fakegem_newins ext/json/ext/parser.so lib/json/parser.so + fi } |