/[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.2 - (hide annotations) (download)
Sat Jan 2 00:01:23 2010 UTC (4 years, 11 months ago) by flameeyes
Branch: MAIN
Changes since 1.1: +3 -3 lines
Fix creation of cache and doc directories.
(Portage version: 2.2_rc61/cvs/Linux x86_64)

1 flameeyes 1.2 # Copyright 1999-2010 Gentoo Foundation
2 ali_bush 1.1 # Distributed under the terms of the GNU General Public License v2
3 flameeyes 1.2 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.3.1-r1.ebuild,v 1.1 2009/12/29 21:55:32 ali_bush Exp $
4 ali_bush 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     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="~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
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    
34     RDEPEND="${CDEPEND}
35     !java6? ( =virtual/jre-1.5* )
36     java6? ( >=virtual/jre-1.6 )"
37    
38     # using 1.6 produces 1.6 bytecode, not sure why
39     DEPEND="${CDEPEND}
40     !java6? ( =virtual/jdk-1.5* )
41     java6? ( >=virtual/jdk-1.6 )
42     bsf? ( dev-java/bsf:2.3 )
43     test? (
44     dev-java/ant-junit
45     dev-java/ant-trax
46     )"
47    
48     PDEPEND="dev-ruby/rubygems
49     >=dev-ruby/rake-0.7.3
50     >=dev-ruby/rspec-1.0.4
51     ssl? ( dev-ruby/jruby-openssl )"
52    
53     # Tests work for ali_bush. But fail for flameeyes see #282439.
54     # Tests work for ali_bush inside the ebuild env
55     # but fail when using vanilla src tarball.
56     # Restrict tests so we can stablise this package.
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="asm-3 bytelist constantine jay jcodings jffi-0.4 jline \
68     joda-time joni jna jna-posix jvyamlb,nailgun"
69     EANT_NEEDS_TOOLS="true"
70    
71     pkg_setup() {
72     java-pkg-2_pkg_setup
73     use java6 || EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} backport-util-concurrent"
74    
75     local fail
76    
77     if [[ ! -d "${GEMS}" && -L "${GEMS}" ]]; then
78     eerror "${GEMS} is a symlink. Please remove this symlink."
79     fail="true"
80     fi
81    
82     # the symlink creates a collision with rubygems, bug #270953
83     # cannot be currently solved by removing in pkg_preinst, bug #233278
84     if [[ -L "${SITE_RUBY}" ]]; then
85     eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
86     fail="true"
87     fi
88    
89     if [[ -n ${fail} ]]; then
90     eerror "Unmerging the old jruby version should also fix the problem(s)."
91     die "Please address the above errors, then run emerge --resume"
92     fi
93     }
94    
95     java_prepare() {
96     epatch "${FILESDIR}/ftype-test-fixes.patch"
97     epatch "${FILESDIR}/user-test-fixes.patch"
98    
99     # We don't need to use Retroweaver. There is a jarjar and a regular jar
100     # target but even with jarjarclean, both are a pain. The latter target
101     # is slightly easier so go with this one.
102     sed -r -i \
103     -e 's/maxmemory="128m"/maxmemory="192m"/' \
104     -e "/RetroWeaverTask/d" \
105     -e "/<zipfileset .+\/>/d" \
106     build.xml || die
107    
108     # Delete the bundled JARs but keep invokedynamic.jar.
109     # No source is available and it's only a dummy anyway.
110     find build_lib lib -name "*.jar" ! -name "invokedynamic.jar" -delete || die
111    
112     if ! use bsf; then
113     # Remove BSF test cases.
114     cd "${S}/test/org/jruby"
115     rm -f test/TestAdoptedThreading.java || die
116     rm -f javasupport/test/TestBSF.java || die
117     sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
118     sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
119     fi
120     }
121    
122     src_compile() {
123     eant jar $(use_doc create-apidocs) -Djdk1.5+=true
124     }
125    
126     src_test() {
127     if [ ${UID} == 0 ] ; then
128     ewarn 'The tests will fail if run as root so skipping them.'
129     ewarn 'Enable FEATURES="userpriv" if you want to run them.'
130     return
131     fi
132    
133     # ali_bush was getting crashes while attempting to run a test.
134     # No info about why it crashed seemed to be produced.
135     # remove it as temp fix.
136     sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
137    
138     # BSF is a compile-time only dependency because it's just the adapter
139     # classes and they won't be used unless invoked from BSF itself.
140     use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
141    
142     # Our jruby.jar is unbundled so we need to add the classpath to this test.
143     sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
144    
145     ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
146     }
147    
148     src_install() {
149     local bin
150    
151     java-pkg_dojar lib/${PN}.jar
152     dodoc README docs/{*.txt,README.*} || die
153    
154     use doc && java-pkg_dojavadoc docs/api
155     use source && java-pkg_dosrc src/org
156    
157     dobin "${FILESDIR}/jruby" || die
158     exeinto "/usr/share/${PN}/bin"
159     doexe "${S}/bin/jruby" || die
160    
161     # Install some jruby tools.
162     dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
163    
164     # Symlink some common tools so that jruby can launch them internally.
165     for bin in {j,}gem jirb jrubyc rake rdoc ri spec{,_translator} ; do
166     dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
167     done
168    
169     insinto "${RUBY_HOME}"
170     doins -r "${S}/lib/ruby/1.8" || die
171     doins -r "${S}/lib/ruby/site_ruby" || die
172    
173     # Autoload rubygems and append regular site_ruby to $LOAD_PATH.
174     # Unfortunately the -I option prepends instead.
175     insinto "${SITE_RUBY}"
176     doins "${FILESDIR}/gentoo.rb" || die
177     doenvd "${FILESDIR}/10jruby" || die
178    
179 flameeyes 1.2 keepdir "${GEMS}"/1.8/{cache,doc}
180 ali_bush 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20