/[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.1 - (hide annotations) (download)
Sat May 23 08:03:46 2009 UTC (5 years, 9 months ago) by caster
Branch: MAIN
Version bump, bug #217388. Fixes also #184375 and #213391. Many thanks to James Le Cuirot <chewi@aura-online.co.uk> and ali_bush. The ppc keyword dropped due to new deps.
(Portage version: 2.2_rc33/cvs/Linux x86_64)

1 caster 1.1 # Copyright 1999-2009 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
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     if [[ -d "${GEMS}" && ! -L "${GEMS}" ]]; then
64     ewarn "dev-java/jruby now uses dev-lang/ruby's gems directory by creating symlinks."
65     ewarn "${GEMS} is a directory right now, which will cause problems when being merged onto the filesystem."
66     fi
67     }
68    
69     java_prepare() {
70     epatch "${FILESDIR}/ftype-test-fixes.patch"
71     epatch "${FILESDIR}/user-test-fixes.patch"
72    
73     # We don't need to use Retroweaver. There is a jarjar and a regular jar
74     # target but even with jarjarclean, both are a pain. The latter target
75     # is slightly easier so go with this one.
76     sed -r -i \
77     -e 's/maxmemory="128m"/maxmemory="192m"/' \
78     -e "/RetroWeaverTask/d" \
79     -e "/<zipfileset .+\/>/d" \
80     build.xml || die
81    
82     # Delete the bundled JARs but keep invokedynamic.jar.
83     # No source is available and it's only a dummy anyway.
84     find build_lib lib -name "*.jar" ! -name "invokedynamic.jar" -delete || die
85    
86     if ! use bsf; then
87     # Remove BSF test cases.
88     cd "${S}/test/org/jruby"
89     rm -f test/TestAdoptedThreading.java || die
90     rm -f javasupport/test/TestBSF.java || die
91     sed -i '/TestBSF.class/d' javasupport/test/JavaSupportTestSuite.java || die
92     sed -i '/TestAdoptedThreading.class/d' test/MainTestSuite.java || die
93     fi
94     }
95    
96     src_compile() {
97     eant jar $(use_doc create-apidocs) -Djdk1.5+=true
98     }
99    
100     src_test() {
101     if [ ${UID} == 0 ] ; then
102     ewarn 'The tests will fail if run as root so skipping them.'
103     ewarn 'Enable FEATURES="userpriv" if you want to run them.'
104     return
105     fi
106    
107     # BSF is a compile-time only dependency because it's just the adapter
108     # classes and they won't be used unless invoked from BSF itself.
109     use bsf && java-pkg_jar-from --into build_lib --with-dependencies bsf-2.3
110    
111     # Our jruby.jar is unbundled so we need to add the classpath to this test.
112     sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" test/test_load_compiled_ruby_class_from_classpath.rb || die
113    
114     ANT_TASKS="ant-junit ant-trax" JRUBY_CP=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,}` JRUBY_OPTS="" eant test -Djdk1.5+=true
115     }
116    
117     src_install() {
118     local bin
119    
120     java-pkg_dojar lib/${PN}.jar
121     dodoc README docs/{*.txt,README.*} || die
122    
123     use doc && java-pkg_dojavadoc docs/api
124     use source && java-pkg_dosrc src/org
125    
126     dobin "${FILESDIR}/jruby" || die
127     exeinto "/usr/share/${PN}/bin"
128     doexe "${S}/bin/jruby" || die
129    
130     # Install some jruby tools.
131     dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
132    
133     # Symlink some common tools so that jruby can launch them internally.
134     for bin in {j,}gem jirb jrubyc rake rdoc ri spec{,_translator} ; do
135     dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
136     done
137    
138     insinto "${RUBY_HOME}"
139     doins -r "${S}/lib/ruby/1.8" || die
140     doins -r "${S}/lib/ruby/site_ruby" || die
141    
142     # Share gems with regular Ruby.
143     dosym /usr/$(get_libdir)/ruby/gems "${GEMS}" || die
144    
145     # Autoload rubygems and append regular site_ruby to $LOAD_PATH.
146     # Unfortunately the -I option prepends instead.
147     insinto "${SITE_RUBY}"
148     doins "${FILESDIR}/gentoo.rb" || die
149     doenvd "${FILESDIR}/10jruby" || die
150     }
151    
152     pkg_preinst() {
153     if [[ -d "${GEMS}" && ! -L "${GEMS}" ]]; then
154     eerror "${GEMS} is a directory. Please move this directory out of the way, and then emerge --resume."
155     die "Please address the above errors, then emerge --resume."
156     fi
157    
158     # Delete site_ruby if it is a symlink.
159     [[ -L "${SITE_RUBY}" ]] && rm -f "${SITE_RUBY}"
160     }

  ViewVC Help
Powered by ViewVC 1.1.20