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

Contents of /dev-java/jruby/jruby-1.5.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jun 22 22:08:33 2010 UTC (4 years, 6 months ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Fix bindir definition, or rather workaround since the properties don't seem to get respected from the file.
(Portage version: 2.2_rc67/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.5.1.ebuild,v 1.1 2010/06/19 11:07:14 ali_bush 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.org.s3.amazonaws.com/downloads/${PV}/${PN}-src-${PV}.tar.gz"
14 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
15 SLOT="0"
16 KEYWORDS="~amd64"
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/jnr-posix-1.1.3:0
24 >=dev-java/jnr-netdb-1.0:0
25 >=dev-java/jvyamlb-0.2.5:0
26 >=dev-java/asm-3.2:3
27 dev-java/jcodings:0
28 >=dev-java/jffi-0.7_pre:0.4
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 dev-java/ant-core:0
35 dev-java/bsf:2.3"
36
37 RDEPEND="${CDEPEND}
38 >=virtual/jre-1.6"
39
40 DEPEND="${CDEPEND}
41 >=virtual/jdk-1.6
42 test? (
43 dev-java/ant-junit4:0
44 dev-java/ant-trax:0
45 dev-java/junit:4
46 java-virtuals/jdk-with-com-sun
47 )
48 !!<dev-ruby/jruby-1.3.1-r1"
49
50 PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
51
52 # Tests fail completely.
53 # Complaining about missing auto_gem
54 RESTRICT="test"
55
56 S="${WORKDIR}/${PN}-${MY_PV}"
57
58 RUBY_HOME=/usr/share/${PN}/lib/ruby
59 SITE_RUBY=${RUBY_HOME}/site_ruby
60 GEMS=${RUBY_HOME}/gems
61
62 JAVA_ANT_REWRITE_CLASSPATH="true"
63 JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
64 EANT_GENTOO_CLASSPATH="ant-core asm-3 bsf-2.3 bytelist constantine jay \
65 jcodings jffi-0.4 jline constantine \
66 joda-time joni jnr-posix jnr-netdb jvyamlb nailgun jaffl jgrapht"
67 EANT_NEEDS_TOOLS="true"
68
69 pkg_setup() {
70 java-pkg-2_pkg_setup
71
72 local fail
73
74 for directory in "${GEMS}" "${SITE_RUBY}"; do
75 if [[ -L ${directory} ]]; then
76 eerror "${directory} is a symlink. Please do the following to resolve the situation:"
77 echo 'emerge -an app-portage/gentoolkit'
78 echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > ~/jruby.fix'
79 echo 'emerge -1C $(< ~/jruby.fix)'
80 echo "rm ${directory}"
81 echo 'emerge -1 $(< ~/jruby.fix)'
82 echo 'rm ~/jruby.fix'
83
84 eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
85 fail="true"
86 fi
87 done
88
89 if [[ -n ${fail} ]]; then
90 die "Please address the above errors, then run emerge --resume"
91 fi
92 }
93
94 java_prepare() {
95 #epatch "${FILESDIR}/ftype-test-fixes.patch"
96 #epatch "${FILESDIR}/user-test-fixes.patch"
97 epatch "${FILESDIR}"/${PN}-1.5.0-system-jars.patch
98 epatch "${FILESDIR}"/${PN}-1.5.0-bindir.patch
99
100 # We don't need to use Retroweaver. There is a jarjar and a regular jar
101 # target but even with jarjarclean, both are a pain. The latter target
102 # is slightly easier so go with this one.
103 sed -r -i \
104 -e 's/maxmemory="128m"/maxmemory="192m"/' \
105 -e "/RetroWeaverTask/d" \
106 -e "/<zipfileset .+\/>/d" \
107 build.xml || die
108
109 sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
110
111 # Delete the bundled JARs but keep invokedynamic.jar.
112 # No source is available and it's only a dummy anyway.
113 find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
114 rm lib/profile.jar || die
115 }
116
117 src_compile() {
118 eant jar $(use_doc apidocs) -Djdk1.5+=true
119 }
120
121 src_test() {
122 if [ ${UID} == 0 ] ; then
123 ewarn 'The tests will fail if run as root so skipping them.'
124 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
125 return
126 fi
127
128 mkdir -p usr
129
130 ln -s "${S}/bin" "${S}/usr/bin"
131
132 # TODO check this.
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 # Our jruby.jar is unbundled so we need to add the classpath to this test.
139 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
140
141 #bsf optionally depends on jruby, which means that the previously
142 #installed jruby will be added to classpath, nasty things will happen.
143 local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
144 cpath="$(echo ${cpath} | sed -e "s_${ROOT}/usr/share/jruby/lib/jruby.jar:__g")"
145 EANT_GENTOO_CLASSPATH=""
146 ANT_TASKS="ant-junit4 ant-trax" \
147 JRUBY_CP="${cpath}" \
148 JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
149 -Dgentoo.classpath="${cpath}"
150 }
151
152 src_install() {
153 local bin
154
155 java-pkg_dojar lib/${PN}.jar
156 dodoc README docs/{*.txt,README.*} || die
157
158 use doc && java-pkg_dojavadoc docs/api
159 use source && java-pkg_dosrc src/org
160
161 # We run the sed here in install so that we don't get the wrong
162 # data during the test phase!
163 sed \
164 -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
165 -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
166 bin/jruby > "${T}"/jruby
167
168 dobin "${T}"/jruby "${S}"/bin/j{irb{,_swing},rubyc} || die
169
170 insinto "${RUBY_HOME}"
171 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
172
173 # Remove all the references to RubyGems as we're just going to
174 # install it through dev-ruby/rubygems.
175 find "${D}${RUBY_HOME}" -type f \
176 '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
177 -delete || die
178 }
179
180 pkg_postinst() {
181 ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
182 ewarn "to gentoo.rb load failure."
183 ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
184 ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
185 ewarn "or explicitly unset the variable before running jruby."
186 }

  ViewVC Help
Powered by ViewVC 1.1.20