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

Contents of /dev-java/jruby/jruby-1.6.8-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Mar 3 23:39:57 2014 UTC (6 months, 2 weeks ago) by pacho
Branch: MAIN
Changes since 1.2: +2 -2 lines
amd64 stable, bug #495016

(Portage version: 2.2.8-r1/cvs/Linux x86_64, RepoMan options: --include-arches="amd64", signed Manifest commit with key A188FBD4)

1 phajdan.jr 1.2 # Copyright 1999-2014 Gentoo Foundation
2 tomwij 1.1 # Distributed under the terms of the GNU General Public License v2
3 pacho 1.3 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.6.8-r1.ebuild,v 1.2 2014/02/24 02:17:30 phajdan.jr Exp $
4 tomwij 1.1
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 pacho 1.3 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~x86-macos"
17 tomwij 1.1 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-1.0: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.3.1: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-1.6: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
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-1.9 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}"/${P}-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     }
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_${EROOT}/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 "${ED}${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