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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Jun 30 20:53:35 2010 UTC (4 years ago) by caster
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Cleanup.
(Portage version: 2.2_rc67/cvs/Linux x86_64, RepoMan options: --force)

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

  ViewVC Help
Powered by ViewVC 1.1.20