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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Jun 22 22:08:33 2010 UTC (4 years, 4 months ago) by flameeyes
Branch: MAIN
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 flameeyes 1.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    
99     # We don't need to use Retroweaver. There is a jarjar and a regular jar
100     # target but even with jarjarclean, both are a pain. The latter target
101     # is slightly easier so go with this one.
102     sed -r -i \
103     -e 's/maxmemory="128m"/maxmemory="192m"/' \
104     -e "/RetroWeaverTask/d" \
105     -e "/<zipfileset .+\/>/d" \
106     build.xml || die
107    
108     sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
109    
110     # Delete the bundled JARs but keep invokedynamic.jar.
111     # No source is available and it's only a dummy anyway.
112     find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
113     rm lib/profile.jar || die
114    
115     # change some defaults for Gentoo to work properly
116     cat - >> src/org/jruby/jruby.properties <<EOF
117     jruby.bindir = /usr/bin
118     EOF
119     }
120    
121     src_compile() {
122     eant jar $(use_doc apidocs) -Djdk1.5+=true
123     }
124    
125     src_test() {
126     if [ ${UID} == 0 ] ; then
127     ewarn 'The tests will fail if run as root so skipping them.'
128     ewarn 'Enable FEATURES="userpriv" if you want to run them.'
129     return
130     fi
131    
132     mkdir -p usr
133    
134     ln -s "${S}/bin" "${S}/usr/bin"
135    
136     # TODO check this.
137     # ali_bush was getting crashes while attempting to run a test.
138     # No info about why it crashed seemed to be produced.
139     # remove it as temp fix.
140     #sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
141    
142     # Our jruby.jar is unbundled so we need to add the classpath to this test.
143     sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
144    
145     #bsf optionally depends on jruby, which means that the previously
146     #installed jruby will be added to classpath, nasty things will happen.
147     local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
148     cpath="$(echo ${cpath} | sed -e "s_${ROOT}/usr/share/jruby/lib/jruby.jar:__g")"
149     EANT_GENTOO_CLASSPATH=""
150     ANT_TASKS="ant-junit4 ant-trax" \
151     JRUBY_CP="${cpath}" \
152     JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
153     -Dgentoo.classpath="${cpath}"
154     }
155    
156     src_install() {
157     local bin
158    
159     java-pkg_dojar lib/${PN}.jar
160     dodoc README docs/{*.txt,README.*} || die
161    
162     use doc && java-pkg_dojavadoc docs/api
163     use source && java-pkg_dosrc src/org
164    
165     # We run the sed here in install so that we don't get the wrong
166     # data during the test phase!
167     sed \
168     -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
169     -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
170     bin/jruby > "${T}"/jruby
171    
172     dobin "${T}"/jruby "${S}"/bin/j{irb{,_swing},rubyc} || die
173    
174     insinto "${RUBY_HOME}"
175     doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
176    
177     # Remove all the references to RubyGems as we're just going to
178     # install it through dev-ruby/rubygems.
179     find "${D}${RUBY_HOME}" -type f \
180     '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
181     -delete || die
182     }
183    
184     pkg_postinst() {
185     ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
186     ewarn "to gentoo.rb load failure."
187     ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
188     ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
189     ewarn "or explicitly unset the variable before running jruby."
190     }

  ViewVC Help
Powered by ViewVC 1.1.20