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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Apr 27 09:23:58 2010 UTC (6 years, 2 months ago) by caster
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +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-r5.ebuild,v 1.2 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.7_pre: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="ssl? ( dev-ruby/jruby-openssl )"
51
52 # Tests work for ali_bush. But fail for flameeyes see #282439.
53 # Tests work for ali_bush inside the ebuild env
54 # but fail when using vanilla src tarball.
55 # Restrict tests so we can stablise this package.
56 #RESTRICT="test"
57
58 S="${WORKDIR}/${PN}-${MY_PV}"
59
60 RUBY_HOME=/usr/share/${PN}/lib/ruby
61 SITE_RUBY=${RUBY_HOME}/site_ruby
62 GEMS=${RUBY_HOME}/gems
63
64 JAVA_ANT_REWRITE_CLASSPATH="true"
65 JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
66 EANT_GENTOO_CLASSPATH="asm-3 bytelist constantine jay jcodings jffi-0.4 jline \
67 joda-time joni jna jna-posix jvyamlb nailgun jaffl jgrapht"
68 EANT_NEEDS_TOOLS="true"
69
70 pkg_setup() {
71 java-pkg-2_pkg_setup
72
73 local fail
74
75 for directory in "${GEMS}" "${SITE_RUBY}"; do
76 if [[ -L ${directory} ]]; then
77 eerror "${directory} is a symlink. Please remove this symlink."
78 fail="true"
79 fi
80 done
81
82 if [[ -n ${fail} ]]; then
83 die "Please address the above errors, then run emerge --resume"
84 fi
85 }
86
87 java_prepare() {
88 epatch "${FILESDIR}/ftype-test-fixes.patch"
89 epatch "${FILESDIR}/user-test-fixes.patch"
90 epatch "${FILESDIR}"/${P}-system-jars-r2.patch
91 epatch "${FILESDIR}"/${P}-bindir.patch
92
93 # We don't need to use Retroweaver. There is a jarjar and a regular jar
94 # target but even with jarjarclean, both are a pain. The latter target
95 # is slightly easier so go with this one.
96 sed -r -i \
97 -e 's/maxmemory="128m"/maxmemory="192m"/' \
98 -e "/RetroWeaverTask/d" \
99 -e "/<zipfileset .+\/>/d" \
100 build.xml || die
101
102 sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
103
104 # Delete the bundled JARs but keep invokedynamic.jar.
105 # No source is available and it's only a dummy anyway.
106 find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
107 rm lib/profile.jar || die
108
109 if ! use bsf; then
110 # Remove BSF test cases.
111 cd "${S}/test/org/jruby"
112 rm -f test/TestAdoptedThreading.java || die
113 rm -f javasupport/test/TestBSF.java || die
114 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
115 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
116 fi
117 }
118
119 src_compile() {
120 eant jar $(use_doc apidocs) -Djdk1.5+=true
121 }
122
123 src_test() {
124 if [ ${UID} == 0 ] ; then
125 ewarn 'The tests will fail if run as root so skipping them.'
126 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
127 return
128 fi
129
130 # ali_bush was getting crashes while attempting to run a test.
131 # No info about why it crashed seemed to be produced.
132 # remove it as temp fix.
133 #sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
134
135 # BSF is a compile-time only dependency because it's just the adapter
136 # classes and they won't be used unless invoked from BSF itself.
137 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
138
139 # Our jruby.jar is unbundled so we need to add the classpath to this test.
140 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
141
142 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
143 }
144
145 src_install() {
146 local bin
147
148 java-pkg_dojar lib/${PN}.jar
149 dodoc README docs/{*.txt,README.*} || die
150
151 use doc && java-pkg_dojavadoc docs/api
152 use source && java-pkg_dosrc src/org
153
154 # We run the sed here in install so that we don't get the wrong
155 # data during the test phase!
156 sed \
157 -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
158 -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
159 bin/jruby > "${T}"/jruby
160
161 dobin "${T}"/jruby "${S}"/bin/j{irb{,_swing},rubyc} || die
162
163 insinto "${RUBY_HOME}"
164 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
165
166 # Remove all the references to RubyGems as we're just going to
167 # install it through dev-ruby/rubygems.
168 find "${D}${RUBY_HOME}" -type f \
169 '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
170 -delete || die
171 }
172
173 pkg_postinst() {
174 ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
175 ewarn "to gentoo.rb load failure."
176 ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
177 ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
178 ewarn "or explicitly unset the variable before running jruby."
179 }

  ViewVC Help
Powered by ViewVC 1.1.20