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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun May 24 16:16:41 2009 UTC (5 years, 6 months ago) by mr_bones_
Branch: MAIN
Changes since 1.2: +1 -2 lines
whitespace
(Portage version: 2.1.6.11/cvs/Linux i686)

1 # Copyright 1999-2009 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.2.0-r1.ebuild,v 1.2 2009/05/23 23:02:21 caster Exp $
4
5 EAPI="2"
6 JAVA_PKG_IUSE="doc source test"
7 inherit eutils java-pkg-2 java-ant-2
8
9 DESCRIPTION="Java-based Ruby interpreter implementation"
10 HOMEPAGE="http://jruby.codehaus.org/"
11 SRC_URI="http://dist.codehaus.org/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
12 LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="bsf java6 ssl"
16
17 CDEPEND=">=dev-java/bytelist-1.0.2:0
18 >=dev-java/constantine-0.5:0
19 >=dev-java/jline-0.9.94:0
20 >=dev-java/joni-1.1.3:0
21 >=dev-java/jna-posix-1.0:0
22 >=dev-java/jvyamlb-0.2.5:0
23 dev-java/asm:3
24 dev-java/jcodings:0
25 dev-java/jffi:0
26 dev-java/jna:0
27 dev-java/joda-time:0
28 dev-util/jay:0[java]
29 !java6? ( dev-java/backport-util-concurrent )"
30
31 RDEPEND="${CDEPEND}
32 !java6? ( =virtual/jre-1.5* )
33 java6? ( >=virtual/jre-1.6 )"
34
35 # using 1.6 produces 1.6 bytecode, not sure why
36 DEPEND="${CDEPEND}
37 !java6? ( =virtual/jdk-1.5* )
38 java6? ( >=virtual/jdk-1.6 )
39 bsf? ( dev-java/bsf:2.3 )
40 test? (
41 dev-java/ant-junit
42 dev-java/ant-trax
43 )"
44
45 PDEPEND="dev-ruby/rubygems
46 >=dev-ruby/rake-0.7.3
47 >=dev-ruby/rspec-1.0.4
48 ssl? ( dev-ruby/jruby-openssl )"
49
50 RUBY_HOME=/usr/share/${PN}/lib/ruby
51 SITE_RUBY=${RUBY_HOME}/site_ruby
52 GEMS=${RUBY_HOME}/gems
53
54 JAVA_ANT_REWRITE_CLASSPATH="true"
55 JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
56 EANT_GENTOO_CLASSPATH="asm-3 bytelist constantine jay jcodings jffi jline joda-time joni jna jna-posix jvyamlb"
57 EANT_NEEDS_TOOLS="true"
58
59 pkg_setup() {
60 java-pkg-2_pkg_setup
61 use java6 || EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} backport-util-concurrent"
62
63 local fail
64
65 if [[ -d "${GEMS}" && ! -L "${GEMS}" ]]; then
66 eerror "${GEMS} is a directory. Please remove this directory."
67 fail="true"
68 fi
69
70 # the symlink creates a collision with rubygems, bug #270953
71 # cannot be currently solved by removing in pkg_preinst, bug #233278
72 if [[ -L "${SITE_RUBY}" ]]; then
73 eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
74 fail="true"
75 fi
76
77 if [[ -n ${fail} ]]; then
78 eerror "Unmerging the old jruby version should also fix the problem(s)."
79 die "Please address the above errors, then run emerge --resume"
80 fi
81 }
82
83 java_prepare() {
84 epatch "${FILESDIR}/ftype-test-fixes.patch"
85 epatch "${FILESDIR}/user-test-fixes.patch"
86
87 # We don't need to use Retroweaver. There is a jarjar and a regular jar
88 # target but even with jarjarclean, both are a pain. The latter target
89 # is slightly easier so go with this one.
90 sed -r -i \
91 -e 's/maxmemory="128m"/maxmemory="192m"/' \
92 -e "/RetroWeaverTask/d" \
93 -e "/<zipfileset .+\/>/d" \
94 build.xml || die
95
96 # Delete the bundled JARs but keep invokedynamic.jar.
97 # No source is available and it's only a dummy anyway.
98 find build_lib lib -name "*.jar" ! -name "invokedynamic.jar" -delete || die
99
100 if ! use bsf; then
101 # Remove BSF test cases.
102 cd "${S}/test/org/jruby"
103 rm -f test/TestAdoptedThreading.java || die
104 rm -f javasupport/test/TestBSF.java || die
105 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
106 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
107 fi
108 }
109
110 src_compile() {
111 eant jar $(use_doc create-apidocs) -Djdk1.5+=true
112 }
113
114 src_test() {
115 if [ ${UID} == 0 ] ; then
116 ewarn 'The tests will fail if run as root so skipping them.'
117 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
118 return
119 fi
120
121 # BSF is a compile-time only dependency because it's just the adapter
122 # classes and they won't be used unless invoked from BSF itself.
123 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
124
125 # Our jruby.jar is unbundled so we need to add the classpath to this test.
126 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
127
128 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
129 }
130
131 src_install() {
132 local bin
133
134 java-pkg_dojar lib/${PN}.jar
135 dodoc README docs/{*.txt,README.*} || die
136
137 use doc && java-pkg_dojavadoc docs/api
138 use source && java-pkg_dosrc src/org
139
140 dobin "${FILESDIR}/jruby" || die
141 exeinto "/usr/share/${PN}/bin"
142 doexe "${S}/bin/jruby" || die
143
144 # Install some jruby tools.
145 dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
146
147 # Symlink some common tools so that jruby can launch them internally.
148 for bin in {j,}gem jirb jrubyc rake rdoc ri spec{,_translator} ; do
149 dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
150 done
151
152 insinto "${RUBY_HOME}"
153 doins -r "${S}/lib/ruby/1.8" || die
154 doins -r "${S}/lib/ruby/site_ruby" || die
155
156 # Share gems with regular Ruby.
157 dosym /usr/$(get_libdir)/ruby/gems "${GEMS}" || die
158
159 # Autoload rubygems and append regular site_ruby to $LOAD_PATH.
160 # Unfortunately the -I option prepends instead.
161 insinto "${SITE_RUBY}"
162 doins "${FILESDIR}/gentoo.rb" || die
163 doenvd "${FILESDIR}/10jruby" || die
164 }

  ViewVC Help
Powered by ViewVC 1.1.20