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

Contents of /dev-java/jruby/jruby-1.3.0_rc1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Fri Aug 7 20:40:51 2009 UTC (5 years, 1 month ago) by ali_bush
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump and cleanup rc.
(Portage version: 2.1.6.13/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20