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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Aug 7 20:40:51 2009 UTC (5 years, 2 months ago) by ali_bush
Branch: MAIN
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.6: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:0 )
35 dev-java/nailgun:0"
36
37 RDEPEND="${CDEPEND}
38 !java6? ( =virtual/jre-1.5* )
39 java6? ( >=virtual/jre-1.6 )"
40
41 # using 1.6 produces 1.6 bytecode, not sure why
42 DEPEND="${CDEPEND}
43 !java6? ( =virtual/jdk-1.5* )
44 java6? ( >=virtual/jdk-1.6 )
45 bsf? ( dev-java/bsf:2.3 )
46 test? (
47 dev-java/ant-junit
48 dev-java/ant-trax
49 )"
50
51 PDEPEND="dev-ruby/rubygems
52 >=dev-ruby/rake-0.7.3
53 >=dev-ruby/rspec-1.0.4
54 ssl? ( dev-ruby/jruby-openssl )"
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"
66 EANT_NEEDS_TOOLS="true"
67
68 pkg_setup() {
69 java-pkg-2_pkg_setup
70 use java6 || EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} backport-util-concurrent"
71
72 local fail
73
74 if [[ -d "${GEMS}" && ! -L "${GEMS}" ]]; then
75 eerror "${GEMS} is a directory. Please remove this directory."
76 fail="true"
77 fi
78
79 # the symlink creates a collision with rubygems, bug #270953
80 # cannot be currently solved by removing in pkg_preinst, bug #233278
81 if [[ -L "${SITE_RUBY}" ]]; then
82 eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
83 fail="true"
84 fi
85
86 if [[ -n ${fail} ]]; then
87 eerror "Unmerging the old jruby version should also fix the problem(s)."
88 die "Please address the above errors, then run emerge --resume"
89 fi
90 }
91
92 java_prepare() {
93 epatch "${FILESDIR}/ftype-test-fixes.patch"
94 epatch "${FILESDIR}/user-test-fixes.patch"
95
96 # We don't need to use Retroweaver. There is a jarjar and a regular jar
97 # target but even with jarjarclean, both are a pain. The latter target
98 # is slightly easier so go with this one.
99 sed -r -i \
100 -e 's/maxmemory="128m"/maxmemory="192m"/' \
101 -e "/RetroWeaverTask/d" \
102 -e "/<zipfileset .+\/>/d" \
103 build.xml || die
104
105 # Delete the bundled JARs but keep invokedynamic.jar.
106 # No source is available and it's only a dummy anyway.
107 find build_lib lib -name "*.jar" ! -name "invokedynamic.jar" -delete || die
108
109 if ! use bsf; then
110 # Remove BSF test cases.
111 cd "${S}/test/org/jruby"
112 rm -f test/TestAdoptedThreading.java || die
113 rm -f javasupport/test/TestBSF.java || die
114 sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
115 sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
116 fi
117 }
118
119 src_compile() {
120 eant jar $(use_doc create-apidocs) -Djdk1.5+=true
121 }
122
123 src_test() {
124 if [ ${UID} == 0 ] ; then
125 ewarn 'The tests will fail if run as root so skipping them.'
126 ewarn 'Enable FEATURES="userpriv" if you want to run them.'
127 return
128 fi
129
130 # BSF is a compile-time only dependency because it's just the adapter
131 # classes and they won't be used unless invoked from BSF itself.
132 use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
133
134 # Our jruby.jar is unbundled so we need to add the classpath to this test.
135 sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
136
137 ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
138 }
139
140 src_install() {
141 local bin
142
143 java-pkg_dojar lib/${PN}.jar
144 dodoc README docs/{*.txt,README.*} || die
145
146 use doc && java-pkg_dojavadoc docs/api
147 use source && java-pkg_dosrc src/org
148
149 dobin "${FILESDIR}/jruby" || die
150 exeinto "/usr/share/${PN}/bin"
151 doexe "${S}/bin/jruby" || die
152
153 # Install some jruby tools.
154 dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
155
156 # Symlink some common tools so that jruby can launch them internally.
157 for bin in {j,}gem jirb jrubyc rake rdoc ri spec{,_translator} ; do
158 dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
159 done
160
161 insinto "${RUBY_HOME}"
162 doins -r "${S}/lib/ruby/1.8" || die
163 doins -r "${S}/lib/ruby/site_ruby" || die
164
165 # Share gems with regular Ruby.
166 dosym /usr/$(get_libdir)/ruby/gems "${GEMS}" || die
167
168 # Autoload rubygems and append regular site_ruby to $LOAD_PATH.
169 # Unfortunately the -I option prepends instead.
170 insinto "${SITE_RUBY}"
171 doins "${FILESDIR}/gentoo.rb" || die
172 doenvd "${FILESDIR}/10jruby" || die
173 }

  ViewVC Help
Powered by ViewVC 1.1.20