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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Tue May 13 04:52:49 2014 UTC (5 months, 2 weeks ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Cleanup.

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x8883FA56A308A8D7!)

1 # Copyright 1999-2014 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.6.5.1.ebuild,v 1.5 2014/05/03 21:31:48 tomwij Exp $
4
5 EAPI="4"
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 x86"
17 IUSE="bsf ssl"
18
19 # jffi still needed? Or do we call that jnr-ffi?
20 # jnr-ffi depends on jffi which depends on libffi
21 CDEPEND=">=dev-java/bytelist-1.0.8:0
22 >=dev-java/jline-0.9.94:0
23 >=dev-java/joni-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-1.0.5:0
28 dev-java/jffi:1.0
29 dev-java/jnr-constants:0
30 dev-java/jnr-ffi:0.5
31 dev-java/jnr-posix:1.1
32 dev-java/joda-time:0
33 dev-util/jay:0[java]
34 dev-java/nailgun:0
35 dev-java/jgrapht:0
36 dev-java/ant-core:0
37 dev-java/bsf:2.3
38 dev-java/osgi-core-api:0
39 >=dev-java/snakeyaml-1.9:0"
40
41 RDEPEND="${CDEPEND}
42 >=virtual/jre-1.6"
43
44 # Is jna-posix still needed? Or has that been renamed to jnr-posix?
45 # jna-posix is the original project name which was abononed years ago.
46 # jnr-posix < 1.1.8 are from the original fork
47 # later jnr-posix are from the jnr umbrella project.
48 DEPEND="${CDEPEND}
49 >=virtual/jdk-1.6
50 test? (
51 dev-java/ant-junit4:0
52 dev-java/ant-trax:0
53 dev-java/junit:4
54 java-virtuals/jdk-with-com-sun
55 dev-java/commons-logging:0
56 dev-java/xalan:0
57 )
58 !!<dev-ruby/jruby-1.3.1-r1"
59
60 PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
61
62 # Tests fail.
63 # Need to stop injecting jar's into classpath.
64 RESTRICT="test"
65
66 S="${WORKDIR}/${PN}-${MY_PV}"
67
68 RUBY_HOME=/usr/share/${PN}/lib/ruby
69 SITE_RUBY=${RUBY_HOME}/site_ruby
70 GEMS=${RUBY_HOME}/gems
71
72 JAVA_ANT_REWRITE_CLASSPATH="true"
73 JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
74 EANT_GENTOO_CLASSPATH="ant-core asm-3 bsf-2.3 bytelist jnr-constants jay \
75 jcodings jffi-1.0 jline \
76 joda-time joni jnr-ffi-0.5 jnr-posix-1.1 jnr-netdb jvyamlb nailgun jgrapht osgi-core-api \
77 snakeyaml"
78 EANT_NEEDS_TOOLS="true"
79
80 pkg_setup() {
81 unset RUBYOPT
82 java-pkg-2_pkg_setup
83
84 local fail
85
86 for directory in "${GEMS}" "${SITE_RUBY}"; do
87 if [[ -L ${directory} ]]; then
88 eerror "${directory} is a symlink. Please do the following to resolve the situation:"
89 echo 'emerge -an app-portage/gentoolkit'
90 echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > ~/jruby.fix'
91 echo 'emerge -1C $(< ~/jruby.fix)'
92 echo "rm ${directory}"
93 echo 'emerge -1 $(< ~/jruby.fix)'
94 echo 'rm ~/jruby.fix'
95
96 eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
97 fail="true"
98 fi
99 done
100
101 if [[ -n ${fail} ]]; then
102 die "Please address the above errors, then run emerge --resume"
103 fi
104 }
105
106 java_prepare() {
107 epatch "${FILESDIR}"/${PN}-bash-launcher.patch
108 epatch "${FILESDIR}/1.5.1/build.xml.patch"
109
110 # We don't need to use Retroweaver. There is a jarjar and a regular jar
111 # target but even with jarjarclean, both are a pain. The latter target
112 # is slightly easier so go with this one.
113 sed -r -i \
114 -e 's/maxmemory="128m"/maxmemory="192m"/' \
115 -e "/RetroWeaverTask/d" \
116 -e "/yecht/! { /<zipfileset .+\/>/d }" \
117 build.xml || die
118
119 sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
120
121 # Delete the bundled JARs but keep invokedynamic.jar.
122 # No source is available and it's only a dummy anyway.
123 find build_lib -name "*.jar" ! -name "jsr292-mock.jar" ! -name "yecht.jar" -delete || die
124 }
125
126 src_compile() {
127 # Avoid generating the ri cache since that currently fails.
128 local flags="-Dgenerate-ri-cache.hasrun=true"
129 #local flags=""
130 use bsf && flags+=" -Dbsf.present=true"
131
132 export RUBYOPT=""
133 einfo $RUBYOPT
134 #eant jar $(use_doc apidocs) -Djdk1.5+=true ${flags}
135 eant -Djdk1.5+=true ${flags}
136 }
137
138 src_test() {
139 if [ ${UID} == 0 ] ; then
140 ewarn 'The tests will fail if run as root so skipping them.'
141 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
142 return
143 fi
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 sed -i "s@:refid => 'build.classpath'@:path =>\"#{ENV['JRUBY_CP']}:lib/jruby.jar\"@g" \
147 rakelib/commands.rake || die
148 #sed -i "s@:refid => 'test.class.path'@:path => \"#{ENV['JRUBY_CP']}@g" \
149 # rakelib/commands.rake || die
150
151 #bsf optionally depends on jruby, which means that the previously
152 #installed jruby will be added to classpath, nasty things will happen.
153 local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
154 cpath="$(echo ${cpath} | sed -e "s_${ROOT}/usr/share/jruby/lib/jruby.jar:__g")"
155 cpath="${cpath}:$(java-pkg_getjars --build-only commons-logging,xalan)"
156 EANT_GENTOO_CLASSPATH=""
157
158 local flags=""
159 use bsf && flags="-Dbsf.present=true"
160
161 #Clear RUBYOPT
162 export RUBYOPT=""
163 export JRUBY_CP="${cpath}"
164 ANT_TASKS="ant-junit4 ant-trax" \
165 JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
166 -Dgentoo.classpath="${cpath}" ${flags}
167 }
168
169 src_install() {
170 java-pkg_dojar lib/${PN}.jar
171 dodoc README docs/{*.txt,README.*} || die
172
173 use doc && java-pkg_dojavadoc docs/api
174 use source && java-pkg_dosrc src/org
175
176 # Use the bash based launcher to preserve whitespace in arguments.
177 # Ie allow >jruby -e "puts 'hello'"< to work otherwise
178 # >jruby -e "\"puts 'hello'\""< is needed.
179 #
180 # # We run the sed here in install so that we don't get the wrong
181 # # data during the test phase!
182 # sed \
183 # -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
184 # -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
185 # bin/jruby.sh > "${T}"/jruby
186
187 newbin bin/jruby.bash jruby
188 dobin bin/j{irb{,_swing},rubyc}
189
190 insinto "${RUBY_HOME}"
191 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby}
192
193 # Remove all the references to RubyGems as we're just going to
194 # install it through dev-ruby/rubygems.
195 find "${D}${RUBY_HOME}" -type f \
196 '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
197 -delete || die
198 }

  ViewVC Help
Powered by ViewVC 1.1.20