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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Dec 22 15:30:47 2013 UTC (8 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Cleanup.

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

1 # Copyright 1999-2013 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.4.1.ebuild,v 1.7 2013/06/14 02:41:48 patrick 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.kenai.com/downloads/${PV}/${PN}-src-${MY_PV}.tar.gz"
14 SRC_URI="http://jruby.org.s3.amazonaws.com/downloads/${PV}/${PN}-src-${MY_PV}.tar.gz"
15 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
16 SLOT="0"
17 KEYWORDS="amd64 x86"
18 IUSE="bsf ssl"
19
20 CDEPEND=">=dev-java/bytelist-1.0.2:0
21 >=dev-java/constantine-0.6:0
22 >=dev-java/jline-0.9.94:0
23 >=dev-java/joni-1.1.3:0
24 >=dev-java/jna-posix-1.0.1:0
25 >=dev-java/jvyamlb-0.2.5:0
26 >=dev-java/asm-3.2:3
27 >=dev-java/jcodings-1.0.4:0
28 >=dev-java/jffi-0.7_pre:0.4
29 dev-java/jna:0
30 dev-java/joda-time:0
31 dev-util/jay:0[java]
32 dev-java/nailgun:0
33 dev-java/jaffl:0
34 dev-java/jgrapht:0"
35
36 RDEPEND="${CDEPEND}
37 >=virtual/jre-1.6"
38
39 DEPEND="${CDEPEND}
40 >=virtual/jdk-1.6
41 bsf? ( dev-java/bsf:2.3 )
42 test? (
43 dev-java/ant-junit
44 dev-java/ant-trax
45 )
46 !!<dev-ruby/jruby-1.3.1-r1"
47
48 PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
49
50 # Tests work for ali_bush. But fail for flameeyes see #282439.
51 # Tests work for ali_bush inside the ebuild env
52 # but fail when using vanilla src tarball.
53 # Restrict tests so we can stablise this package.
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="asm-3 bytelist constantine jay jcodings jffi-0.4 jline \
65 joda-time joni jna jna-posix jvyamlb nailgun jaffl jgrapht"
66 EANT_NEEDS_TOOLS="true"
67
68 pkg_setup() {
69 java-pkg-2_pkg_setup
70
71 local fail
72
73 for directory in "${GEMS}" "${SITE_RUBY}"; do
74 if [[ -L ${directory} ]]; then
75 eerror "${directory} is a symlink. Please do the following to resolve the situation:"
76 echo 'emerge -an app-portage/gentoolkit'
77 echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > ~/jruby.fix'
78 echo 'emerge -1C $(< ~/jruby.fix)'
79 echo "rm ${directory}"
80 echo 'emerge -1 $(< ~/jruby.fix)'
81 echo 'rm ~/jruby.fix'
82
83 eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
84 fail="true"
85 fi
86 done
87
88 if [[ -n ${fail} ]]; then
89 die "Please address the above errors, then run emerge --resume"
90 fi
91 }
92
93 java_prepare() {
94 epatch "${FILESDIR}/ftype-test-fixes.patch"
95 epatch "${FILESDIR}/user-test-fixes.patch"
96 epatch "${FILESDIR}"/${PN}-1.4.0-system-jars-r2.patch
97 epatch "${FILESDIR}"/${PN}-1.4.0-bindir.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 use bsf && java-pkg_jar-from --into build_lib \
116 --build-only bsf-2.3
117
118 if ! use bsf; then
119 # Remove BSF test cases.
120 cd "${S}/test/org/jruby"
121 rm -f test/TestAdoptedThreading.java || die
122 rm -f javasupport/test/TestBSF.java || die
123 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
124 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
125 fi
126 }
127
128 src_compile() {
129 eant jar $(use_doc apidocs) $(use bsf && echo "-Dbsf.present") \
130 -Djdk1.5+=true
131 }
132
133 src_test() {
134 if [ ${UID} == 0 ] ; then
135 ewarn 'The tests will fail if run as root so skipping them.'
136 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
137 return
138 fi
139
140 # ali_bush was getting crashes while attempting to run a test.
141 # No info about why it crashed seemed to be produced.
142 # remove it as temp fix.
143 #sed -i -e '/MRI/d' build.xml || die "Failed to sed build.xml"
144
145 # BSF is a compile-time only dependency because it's just the adapter
146 # classes and they won't be used unless invoked from BSF itself.
147 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
148
149 # Our jruby.jar is unbundled so we need to add the classpath to this test.
150 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
151
152 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
153 }
154
155 src_install() {
156 local bin
157
158 java-pkg_dojar lib/${PN}.jar
159 dodoc README docs/{*.txt,README.*} || die
160
161 use doc && java-pkg_dojavadoc docs/api
162 use source && java-pkg_dosrc src/org
163
164 # We run the sed here in install so that we don't get the wrong
165 # data during the test phase!
166 sed \
167 -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
168 -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
169 bin/jruby > "${T}"/jruby
170
171 dobin "${T}"/jruby "${S}"/bin/j{irb{,_swing},rubyc} || die
172
173 insinto "${RUBY_HOME}"
174 doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die
175
176 # Remove all the references to RubyGems as we're just going to
177 # install it through dev-ruby/rubygems.
178 find "${D}${RUBY_HOME}" -type f \
179 '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
180 -delete || die
181 }
182
183 pkg_postinst() {
184 ewarn "If you're updating from <=jruby-1.4.0, you're going to get errors related"
185 ewarn "to gentoo.rb load failure."
186 ewarn "This is due to a stray definition of JRUBY_OPTS variable from the previous ebuilds."
187 ewarn "To solve the problem, either login in a new shell, use 'env -i ${SHELL} --login'"
188 ewarn "or explicitly unset the variable before running jruby."
189 }

  ViewVC Help
Powered by ViewVC 1.1.20