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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sat Jan 16 21:14:07 2010 UTC (4 years, 10 months ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Fix usage of system nailgun.
(Portage version: 2.2_rc61/cvs/Linux x86_64)

1 flameeyes 1.1 # Copyright 1999-2010 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 flameeyes 1.4 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.4.0-r1.ebuild,v 1.3 2010/01/16 21:02:51 flameeyes Exp $
4 flameeyes 1.1
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 flameeyes 1.2 SRC_URI="http://jruby.kenai.com/downloads/${PV}/${PN}-src-${MY_PV}.tar.gz"
14 flameeyes 1.1 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
15     SLOT="0"
16     KEYWORDS="~amd64 ~ppc ~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.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    
101     # We don't need to use Retroweaver. There is a jarjar and a regular jar
102     # target but even with jarjarclean, both are a pain. The latter target
103     # is slightly easier so go with this one.
104     sed -r -i \
105     -e 's/maxmemory="128m"/maxmemory="192m"/' \
106     -e "/RetroWeaverTask/d" \
107     -e "/<zipfileset .+\/>/d" \
108     build.xml || die
109    
110     sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
111    
112     # Delete the bundled JARs but keep invokedynamic.jar.
113     # No source is available and it's only a dummy anyway.
114     #
115     # yecht should be packaged standalone; for now keep it around
116     # http://github.com/olabini/yecht
117     find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
118     rm lib/profile.jar || die
119    
120     if ! use bsf; then
121     # Remove BSF test cases.
122     cd "${S}/test/org/jruby"
123     rm -f test/TestAdoptedThreading.java || die
124     rm -f javasupport/test/TestBSF.java || die
125     sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
126     sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
127     fi
128     }
129    
130     src_compile() {
131     eant jar $(use_doc apidocs) -Djdk1.5+=true
132     }
133    
134     src_test() {
135     if [ ${UID} == 0 ] ; then
136     ewarn 'The tests will fail if run as root so skipping them.'
137     ewarn 'Enable FEATURES="userpriv" if you want to run them.'
138     return
139     fi
140    
141     # ali_bush was getting crashes while attempting to run a test.
142     # No info about why it crashed seemed to be produced.
143     # remove it as temp fix.
144     #sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
145    
146     # BSF is a compile-time only dependency because it's just the adapter
147     # classes and they won't be used unless invoked from BSF itself.
148     use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
149    
150     # Our jruby.jar is unbundled so we need to add the classpath to this test.
151     sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
152    
153     ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
154     }
155    
156     src_install() {
157     local bin
158    
159     java-pkg_dojar lib/${PN}.jar
160     dodoc README docs/{*.txt,README.*} || die
161    
162     use doc && java-pkg_dojavadoc docs/api
163     use source && java-pkg_dosrc src/org
164    
165     dobin "${FILESDIR}/jruby" || die
166     exeinto "/usr/share/${PN}/bin"
167     doexe "${S}/bin/jruby" || die
168    
169     # Install some jruby tools.
170     dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
171    
172     # Symlink some common tools so that jruby can launch them internally.
173     for bin in {j,}gem jirb jrubyc rdoc ri ; do
174     dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
175     done
176    
177     insinto "${RUBY_HOME}"
178     doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
179    
180     insinto "${SITE_RUBY}/shared"
181     doins "${FILESDIR}/auto_gem.rb" || die
182    
183     keepdir "${GEMS}"/1.8/{cache,doc}
184     }
185 flameeyes 1.3
186     pkg_postinst() {
187     ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
188     ewarn "to gentoo.rb load failure."
189     ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
190     ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
191     ewarn "or explicitly unset the variable before running jruby."
192     }

  ViewVC Help
Powered by ViewVC 1.1.20