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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Jan 23 23:02:15 2010 UTC (4 years, 7 months ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Revision bump with improvements to the launch script, this reduces its complexity, and make sure that we run with the correct parameters. We also don't symlink in /usr/share/bin any longer. Simplify ebuild logic for the symlink checks, and add a hard blocker on the older versions so that most users upgrading won't hit the error anyway.
(Portage version: 2.2_rc61/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-r3.ebuild,v 1.1 2010/01/16 23:34:28 flameeyes 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 !java6? ( dev-java/backport-util-concurrent:0 )
32 dev-java/nailgun:0
33 dev-java/jaffl:0
34 dev-java/jgrapht:0"
35
36 RDEPEND="${CDEPEND}
37 !java6? ( =virtual/jre-1.5* )
38 java6? ( >=virtual/jre-1.6 )"
39
40 # using 1.6 produces 1.6 bytecode, not sure why
41 DEPEND="${CDEPEND}
42 !java6? ( =virtual/jdk-1.5* )
43 java6? ( >=virtual/jdk-1.6 )
44 bsf? ( dev-java/bsf:2.3 )
45 test? (
46 dev-java/ant-junit
47 dev-java/ant-trax
48 )"
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 use java6 || EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} backport-util-concurrent"
76
77 local fail
78
79 if [[ ! -d "${GEMS}" && -L "${GEMS}" ]]; then
80 eerror "${GEMS} is a symlink. Please remove this symlink."
81 fail="true"
82 fi
83
84 # the symlink creates a collision with rubygems, bug #270953
85 # cannot be currently solved by removing in pkg_preinst, bug #233278
86 if [[ -L "${SITE_RUBY}" ]]; then
87 eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
88 fail="true"
89 fi
90
91 if [[ -n ${fail} ]]; then
92 eerror "Unmerging the old jruby version should also fix the problem(s)."
93 die "Please address the above errors, then run emerge --resume"
94 fi
95 }
96
97 java_prepare() {
98 epatch "${FILESDIR}/ftype-test-fixes.patch"
99 epatch "${FILESDIR}/user-test-fixes.patch"
100 epatch "${FILESDIR}"/${P}-system-jars.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 #
116 # yecht should be packaged standalone; for now keep it around
117 # http://github.com/olabini/yecht
118 find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
119 rm lib/profile.jar || die
120
121 if ! use bsf; then
122 # Remove BSF test cases.
123 cd "${S}/test/org/jruby"
124 rm -f test/TestAdoptedThreading.java || die
125 rm -f javasupport/test/TestBSF.java || die
126 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
127 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
128 fi
129 }
130
131 src_compile() {
132 eant jar $(use_doc apidocs) -Djdk1.5+=true
133 }
134
135 src_test() {
136 if [ ${UID} == 0 ] ; then
137 ewarn 'The tests will fail if run as root so skipping them.'
138 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
139 return
140 fi
141
142 # ali_bush was getting crashes while attempting to run a test.
143 # No info about why it crashed seemed to be produced.
144 # remove it as temp fix.
145 #sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
146
147 # BSF is a compile-time only dependency because it's just the adapter
148 # classes and they won't be used unless invoked from BSF itself.
149 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
150
151 # Our jruby.jar is unbundled so we need to add the classpath to this test.
152 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
153
154 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
155 }
156
157 src_install() {
158 local bin
159
160 java-pkg_dojar lib/${PN}.jar
161 dodoc README docs/{*.txt,README.*} || die
162
163 use doc && java-pkg_dojavadoc docs/api
164 use source && java-pkg_dosrc src/org
165
166 dobin "${FILESDIR}/jruby" || die
167 exeinto "/usr/share/${PN}/bin"
168 doexe "${S}/bin/jruby" || die
169
170 # Install some jruby tools.
171 dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
172
173 # Symlink some common tools so that jruby can launch them internally.
174 for bin in {j,}gem jirb jrubyc rdoc ri ; do
175 dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
176 done
177
178 insinto "${RUBY_HOME}"
179 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
180
181 insinto "${SITE_RUBY}/shared"
182 doins "${FILESDIR}/auto_gem.rb" || die
183
184 keepdir "${GEMS}"/1.8/{cache,doc}
185 }
186
187 pkg_postinst() {
188 ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
189 ewarn "to gentoo.rb load failure."
190 ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
191 ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
192 ewarn "or explicitly unset the variable before running jruby."
193 }

  ViewVC Help
Powered by ViewVC 1.1.20