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

Contents of /dev-java/jruby/jruby-1.0.0_rc3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Jul 11 19:58:37 2007 UTC (7 years, 2 months ago) by mr_bones_
Branch: MAIN
Changes since 1.1: +1 -2 lines
whitespace
(Portage version: 2.1.2.9)

1 nichoj 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 mr_bones_ 1.2 # $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.0.0_rc3.ebuild,v 1.1 2007/06/05 11:55:28 nichoj Exp $
4 nichoj 1.1
5     JAVA_PKG_IUSE="doc source test"
6     inherit eutils java-pkg-2 java-ant-2
7    
8     MY_PV="${PV/_rc/RC}"
9     MY_P="${PN}-${MY_PV}"
10    
11     DESCRIPTION="Java based ruby interpreter implementation"
12     HOMEPAGE="http://jruby.codehaus.org/"
13     SRC_URI="http://dist.codehaus.org/${PN}/${PN}-src-${MY_PV}.tar.gz"
14    
15     LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
16     SLOT="0"
17     KEYWORDS="~amd64 ~ppc ~x86"
18     IUSE="bsf"
19    
20     COMMON_DEPEND=">=dev-java/jline-0.9.91
21     =dev-java/asm-2.2*
22     dev-java/backport-util-concurrent
23     !<dev-java/jruby-1.0.0_rc2-r1"
24     RDEPEND=">=virtual/jre-1.4
25     ${COMMON_DEPEND}"
26     # FIXME doesn't quite compile correctly with 1.6
27     DEPEND="|| ( =virtual/jdk-1.5* =virtual/jdk-1.4* )
28     bsf? ( >=dev-java/bsf-2.3 )
29     test? (
30     =dev-java/junit-3*
31     dev-java/ant-junit
32     dev-java/ant-trax
33     )
34     ${COMMON_DEPEND}"
35     PDEPEND="dev-ruby/rubygems
36     >=dev-ruby/rake-0.7.3
37     >=dev-ruby/rspec-1.0.4"
38    
39     S="${WORKDIR}/${MY_P}"
40    
41     RUBY_HOME=/usr/share/${PN}/lib/ruby
42     SITE_RUBY=${RUBY_HOME}/site_ruby
43     GEMS=${RUBY_HOME}/gems
44    
45     pkg_setup() {
46     java-pkg-2_pkg_setup
47    
48     if [[ -d ${SITE_RUBY} && ! -L ${SITE_RUBY} ]]; then
49     ewarn "dev-java/jruby now uses dev-lang/ruby's site_ruby directory by creating symlinks."
50     ewarn "${SITE_RUBY} is a directory right now, which will cause problems when being merged onto the filesystem."
51     fi
52     if [[ -d ${GEMS} && ! -L ${GEMS} ]]; then
53     ewarn "dev-java/jruby now uses dev-lang/ruby's gems directory by creating symlinks."
54     ewarn "${GEMS} is a directory right now, which will cause problems when being merged onto the filesystem."
55     fi
56    
57     # only use javac, see http://jira.codehaus.org/browse/JRUBY-675
58     java-pkg_force-compiler javac
59     }
60    
61     src_unpack() {
62     unpack ${A}
63     cd ${S}
64     # prevents /root/.jruby being created at build time with
65     # FEATURES="-userpriv"
66     # see http://bugs.gentoo.org/show_bug.cgi?id=170058
67     epatch ${FILESDIR}/${PN}-0.9.8-sandbox.patch
68     # search only lib, kills jdk1.4+ property which we set manually
69     java-ant_ignore-system-classes
70    
71     cd ${S}/lib
72     rm -v *.jar || die
73    
74     java-pkg_jar-from --build-only ant-core ant.jar
75     java-pkg_jar-from asm-2.2 asm.jar
76     java-pkg_jar-from asm-2.2 asm-commons.jar
77     java-pkg_jar-from jline
78     java-pkg_jar-from backport-util-concurrent
79     use test && java-pkg_jar-from --build-only junit
80    
81     # build-only because it's just BSF adapter classes and won't be used
82     # unless invoked from bsf itself, so no need to pollute classpath
83     if use bsf; then
84     java-pkg_jar-from --build-only bsf-2.3
85     else
86     cd ${S}
87     # testcases depending on bsf
88     rm test/org/jruby/test/TestAdoptedThreading.java || die
89     rm test/org/jruby/javasupport/test/TestBSF.java || die
90     sed -i -e '/TestBSF.class/d' \
91     test/org/jruby/javasupport/test/JavaSupportTestSuite.java || die
92     sed -i -e '/TestAdoptedThreading.class/d' \
93     test/org/jruby/test/MainTestSuite.java || die
94     fi
95     }
96    
97     src_compile() {
98     eant jar $(use_doc create-apidocs) -Djruby.home=${T}/.jruby -Djdk1.4+=true
99     }
100    
101     src_test() {
102     # needs bsf's runtime deps to work
103     use bsf && java-pkg_jar-from --into lib --with-dependencies bsf-2.3
104     ANT_TASKS="ant-junit ant-trax" eant test -Djdk1.4+=true
105     }
106    
107     src_install() {
108     java-pkg_dojar lib/${PN}.jar
109    
110     dodoc README docs/{*.txt,README.*,BeanScriptingFramework} || die
111     dohtml docs/getting_involved.html || die
112    
113     if use doc; then
114     java-pkg_dojavadoc docs/api
115     fi
116     use source && java-pkg_dosrc src/org
117     java-pkg_dolauncher ${PN} \
118     --main 'org.jruby.Main' \
119     --java_args '-Djruby.base=/usr/share/jruby -Djruby.home=/usr/share/jruby -Djruby.lib=/usr/share/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh'
120     dobin ${S}/bin/jirb
121    
122     dodir "/usr/share/${PN}/lib"
123     insinto "/usr/share/${PN}/lib"
124     doins -r "${S}/lib/ruby"
125    
126     # Share gems with regular ruby
127     rm -r ${D}/usr/share/${PN}/lib/ruby/gems || die
128     dosym /usr/lib/ruby/gems /usr/share/${PN}/lib/ruby/gems || die
129    
130     # Share site_ruby with regular ruby
131     rm -r ${D}/usr/share/${PN}/lib/ruby/site_ruby || die
132     dosym /usr/lib/ruby/site_ruby /usr/share/${PN}/lib/ruby/site_ruby || die
133     }
134    
135     pkg_preinst() {
136     local bad_directory=0
137    
138     if [[ -d ${SITE_RUBY} && ! -L ${SITE_RUBY} ]]; then
139     eerror "${SITE_RUBY} is a directory. Please move this directory out of the way, and then emerge --resume."
140     bad_directory=1
141     fi
142    
143     if [[ -d ${GEMS} && ! -L ${GEMS} ]]; then
144     eerror "${GEMS} is a directory. Please move this directory out of the way, and then emerge --resume."
145     bad_directory=1
146     fi
147    
148     if [[ ! ${bad_directory} ]]; then
149     die "Please address the above errors, then emerge --resume."
150     fi
151     }

  ViewVC Help
Powered by ViewVC 1.1.20