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

Contents of /dev-java/jruby/jruby-1.0.0_rc2-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Fri Aug 3 16:41:00 2007 UTC (7 years, 2 months ago) by betelgeuse
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Removed old versions.
(Portage version: 2.1.3_rc9)

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

  ViewVC Help
Powered by ViewVC 1.1.20