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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Dec 17 13:58:17 2007 UTC (6 years, 9 months ago) by caleb
Branch: MAIN
version bump, with a few dep changes.  See bug #190124
(Portage version: 2.1.3.16)

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

  ViewVC Help
Powered by ViewVC 1.1.20