/[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.1 - (hide annotations) (download)
Thu May 24 18:49:04 2007 UTC (7 years, 4 months ago) by nichoj
Branch: MAIN
Now uses dev-lang/ruby\'s site_ruby and gems directory. This is accomplished by using symlinks. Because the package manager doesn\'t handle directories changing into symlinks well, we now block older versions of jruby, and there are appropriate warnings and errors if you have these older directories on your system. Also now has a post-dependency on rubygems, so there is no longer a need for jgem and company.
(Portage version: 2.1.2.3)

1 nichoj 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_rc2.ebuild,v 1.1 2007/05/18 20:31:27 nichoj Exp $
4    
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="doc source test"
19    
20     COMMON_DEPEND=">=dev-java/jline-0.9.91
21     =dev-java/asm-2.2*
22     >=dev-java/bsf-2.3
23     dev-java/backport-util-concurrent
24     !<dev-java/jruby-1.0.0_rc2-r1"
25     RDEPEND=">=virtual/jre-1.4
26     ${COMMON_DEPEND}"
27     DEPEND=">=virtual/jdk-1.4
28     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     EANT_DOC_TARGET="create-apidocs"
39    
40     # only use javac, see http://jira.codehaus.org/browse/JRUBY-675
41     JAVA_PKG_FILTER_COMPILER="ecj-3.2 ecj-3.1 jikes"
42    
43     RUBY_HOME=/usr/share/${PN}/lib/ruby
44     SITE_RUBY=${RUBY_HOME}/site_ruby
45     GEMS=${RUBY_HOME}/gems
46    
47     pkg_setup() {
48     java-pkg-2_pkg_setup
49    
50     if [[ -d ${SITE_RUBY} ]]; then
51     ewarn "dev-java/jruby now uses dev-lang/ruby's site_ruby directory by creating symlinks."
52     ewarn "${SITE_RUBY} is a directory right now, which will cause problems when being merged onto the filesystem."
53     fi
54     if [[ -d ${GEMS} ]]; then
55     ewarn "dev-java/jruby now uses dev-lang/ruby's gems directory by creating symlinks."
56     ewarn "${GEMS} is a directory right now, which will cause problems when being merged onto the filesystem."
57     fi
58     }
59    
60     src_unpack() {
61     unpack ${A}
62     cd ${S}
63     # prevents /root/.jruby being created at build time with
64     # FEATURES="-userpriv"
65     # see http://bugs.gentoo.org/show_bug.cgi?id=170058
66     epatch ${FILESDIR}/${PN}-0.9.8-sandbox.patch
67    
68     cd ${S}/lib
69     rm *.jar
70    
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 bsf-2.3
75     java-pkg_jar-from jline
76     java-pkg_jar-from backport-util-concurrent
77     use test && java-pkg_jar-from --build-only junit
78     }
79    
80     src_compile() {
81     eant jar $(use_doc create-apidocs) -Djruby.home=${T}/.jruby
82     }
83    
84     src_install() {
85     java-pkg_dojar lib/${PN}.jar
86    
87     dodoc README docs/{*.txt,README.*,BeanScriptingFramework} || die
88     dohtml docs/getting_involved.html || die
89    
90     if use doc; then
91     java-pkg_dojavadoc docs/api
92     fi
93     use source && java-pkg_dosrc src/org
94     java-pkg_dolauncher ${PN} \
95     --main 'org.jruby.Main' \
96     --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'
97     dobin ${S}/bin/jirb
98    
99     dodir "/usr/share/${PN}/lib"
100     insinto "/usr/share/${PN}/lib"
101     doins -r "${S}/lib/ruby"
102    
103     # Share gems with regular ruby
104     rm -r ${D}/usr/share/${PN}/lib/ruby/gems || die
105     dosym /usr/lib/ruby/gems /usr/share/${PN}/lib/ruby/gems || die
106    
107     # Share site_ruby with regular ruby
108     rm -r ${D}/usr/share/${PN}/lib/ruby/site_ruby || die
109     dosym /usr/lib/ruby/site_ruby /usr/share/${PN}/lib/ruby/site_ruby || die
110     }
111    
112     pkg_preinst() {
113     if [[ -d ${SITE_RUBY} || -d ${GEMS} ]]; then
114     if [[ -d ${SITE_RUBY} ]]; then
115     eerror "${SITE_RUBY} is a directory. Please move this directory out of the way, and then emerge --resume."
116     fi
117     if [[ -d ${GEMS} ]]; then
118     eerror "${GEMS} is a directory. Please move this directory out of the way, and then emerge --resume."
119     fi
120     die "Please address the above errors, then emerge --resume."
121     fi
122     }
123    
124     src_test() {
125     ANT_TASKS="ant-junit ant-trax" eant test
126     }

  ViewVC Help
Powered by ViewVC 1.1.20