Gentoo Archives: gentoo-commits

From: "Alistair Bush (ali_bush)" <ali_bush@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-java/jruby: ChangeLog jruby-1.3.1-r1.ebuild
Date: Tue, 29 Dec 2009 21:55:36
Message-Id: E1NPk2O-0001oC-Sm@stork.gentoo.org
1 ali_bush 09/12/29 21:55:32
2
3 Modified: ChangeLog
4 Added: jruby-1.3.1-r1.ebuild
5 Log:
6 Changes made to ensure gems that 1.8 and jruby don't collide. See flameeyes for the why.
7 (Portage version: 2.1.7.16/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.43 dev-java/jruby/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/ChangeLog?rev=1.43&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/ChangeLog?rev=1.43&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/ChangeLog?r1=1.42&r2=1.43
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v
19 retrieving revision 1.42
20 retrieving revision 1.43
21 diff -u -r1.42 -r1.43
22 --- ChangeLog 25 Oct 2009 21:51:27 -0000 1.42
23 +++ ChangeLog 29 Dec 2009 21:55:32 -0000 1.43
24 @@ -1,6 +1,12 @@
25 # ChangeLog for dev-java/jruby
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v 1.42 2009/10/25 21:51:27 volkmar Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v 1.43 2009/12/29 21:55:32 ali_bush Exp $
29 +
30 +*jruby-1.3.1-r1 (29 Dec 2009)
31 +
32 + 29 Dec 2009; Alistair Bush <ali_bush@g.o> +jruby-1.3.1-r1.ebuild:
33 + Changes made to ensure gems that 1.8 and jruby don't collide. See flameeyes
34 + for the why.
35
36 25 Oct 2009; Mounir Lamouri <volkmar@g.o> jruby-1.2.0-r1.ebuild,
37 jruby-1.3.1.ebuild:
38
39
40
41 1.1 dev-java/jruby/jruby-1.3.1-r1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/jruby-1.3.1-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/jruby-1.3.1-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: jruby-1.3.1-r1.ebuild
47 ===================================================================
48 # Copyright 1999-2009 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.3.1-r1.ebuild,v 1.1 2009/12/29 21:55:32 ali_bush Exp $
51
52 EAPI="2"
53 JAVA_PKG_IUSE="doc source test"
54 inherit eutils java-pkg-2 java-ant-2
55
56 MY_PV="${PV/_rc1/RC1}"
57
58 DESCRIPTION="Java-based Ruby interpreter implementation"
59 HOMEPAGE="http://jruby.codehaus.org/"
60 SRC_URI="http://dist.codehaus.org/${PN}/${MY_PV}/${PN}-src-${MY_PV}.tar.gz"
61 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
62 SLOT="0"
63 KEYWORDS="~amd64 ~ppc ~x86"
64 IUSE="bsf java6 ssl"
65
66 CDEPEND=">=dev-java/bytelist-1.0.2:0
67 >=dev-java/constantine-0.6:0
68 >=dev-java/jline-0.9.94:0
69 >=dev-java/joni-1.1.3:0
70 >=dev-java/jna-posix-1.0.1:0
71 >=dev-java/jvyamlb-0.2.5:0
72 dev-java/asm:3
73 dev-java/jcodings:0
74 dev-java/jffi:0.4
75 dev-java/jna:0
76 dev-java/joda-time:0
77 dev-util/jay:0[java]
78 !java6? ( dev-java/backport-util-concurrent:0 )
79 dev-java/nailgun:0"
80
81 RDEPEND="${CDEPEND}
82 !java6? ( =virtual/jre-1.5* )
83 java6? ( >=virtual/jre-1.6 )"
84
85 # using 1.6 produces 1.6 bytecode, not sure why
86 DEPEND="${CDEPEND}
87 !java6? ( =virtual/jdk-1.5* )
88 java6? ( >=virtual/jdk-1.6 )
89 bsf? ( dev-java/bsf:2.3 )
90 test? (
91 dev-java/ant-junit
92 dev-java/ant-trax
93 )"
94
95 PDEPEND="dev-ruby/rubygems
96 >=dev-ruby/rake-0.7.3
97 >=dev-ruby/rspec-1.0.4
98 ssl? ( dev-ruby/jruby-openssl )"
99
100 # Tests work for ali_bush. But fail for flameeyes see #282439.
101 # Tests work for ali_bush inside the ebuild env
102 # but fail when using vanilla src tarball.
103 # Restrict tests so we can stablise this package.
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="asm-3 bytelist constantine jay jcodings jffi-0.4 jline \
115 joda-time joni jna jna-posix jvyamlb,nailgun"
116 EANT_NEEDS_TOOLS="true"
117
118 pkg_setup() {
119 java-pkg-2_pkg_setup
120 use java6 || EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} backport-util-concurrent"
121
122 local fail
123
124 if [[ ! -d "${GEMS}" && -L "${GEMS}" ]]; then
125 eerror "${GEMS} is a symlink. Please remove this symlink."
126 fail="true"
127 fi
128
129 # the symlink creates a collision with rubygems, bug #270953
130 # cannot be currently solved by removing in pkg_preinst, bug #233278
131 if [[ -L "${SITE_RUBY}" ]]; then
132 eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
133 fail="true"
134 fi
135
136 if [[ -n ${fail} ]]; then
137 eerror "Unmerging the old jruby version should also fix the problem(s)."
138 die "Please address the above errors, then run emerge --resume"
139 fi
140 }
141
142 java_prepare() {
143 epatch "${FILESDIR}/ftype-test-fixes.patch"
144 epatch "${FILESDIR}/user-test-fixes.patch"
145
146 # We don't need to use Retroweaver. There is a jarjar and a regular jar
147 # target but even with jarjarclean, both are a pain. The latter target
148 # is slightly easier so go with this one.
149 sed -r -i \
150 -e 's/maxmemory="128m"/maxmemory="192m"/' \
151 -e "/RetroWeaverTask/d" \
152 -e "/<zipfileset .+\/>/d" \
153 build.xml || die
154
155 # Delete the bundled JARs but keep invokedynamic.jar.
156 # No source is available and it's only a dummy anyway.
157 find build_lib lib -name "*.jar" ! -name "invokedynamic.jar" -delete || die
158
159 if ! use bsf; then
160 # Remove BSF test cases.
161 cd "${S}/test/org/jruby"
162 rm -f test/TestAdoptedThreading.java || die
163 rm -f javasupport/test/TestBSF.java || die
164 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
165 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
166 fi
167 }
168
169 src_compile() {
170 eant jar $(use_doc create-apidocs) -Djdk1.5+=true
171 }
172
173 src_test() {
174 if [ ${UID} == 0 ] ; then
175 ewarn 'The tests will fail if run as root so skipping them.'
176 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
177 return
178 fi
179
180 # ali_bush was getting crashes while attempting to run a test.
181 # No info about why it crashed seemed to be produced.
182 # remove it as temp fix.
183 sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
184
185 # BSF is a compile-time only dependency because it's just the adapter
186 # classes and they won't be used unless invoked from BSF itself.
187 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
188
189 # Our jruby.jar is unbundled so we need to add the classpath to this test.
190 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
191
192 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
193 }
194
195 src_install() {
196 local bin
197
198 java-pkg_dojar lib/${PN}.jar
199 dodoc README docs/{*.txt,README.*} || die
200
201 use doc && java-pkg_dojavadoc docs/api
202 use source && java-pkg_dosrc src/org
203
204 dobin "${FILESDIR}/jruby" || die
205 exeinto "/usr/share/${PN}/bin"
206 doexe "${S}/bin/jruby" || die
207
208 # Install some jruby tools.
209 dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
210
211 # Symlink some common tools so that jruby can launch them internally.
212 for bin in {j,}gem jirb jrubyc rake rdoc ri spec{,_translator} ; do
213 dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
214 done
215
216 insinto "${RUBY_HOME}"
217 doins -r "${S}/lib/ruby/1.8" || die
218 doins -r "${S}/lib/ruby/site_ruby" || die
219
220 # Autoload rubygems and append regular site_ruby to $LOAD_PATH.
221 # Unfortunately the -I option prepends instead.
222 insinto "${SITE_RUBY}"
223 doins "${FILESDIR}/gentoo.rb" || die
224 doenvd "${FILESDIR}/10jruby" || die
225
226 keepdir "${GEMS}/1.8/{cache,doc}"
227 }