/[gentoo-x86]/dev-java/jruby/jruby-1.4.0-r4.ebuild
Gentoo

Contents of /dev-java/jruby/jruby-1.4.0-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Apr 27 09:23:58 2010 UTC (4 years, 7 months ago) by caster
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Version bump, depend on new jcondings for security bug #312547.
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.4.0-r4.ebuild,v 1.3 2010/02/09 17:10:23 caster Exp $
4
5 EAPI="2"
6 JAVA_PKG_IUSE="doc source test"
7 inherit eutils java-pkg-2 java-ant-2
8
9 MY_PV="${PV/_rc1/RC1}"
10
11 DESCRIPTION="Java-based Ruby interpreter implementation"
12 HOMEPAGE="http://jruby.codehaus.org/"
13 SRC_URI="http://jruby.kenai.com/downloads/${PV}/${PN}-src-${MY_PV}.tar.gz"
14 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="bsf java6 ssl"
18
19 CDEPEND=">=dev-java/bytelist-1.0.2:0
20 >=dev-java/constantine-0.6:0
21 >=dev-java/jline-0.9.94:0
22 >=dev-java/joni-1.1.3:0
23 >=dev-java/jna-posix-1.0.1:0
24 >=dev-java/jvyamlb-0.2.5:0
25 >=dev-java/asm-3.2:3
26 dev-java/jcodings:0
27 >=dev-java/jffi-0.6.0.2-r1:0.4
28 dev-java/jna:0
29 dev-java/joda-time:0
30 dev-util/jay:0[java]
31 dev-java/nailgun:0
32 dev-java/jaffl:0
33 dev-java/jgrapht:0"
34
35 RDEPEND="${CDEPEND}
36 !java6? ( =virtual/jre-1.5* )
37 java6? ( >=virtual/jre-1.6 )"
38
39 # using 1.6 produces 1.6 bytecode, not sure why
40 DEPEND="${CDEPEND}
41 !java6? ( =virtual/jdk-1.5* )
42 java6? ( >=virtual/jdk-1.6 )
43 bsf? ( dev-java/bsf:2.3 )
44 test? (
45 dev-java/ant-junit
46 dev-java/ant-trax
47 )
48 !!<dev-ruby/jruby-1.3.1-r1"
49
50 PDEPEND="dev-ruby/rubygems
51 >=dev-ruby/rake-0.7.3
52 >=dev-ruby/rspec-1.0.4
53 ssl? ( dev-ruby/jruby-openssl )"
54
55 # Tests work for ali_bush. But fail for flameeyes see #282439.
56 # Tests work for ali_bush inside the ebuild env
57 # but fail when using vanilla src tarball.
58 # Restrict tests so we can stablise this package.
59 #RESTRICT="test"
60
61 S="${WORKDIR}/${PN}-${MY_PV}"
62
63 RUBY_HOME=/usr/share/${PN}/lib/ruby
64 SITE_RUBY=${RUBY_HOME}/site_ruby
65 GEMS=${RUBY_HOME}/gems
66
67 JAVA_ANT_REWRITE_CLASSPATH="true"
68 JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
69 EANT_GENTOO_CLASSPATH="asm-3 bytelist constantine jay jcodings jffi-0.4 jline \
70 joda-time joni jna jna-posix jvyamlb nailgun jaffl jgrapht"
71 EANT_NEEDS_TOOLS="true"
72
73 pkg_setup() {
74 java-pkg-2_pkg_setup
75
76 local fail
77
78 for directory in "${GEMS}" "${SITE_RUBY}"; do
79 if [[ -L ${directory} ]]; then
80 eerror "${directory} is a symlink. Please remove this symlink."
81 fail="true"
82 fi
83 done
84
85 if [[ -n ${fail} ]]; then
86 eerror "Unmerging the old jruby version should also fix the problem(s)."
87 die "Please address the above errors, then run emerge --resume"
88 fi
89 }
90
91 java_prepare() {
92 epatch "${FILESDIR}/ftype-test-fixes.patch"
93 epatch "${FILESDIR}/user-test-fixes.patch"
94 epatch "${FILESDIR}"/${P}-system-jars.patch
95 epatch "${FILESDIR}"/${P}-bindir.patch
96
97 # We don't need to use Retroweaver. There is a jarjar and a regular jar
98 # target but even with jarjarclean, both are a pain. The latter target
99 # is slightly easier so go with this one.
100 sed -r -i \
101 -e 's/maxmemory="128m"/maxmemory="192m"/' \
102 -e "/RetroWeaverTask/d" \
103 -e "/<zipfileset .+\/>/d" \
104 build.xml || die
105
106 sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
107
108 # Delete the bundled JARs but keep invokedynamic.jar.
109 # No source is available and it's only a dummy anyway.
110 find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
111 rm lib/profile.jar || die
112
113 if ! use bsf; then
114 # Remove BSF test cases.
115 cd "${S}/test/org/jruby"
116 rm -f test/TestAdoptedThreading.java || die
117 rm -f javasupport/test/TestBSF.java || die
118 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
119 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
120 fi
121 }
122
123 src_compile() {
124 eant jar $(use_doc apidocs) -Djdk1.5+=true
125 }
126
127 src_test() {
128 if [ ${UID} == 0 ] ; then
129 ewarn 'The tests will fail if run as root so skipping them.'
130 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
131 return
132 fi
133
134 # ali_bush was getting crashes while attempting to run a test.
135 # No info about why it crashed seemed to be produced.
136 # remove it as temp fix.
137 #sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
138
139 # BSF is a compile-time only dependency because it's just the adapter
140 # classes and they won't be used unless invoked from BSF itself.
141 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
142
143 # Our jruby.jar is unbundled so we need to add the classpath to this test.
144 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
145
146 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
147 }
148
149 src_install() {
150 local bin
151
152 java-pkg_dojar lib/${PN}.jar
153 dodoc README docs/{*.txt,README.*} || die
154
155 use doc && java-pkg_dojavadoc docs/api
156 use source && java-pkg_dosrc src/org
157
158 # We run the sed here in install so that we don't get the wrong
159 # data during the test phase!
160 sed \
161 -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
162 -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
163 bin/jruby > "${T}"/jruby
164
165 dobin "${T}"/jruby "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
166
167 insinto "${RUBY_HOME}"
168 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
169
170 insinto "${SITE_RUBY}/shared"
171 doins "${FILESDIR}/auto_gem.rb" || die
172
173 keepdir "${GEMS}"/1.8/{cache,doc}
174 }
175
176 pkg_postinst() {
177 ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
178 ewarn "to gentoo.rb load failure."
179 ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
180 ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
181 ewarn "or explicitly unset the variable before running jruby."
182 }

  ViewVC Help
Powered by ViewVC 1.1.20