/[gentoo-x86]/dev-java/jruby/jruby-1.5.1-r2.ebuild
Gentoo

Contents of /dev-java/jruby/jruby-1.5.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Aug 22 15:14:11 2010 UTC (4 years, 1 month ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump to fix the Webrick security issue; remove non-stable-candidate vulnerable ebuilds.
(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.5.1-r2.ebuild,v 1.2 2010/06/30 06:36:34 fauli 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.org.s3.amazonaws.com/downloads/${PV}/${PN}-src-${PV}.tar.gz"
14 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="bsf ssl"
18
19 CDEPEND=">=dev-java/bytelist-1.0.6: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/jnr-posix-1.1.3:0
24 >=dev-java/jnr-netdb-1.0:0
25 >=dev-java/jvyamlb-0.2.5:0
26 >=dev-java/asm-3.2:3
27 dev-java/jcodings:0
28 >=dev-java/jffi-0.7_pre:0.4
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 dev-java/ant-core:0
35 dev-java/bsf:2.3"
36
37 RDEPEND="${CDEPEND}
38 >=virtual/jre-1.6"
39
40 DEPEND="${CDEPEND}
41 >=virtual/jdk-1.6
42 test? (
43 dev-java/ant-junit4:0
44 dev-java/ant-trax:0
45 dev-java/junit:4
46 java-virtuals/jdk-with-com-sun
47 dev-java/commons-logging:0
48 dev-java/xalan:0
49 >=dev-java/jna-posix-1.0.1:0
50 )
51 !!<dev-ruby/jruby-1.3.1-r1"
52
53 PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
54
55 # Tests fail.
56 # Need to stop injecting jar's into classpath.
57 RESTRICT="test"
58
59 S="${WORKDIR}/${PN}-${MY_PV}"
60
61 RUBY_HOME=/usr/share/${PN}/lib/ruby
62 SITE_RUBY=${RUBY_HOME}/site_ruby
63 GEMS=${RUBY_HOME}/gems
64
65 JAVA_ANT_REWRITE_CLASSPATH="true"
66 JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
67 EANT_GENTOO_CLASSPATH="ant-core asm-3 bsf-2.3 bytelist constantine jay \
68 jcodings jffi-0.4 jline constantine \
69 joda-time joni jnr-posix jnr-netdb jvyamlb nailgun jaffl jgrapht"
70 EANT_NEEDS_TOOLS="true"
71
72 pkg_setup() {
73 java-pkg-2_pkg_setup
74
75 local fail
76
77 for directory in "${GEMS}" "${SITE_RUBY}"; do
78 if [[ -L ${directory} ]]; then
79 eerror "${directory} is a symlink. Please do the following to resolve the situation:"
80 echo 'emerge -an app-portage/gentoolkit'
81 echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > ~/jruby.fix'
82 echo 'emerge -1C $(< ~/jruby.fix)'
83 echo "rm ${directory}"
84 echo 'emerge -1 $(< ~/jruby.fix)'
85 echo 'rm ~/jruby.fix'
86
87 eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
88 fail="true"
89 fi
90 done
91
92 if [[ -n ${fail} ]]; then
93 die "Please address the above errors, then run emerge --resume"
94 fi
95 }
96
97 java_prepare() {
98 epatch "${FILESDIR}"/${PN}-1.5.0-system-jars.patch
99 epatch "${FILESDIR}/${PV}/build.xml.patch"
100 epatch "${FILESDIR}/${PV}/testfixes.patch"
101
102 # We don't need to use Retroweaver. There is a jarjar and a regular jar
103 # target but even with jarjarclean, both are a pain. The latter target
104 # is slightly easier so go with this one.
105 sed -r -i \
106 -e 's/maxmemory="128m"/maxmemory="192m"/' \
107 -e "/RetroWeaverTask/d" \
108 -e "/<zipfileset .+\/>/d" \
109 build.xml || die
110
111 sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
112
113 # Delete the bundled JARs but keep invokedynamic.jar.
114 # No source is available and it's only a dummy anyway.
115 find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
116 rm lib/profile.jar || die
117
118 # change some defaults for Gentoo to work properly
119 cat - >> src/org/jruby/jruby.properties <<EOF
120 jruby.bindir = /usr/bin
121 EOF
122 }
123
124 src_compile() {
125 local flags=""
126 use bsf && flags="-Dbsf.present=true"
127
128 eant jar $(use_doc apidocs) -Djdk1.5+=true ${flags}
129 }
130
131 src_test() {
132 if [ ${UID} == 0 ] ; then
133 ewarn 'The tests will fail if run as root so skipping them.'
134 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
135 return
136 fi
137 # Our jruby.jar is unbundled so we need to add the classpath to this test.
138 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
139 sed -i "s@:refid => 'build.classpath'@:path =>\"#{ENV['JRUBY_CP']}:lib/jruby.jar\"@g" \
140 rakelib/commands.rake || die
141 #sed -i "s@:refid => 'test.class.path'@:path => \"#{ENV['JRUBY_CP']}@g" \
142 # rakelib/commands.rake || die
143
144 #bsf optionally depends on jruby, which means that the previously
145 #installed jruby will be added to classpath, nasty things will happen.
146 local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
147 cpath="$(echo ${cpath} | sed -e "s_${ROOT}/usr/share/jruby/lib/jruby.jar:__g")"
148 cpath="${cpath}:$(java-pkg_getjars --build-only commons-logging,xalan)"
149 EANT_GENTOO_CLASSPATH=""
150
151 local flags=""
152 use bsf && flags="-Dbsf.present=true"
153
154 #Clear RUBYOPT
155 export RUBYOPT=""
156 export JRUBY_CP="${cpath}"
157 ANT_TASKS="ant-junit4 ant-trax" \
158 JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
159 -Dgentoo.classpath="${cpath}" ${flags}
160 }
161
162 src_install() {
163 local bin
164
165 java-pkg_dojar lib/${PN}.jar
166 dodoc README docs/{*.txt,README.*} || die
167
168 use doc && java-pkg_dojavadoc docs/api
169 use source && java-pkg_dosrc src/org
170
171 # We run the sed here in install so that we don't get the wrong
172 # data during the test phase!
173 sed \
174 -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
175 -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
176 bin/jruby > "${T}"/jruby
177
178 dobin "${T}"/jruby "${S}"/bin/j{irb{,_swing},rubyc} || die
179
180 insinto "${RUBY_HOME}"
181 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
182
183 # Remove all the references to RubyGems as we're just going to
184 # install it through dev-ruby/rubygems.
185 find "${D}${RUBY_HOME}" -type f \
186 '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
187 -delete || die
188 }
189
190 pkg_postinst() {
191 ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
192 ewarn "to gentoo.rb load failure."
193 ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
194 ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
195 ewarn "or explicitly unset the variable before running jruby."
196 }

  ViewVC Help
Powered by ViewVC 1.1.20