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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat May 3 21:31:48 2014 UTC (10 months, 3 weeks ago) by tomwij
Branch: MAIN
CVS Tags: HEAD
Version bump to 1.7.12, masked as it is pending review by the Java and Ruby herds; for bug #442230, reported by Gian and in cooperation with mrueg and others.

(Portage version: HEAD/cvs/Linux x86_64, signed Manifest commit with key 6D34E57D)

1 tomwij 1.1 # Copyright 1999-2014 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4    
5     EAPI="5"
6    
7     JAVA_PKG_IUSE="doc source test"
8    
9     inherit eutils java-pkg-2 java-ant-2
10    
11     DESCRIPTION="Java-based Ruby interpreter implementation"
12     HOMEPAGE="http://jruby.codehaus.org/"
13     SRC_URI="http://jruby.org.s3.amazonaws.com/downloads/${PV}/${PN}-src-${PV}.tar.gz
14     http://dev.gentoo.org/~tomwij/files/dist/${P}-mvn-ant-ant.patch"
15    
16     LICENSE="|| ( EPL-1.0 GPL-2 LGPL-2.1 )"
17     SLOT="0"
18     KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
19    
20     RUBY_VERSION=1.9
21     RUBY_REVISION=0
22    
23     CDEPEND="
24     dev-java/ant-core:0
25     dev-java/asm:4
26     dev-java/bsf:2.3
27     >=dev-java/bytelist-1.0.8:0
28     dev-java/headius-options:0
29     dev-java/invokebinder:0
30     dev-java/jcodings:1
31     dev-java/jffi:1.2
32     dev-java/jnr-constants:0
33     dev-java/jnr-enxio:0
34     dev-java/jnr-ffi:0.7
35     >=dev-java/jnr-netdb-1.0:0
36     dev-java/jnr-posix:2.4
37     dev-java/jnr-unixsocket:0
38     dev-java/joda-time:0
39     dev-java/joni:2.1
40     dev-java/nailgun:0
41     dev-java/osgi-core-api:0
42     dev-lang/ruby:${RUBY_VERSION}
43     >=dev-java/snakeyaml-1.9:0
44     dev-java/jzlib:1.1
45     "
46    
47     RDEPEND="${CDEPEND}
48     >=virtual/jre-1.8
49     "
50    
51     DEPEND="${CDEPEND}
52     >=virtual/jdk-1.8
53     test? (
54     dev-java/ant-junit4:0
55     dev-java/ant-trax:0
56     dev-java/commons-logging:0
57     dev-java/junit:4
58     dev-java/xalan:0
59     java-virtuals/jdk-with-com-sun:0
60     )
61     "
62    
63     RUBY_HOME=/usr/share/${PN}/lib/ruby
64     SITE_RUBY=${RUBY_HOME}/site_ruby
65     GEMS=${RUBY_HOME}/gems
66    
67     JAVA_ANT_REWRITE_CLASSPATH="true"
68     JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
69    
70     EANT_GENTOO_CLASSPATH="ant-core asm-4 bsf-2.3 bytelist headius-options \
71     invokebinder jcodings-1 jffi-1.2 jnr-constants jnr-enxio jnr-ffi-0.7 jnr-netdb \
72     jnr-posix-2.4 jnr-unixsocket joda-time joni-2.1 nailgun osgi-core-api snakeyaml \
73     jzlib-1.1"
74    
75     EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} ant-junit4 ant-trax \
76     commons-logging junit-4 xalan jdk-with-com-sun"
77    
78     EANT_BUILD_TARGET="package"
79    
80     pkg_setup() {
81     export RUBYOPT=""
82     java-pkg-2_pkg_setup
83    
84     local fail
85     for directory in "${GEMS}" "${SITE_RUBY}"; do
86     if [[ -L ${directory} ]]; then
87     eerror "${directory} is a symlink. Please do the following to resolve the situation:"
88     echo 'emerge -an app-portage/gentoolkit'
89     echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > /tmp/jruby.fix'
90     echo 'emerge -1C $(< /tmp/jruby.fix)'
91     echo "rm ${directory}"
92     echo 'emerge -1 $(< /tmp/jruby.fix)'
93    
94     eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
95     fail="true"
96     fi
97     done
98    
99     if [[ -n ${fail} ]]; then
100     die "Please address the above errors, then run emerge --resume"
101     fi
102     }
103    
104     java_prepare() {
105     einfo "Cleaning up bash launcher ..."
106     epatch "${FILESDIR}"/${P}-bash-launcher.patch
107    
108     # When you capture a new patch, and it misses org.jruby.runtime.Constants;
109     # add maven.build.resourceDir.1 as a pathelement to the javac task of the
110     # compilation target. Also add jruby-core-GENTOO_JRUY_VER in ext classpaths.
111     # Also reorder the root maven-build.xml such that core compiles before ext.
112     einfo "Patching build.xml ..."
113     epatch "${DISTDIR}"/${P}-mvn-ant-ant.patch
114     find . -name '*build.xml' -exec \
115     sed -i "s/jruby-core-GENTOO_JRUY_VER/jruby-core-${PV}/" {} \;
116    
117     einfo "Removing classes and jars ..."
118     find . -name "*.class" -or -name "*.jar" -print -delete
119    
120     einfo "Fixing up properties ..."
121     JRUBY_CONSTANTS="core/src/main/resources/org/jruby/runtime/Constants.java"
122     for repvar in $(grep "@.*@\".*;" ${JRUBY_CONSTANTS} | sed 's:.*@\(.*\)@.*:\1:') ; do
123     VAR=$(grep "<${repvar}>" pom.xml | sed 's/.*>\(.*\)<\/.*/\1/')
124     sed -i "s/@${repvar}@/${VAR}/" \
125     ${JRUBY_CONSTANTS} || die
126     done
127     sed -i "s/String VERSION = \".*\"/String VERSION = \"${PV}\"/" \
128     ${JRUBY_CONSTANTS} || die
129    
130     einfo "Setting Ruby version to use ..."
131     sed -i -e "s/String jruby_revision = \"\"/String jruby_revision = \"${RUBY_REVISION}\"/" \
132     -e "s/String jruby_default_ruby_version = \"\"/String jruby_default_ruby_version = \"${RUBY_VERSION}\"/" \
133     ${JRUBY_CONSTANTS} || die
134     }
135    
136     # Java based tests return propertly, I guess that is because there are none;
137     # I've found an executable that can you can run, but it bails out about libyaml.
138     #
139     # $ bin/testrb test
140     # /usr/share/jruby/lib/ruby/1.9/yaml/store.rb:1:in `require':
141     # It seems your ruby installation is missing psych (for YAML output).
142     # To eliminate this warning, please install libyaml and reinstall your ruby.
143     # JRuby 1.9 mode only supports the `psych` YAML engine; ignoring `syck`
144     # NoMethodError: undefined method `to_yaml' for {}:Hash
145     # Store at /usr/share/jruby/lib/ruby/1.9/yaml/store.rb:78
146     # ...
147     RESTRICT="${RESTRICT} test"
148    
149     src_test() {
150     export RUBYOPT=""
151    
152     mv maven-build.xml build.xml || die
153    
154     java-pkg-2_src_test
155    
156     bin/testrb test || die ""
157     }
158    
159     src_install() {
160     java-pkg_newjar core/target/${PN}-core-${PV}.jar
161     dodoc README.md docs/{*.txt,README.*} || die
162    
163     use doc && java-pkg_dojavadoc core/target/site/apidocs
164     use source && java-pkg_dosrc core/src/main/java/org
165    
166     newbin bin/jruby.bash jruby
167     dobin bin/j{irb{,_swing},rubyc}
168    
169     insinto "${RUBY_HOME}"
170     doins -r "${S}"/lib/ruby/{1.8,1.9,2.0,shared}
171    
172     # Remove all the references to RubyGems as we're just going to
173     # install it through dev-ruby/rubygems.
174     find "${ED}${RUBY_HOME}" -type f \
175     '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
176     -delete || die
177     }
178    
179     pkg_postinst() {
180     ewarn ""
181     ewarn "Make sure RUBYOPT is unset in the environment when using JRuby:"
182     ewarn ""
183     ewarn " export RUBYOPT=\"\""
184     ewarn ""
185     }

  ViewVC Help
Powered by ViewVC 1.1.20