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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sun Apr 29 04:50:00 2012 UTC (2 years, 7 months ago) by flameeyes
Branch: MAIN
Version bump, now that jzlib is in tree.

(Portage version: 2.2.0_alpha101/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20