/[gentoo-x86]/dev-java/jruby/jruby-1.3.1-r1.ebuild
Gentoo

Contents of /dev-java/jruby/jruby-1.3.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Wed May 9 04:03:28 2012 UTC (2 years, 5 months ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Version bump; remove old ebuilds.

(Portage version: 2.2.0_alpha101/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.3.1-r1.ebuild,v 1.6 2010/06/30 20:53:35 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://dist.codehaus.org/${PN}/${MY_PV}/${PN}-src-${MY_PV}.tar.gz"
14 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
15 SLOT="0"
16 KEYWORDS="~ppc"
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
26 dev-java/jcodings:0
27 dev-java/jffi: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
33 RDEPEND="${CDEPEND}
34 !java6? ( =virtual/jre-1.5* )
35 java6? ( >=virtual/jre-1.6 )"
36
37 # using 1.6 produces 1.6 bytecode, not sure why
38 DEPEND="${CDEPEND}
39 !java6? ( =virtual/jdk-1.5* )
40 java6? ( >=virtual/jdk-1.6 )
41 bsf? ( dev-java/bsf:2.3 )
42 test? (
43 dev-java/ant-junit
44 dev-java/ant-trax
45 )"
46
47 PDEPEND="dev-ruby/rubygems
48 >=dev-ruby/rake-0.7.3
49 >=dev-ruby/rspec-1.0.4
50 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"
68 EANT_NEEDS_TOOLS="true"
69
70 pkg_setup() {
71 java-pkg-2_pkg_setup
72
73 local fail
74
75 if [[ ! -d "${GEMS}" && -L "${GEMS}" ]]; then
76 eerror "${GEMS} is a symlink. Please remove this symlink."
77 fail="true"
78 fi
79
80 # the symlink creates a collision with rubygems, bug #270953
81 # cannot be currently solved by removing in pkg_preinst, bug #233278
82 if [[ -L "${SITE_RUBY}" ]]; then
83 eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
84 fail="true"
85 fi
86
87 if [[ -n ${fail} ]]; then
88 eerror "Unmerging the old jruby version should also fix the problem(s)."
89 die "Please address the above errors, then run emerge --resume"
90 fi
91 }
92
93 java_prepare() {
94 epatch "${FILESDIR}/ftype-test-fixes.patch"
95 epatch "${FILESDIR}/user-test-fixes.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 # Delete the bundled JARs but keep invokedynamic.jar.
107 # No source is available and it's only a dummy anyway.
108 find build_lib lib -name "*.jar" ! -name "invokedynamic.jar" -delete || die
109
110 if ! use bsf; then
111 # Remove BSF test cases.
112 cd "${S}/test/org/jruby"
113 rm -f test/TestAdoptedThreading.java || die
114 rm -f javasupport/test/TestBSF.java || die
115 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
116 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
117 fi
118 }
119
120 src_compile() {
121 eant jar $(use_doc create-apidocs) -Djdk1.5+=true
122 }
123
124 src_test() {
125 if [ ${UID} == 0 ] ; then
126 ewarn 'The tests will fail if run as root so skipping them.'
127 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
128 return
129 fi
130
131 # ali_bush was getting crashes while attempting to run a test.
132 # No info about why it crashed seemed to be produced.
133 # remove it as temp fix.
134 sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
135
136 # BSF is a compile-time only dependency because it's just the adapter
137 # classes and they won't be used unless invoked from BSF itself.
138 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
139
140 # Our jruby.jar is unbundled so we need to add the classpath to this test.
141 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
142
143 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
144 }
145
146 src_install() {
147 local bin
148
149 java-pkg_dojar lib/${PN}.jar
150 dodoc README docs/{*.txt,README.*} || die
151
152 use doc && java-pkg_dojavadoc docs/api
153 use source && java-pkg_dosrc src/org
154
155 dobin "${FILESDIR}/jruby" || die
156 exeinto "/usr/share/${PN}/bin"
157 doexe "${S}/bin/jruby" || die
158
159 # Install some jruby tools.
160 dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
161
162 # Symlink some common tools so that jruby can launch them internally.
163 for bin in {j,}gem jirb jrubyc rake rdoc ri spec{,_translator} ; do
164 dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
165 done
166
167 insinto "${RUBY_HOME}"
168 doins -r "${S}/lib/ruby/1.8" || die
169 doins -r "${S}/lib/ruby/site_ruby" || die
170
171 # Autoload rubygems and append regular site_ruby to $LOAD_PATH.
172 # Unfortunately the -I option prepends instead.
173 insinto "${SITE_RUBY}"
174 doins "${FILESDIR}/gentoo.rb" || die
175 doenvd "${FILESDIR}/10jruby" || die
176
177 keepdir "${GEMS}"/1.8/{cache,doc}
178 }

  ViewVC Help
Powered by ViewVC 1.1.20