Gentoo Archives: gentoo-commits

From: Alex Legler <a3li@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/ruby-overlay:master commit in: dev-java/jruby/
Date: Tue, 28 Feb 2012 00:35:17
Message-Id: 1330387730.1656e19a67b8f74c8dfce4de74c9eabc28a21156.a3li@gentoo
1 commit: 1656e19a67b8f74c8dfce4de74c9eabc28a21156
2 Author: Diego Elio Pettenò <flameeyes <AT> flameeyes <DOT> eu>
3 AuthorDate: Tue Feb 28 00:08:50 2012 +0000
4 Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 00:08:50 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ruby-overlay.git;a=commit;h=1656e19a
7
8 Bump jruby version to 1.6.7.
9
10 (Portage version: 2.2.0_alpha89/git/Linux x86_64, signed Manifest commit with key 2200D978)
11
12 ---
13 dev-java/jruby/ChangeLog | 5 +
14 dev-java/jruby/jruby-1.6.7.ebuild | 199 +++++++++++++++++++++++++++++++++++++
15 2 files changed, 204 insertions(+), 0 deletions(-)
16
17 diff --git a/dev-java/jruby/ChangeLog b/dev-java/jruby/ChangeLog
18 index ea8346a..de24a3e 100644
19 --- a/dev-java/jruby/ChangeLog
20 +++ b/dev-java/jruby/ChangeLog
21 @@ -2,6 +2,11 @@
22 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
23 # $Header: $
24
25 +*jruby-1.6.7 (28 Feb 2012)
26 +
27 + 28 Feb 2012; Diego E. Pettenò <flameeyes@g.o> +jruby-1.6.7.ebuild:
28 + Bump jruby version to 1.6.7.
29 +
30 23 Jan 2012; Hans de Graaff <graaff@g.o> jruby-1.6.5.1.ebuild,
31 files/jruby-bash-launcher.patch:
32 The properties file is no longer used. Add the bindir option to the wrapper
33
34 diff --git a/dev-java/jruby/jruby-1.6.7.ebuild b/dev-java/jruby/jruby-1.6.7.ebuild
35 new file mode 100644
36 index 0000000..3f85fad
37 --- /dev/null
38 +++ b/dev-java/jruby/jruby-1.6.7.ebuild
39 @@ -0,0 +1,199 @@
40 +# Copyright 1999-2012 Gentoo Foundation
41 +# Distributed under the terms of the GNU General Public License v2
42 +# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.5.6.ebuild,v 1.2 2011/06/14 18:59:32 maekke Exp $
43 +
44 +EAPI="4"
45 +JAVA_PKG_IUSE="doc source test"
46 +inherit eutils java-pkg-2 java-ant-2
47 +
48 +MY_PV="${PV/_rc1/RC1}"
49 +
50 +DESCRIPTION="Java-based Ruby interpreter implementation"
51 +HOMEPAGE="http://jruby.codehaus.org/"
52 +SRC_URI="http://jruby.org.s3.amazonaws.com/downloads/${PV}/${PN}-src-${PV}.tar.gz"
53 +LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~x86"
56 +IUSE="bsf ssl"
57 +
58 +# jffi still needed? Or do we call that jnr-ffi?
59 +# jnr-ffi depends on jffi which depends on libffi
60 +CDEPEND=">=dev-java/bytelist-1.0.8:0
61 + >=dev-java/jline-0.9.94:0
62 + >=dev-java/joni-1.1.3:0
63 + >=dev-java/jnr-netdb-1.0:0
64 + >=dev-java/jvyamlb-0.2.5:0
65 + >=dev-java/asm-3.2:3
66 + >=dev-java/jcodings-1.0.5:0
67 + dev-java/jffi:1.0
68 + dev-java/jnr-constants:0
69 + dev-java/jnr-ffi:0.5
70 + dev-java/jnr-posix:1.1
71 + dev-java/joda-time:0
72 + dev-util/jay:0[java]
73 + dev-java/nailgun:0
74 + dev-java/jgrapht:0
75 + dev-java/ant-core:0
76 + dev-java/bsf:2.3
77 + dev-java/osgi-core-api:0
78 + >=dev-java/snakeyaml-1.9:0
79 + dev-java/jzlib:1"
80 +
81 +RDEPEND="${CDEPEND}
82 + >=virtual/jre-1.6"
83 +
84 +# Is jna-posix still needed? Or has that been renamed to jnr-posix?
85 +# jna-posix is the original project name which was abononed years ago.
86 +# jnr-posix < 1.1.8 are from the original fork
87 +# later jnr-posix are from the jnr umbrella project.
88 +DEPEND="${CDEPEND}
89 + >=virtual/jdk-1.6
90 + test? (
91 + dev-java/ant-junit4:0
92 + dev-java/ant-trax:0
93 + dev-java/junit:4
94 + java-virtuals/jdk-with-com-sun
95 + dev-java/commons-logging:0
96 + dev-java/xalan:0
97 + )
98 + !!<dev-ruby/jruby-1.3.1-r1"
99 +
100 +PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
101 +
102 +# Tests fail.
103 +# Need to stop injecting jar's into classpath.
104 +RESTRICT="test"
105 +
106 +S="${WORKDIR}/${PN}-${MY_PV}"
107 +
108 +RUBY_HOME=/usr/share/${PN}/lib/ruby
109 +SITE_RUBY=${RUBY_HOME}/site_ruby
110 +GEMS=${RUBY_HOME}/gems
111 +
112 +JAVA_ANT_REWRITE_CLASSPATH="true"
113 +JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
114 +EANT_GENTOO_CLASSPATH="ant-core asm-3 bsf-2.3 bytelist jnr-constants jay \
115 +jcodings jffi-1.0 jline \
116 +joda-time joni jnr-ffi-0.5 jnr-posix-1.1 jnr-netdb jvyamlb nailgun jgrapht osgi-core-api \
117 +snakeyaml jzlib-1"
118 +EANT_NEEDS_TOOLS="true"
119 +
120 +pkg_setup() {
121 + unset RUBYOPT
122 + java-pkg-2_pkg_setup
123 +
124 + local fail
125 +
126 + for directory in "${GEMS}" "${SITE_RUBY}"; do
127 + if [[ -L ${directory} ]]; then
128 + eerror "${directory} is a symlink. Please do the following to resolve the situation:"
129 + echo 'emerge -an app-portage/gentoolkit'
130 + echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > ~/jruby.fix'
131 + echo 'emerge -1C $(< ~/jruby.fix)'
132 + echo "rm ${directory}"
133 + echo 'emerge -1 $(< ~/jruby.fix)'
134 + echo 'rm ~/jruby.fix'
135 +
136 + eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
137 + fail="true"
138 + fi
139 + done
140 +
141 + if [[ -n ${fail} ]]; then
142 + die "Please address the above errors, then run emerge --resume"
143 + fi
144 +}
145 +
146 +java_prepare() {
147 + epatch "${FILESDIR}"/${PN}-bash-launcher.patch
148 + epatch "${FILESDIR}/1.5.1/build.xml.patch"
149 +
150 + # We don't need to use Retroweaver. There is a jarjar and a regular jar
151 + # target but even with jarjarclean, both are a pain. The latter target
152 + # is slightly easier so go with this one.
153 + sed -r -i \
154 + -e 's/maxmemory="128m"/maxmemory="192m"/' \
155 + -e "/RetroWeaverTask/d" \
156 + -e "/yecht/! { /<zipfileset .+\/>/d }" \
157 + build.xml || die
158 +
159 + sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
160 +
161 + # Delete the bundled JARs but keep invokedynamic.jar.
162 + # No source is available and it's only a dummy anyway.
163 + find build_lib -name "*.jar" ! -name "jsr292-mock.jar" ! -name "yecht.jar" ! -name 'coro-mock-1.0-SNAPSHOT.jar' -delete || die
164 +}
165 +
166 +src_compile() {
167 + # Avoid generating the ri cache since that currently fails.
168 + local flags="-Dgenerate-ri-cache.hasrun=true"
169 + #local flags=""
170 + use bsf && flags="-Dbsf.present=true"
171 +
172 + export RUBYOPT=""
173 + einfo $RUBYOPT
174 + #eant jar $(use_doc apidocs) -Djdk1.5+=true ${flags}
175 + eant -Djdk1.5+=true ${flags}
176 +}
177 +
178 +src_test() {
179 + if [ ${UID} == 0 ] ; then
180 + ewarn 'The tests will fail if run as root so skipping them.'
181 + ewarn 'Enable FEATURES="userpriv" if you want to run them.'
182 + return
183 + fi
184 + # Our jruby.jar is unbundled so we need to add the classpath to this test.
185 + sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
186 + sed -i "s@:refid => 'build.classpath'@:path =>\"#{ENV['JRUBY_CP']}:lib/jruby.jar\"@g" \
187 + rakelib/commands.rake || die
188 + #sed -i "s@:refid => 'test.class.path'@:path => \"#{ENV['JRUBY_CP']}@g" \
189 + # rakelib/commands.rake || die
190 +
191 + #bsf optionally depends on jruby, which means that the previously
192 + #installed jruby will be added to classpath, nasty things will happen.
193 + local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
194 + cpath="$(echo ${cpath} | sed -e "s_${ROOT}/usr/share/jruby/lib/jruby.jar:__g")"
195 + cpath="${cpath}:$(java-pkg_getjars --build-only commons-logging,xalan)"
196 + EANT_GENTOO_CLASSPATH=""
197 +
198 + local flags=""
199 + use bsf && flags="-Dbsf.present=true"
200 +
201 + #Clear RUBYOPT
202 + export RUBYOPT=""
203 + export JRUBY_CP="${cpath}"
204 + ANT_TASKS="ant-junit4 ant-trax" \
205 + JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
206 + -Dgentoo.classpath="${cpath}" ${flags}
207 +}
208 +
209 +src_install() {
210 + java-pkg_dojar lib/${PN}.jar
211 + dodoc README docs/{*.txt,README.*} || die
212 +
213 + use doc && java-pkg_dojavadoc docs/api
214 + use source && java-pkg_dosrc src/org
215 +
216 +# Use the bash based launcher to preserve whitespace in arguments.
217 +# Ie allow >jruby -e "puts 'hello'"< to work otherwise
218 +# >jruby -e "\"puts 'hello'\""< is needed.
219 +#
220 +# # We run the sed here in install so that we don't get the wrong
221 +# # data during the test phase!
222 +# sed \
223 +# -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
224 +# -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
225 +# bin/jruby.sh > "${T}"/jruby
226 +
227 + newbin bin/jruby.bash jruby
228 + dobin bin/j{irb{,_swing},rubyc}
229 +
230 + insinto "${RUBY_HOME}"
231 + doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby}
232 +
233 + # Remove all the references to RubyGems as we're just going to
234 + # install it through dev-ruby/rubygems.
235 + find "${D}${RUBY_HOME}" -type f \
236 + '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
237 + -delete || die
238 +}