summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-23 23:02:16 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-23 23:02:16 +0000
commit7dacf32f1f6a03651c62069373420361b191c4de (patch)
tree6a862a9d65040e6dda72069b258a0f6bcadf285c /dev-java/jruby
parentKeyword ~amd64-linux/~x86-linux (diff)
downloadgentoo-2-7dacf32f1f6a03651c62069373420361b191c4de.tar.gz
gentoo-2-7dacf32f1f6a03651c62069373420361b191c4de.tar.bz2
gentoo-2-7dacf32f1f6a03651c62069373420361b191c4de.zip
Revision bump with improvements to the launch script, this reduces its complexity, and make sure that we run with the correct parameters. We also don't symlink in /usr/share/bin any longer. Simplify ebuild logic for the symlink checks, and add a hard blocker on the older versions so that most users upgrading won't hit the error anyway.
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'dev-java/jruby')
-rw-r--r--dev-java/jruby/ChangeLog13
-rw-r--r--dev-java/jruby/files/jruby-1.4.0-system-jars.patch218
-rw-r--r--dev-java/jruby/jruby-1.4.0-r4.ebuild (renamed from dev-java/jruby/jruby-1.4.0-r3.ebuild)42
3 files changed, 225 insertions, 48 deletions
diff --git a/dev-java/jruby/ChangeLog b/dev-java/jruby/ChangeLog
index ea7074f3a143..f7d11cbfa04a 100644
--- a/dev-java/jruby/ChangeLog
+++ b/dev-java/jruby/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for dev-java/jruby
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v 1.51 2010/01/23 13:51:00 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v 1.52 2010/01/23 23:02:15 flameeyes Exp $
+
+*jruby-1.4.0-r4 (23 Jan 2010)
+
+ 23 Jan 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+ -jruby-1.4.0-r3.ebuild, +jruby-1.4.0-r4.ebuild,
+ files/jruby-1.4.0-system-jars.patch:
+ Revision bump with improvements to the launch script, this reduces its
+ complexity, and make sure that we run with the correct parameters. We also
+ don't symlink in /usr/share/bin any longer. Simplify ebuild logic for the
+ symlink checks, and add a hard blocker on the older versions so that most
+ users upgrading won't hit the error anyway.
23 Jan 2010; Diego E. Pettenò <flameeyes@gentoo.org>
-files/jruby-0.9.8-sandbox.patch, -jruby-1.0.0.ebuild,
diff --git a/dev-java/jruby/files/jruby-1.4.0-system-jars.patch b/dev-java/jruby/files/jruby-1.4.0-system-jars.patch
index ae0f4b278199..41732b0dd732 100644
--- a/dev-java/jruby/files/jruby-1.4.0-system-jars.patch
+++ b/dev-java/jruby/files/jruby-1.4.0-system-jars.patch
@@ -2,7 +2,15 @@ Index: jruby-1.4.0/bin/jruby
===================================================================
--- jruby-1.4.0.orig/bin/jruby
+++ jruby-1.4.0/bin/jruby
-@@ -19,16 +19,6 @@ case "`uname`" in
+@@ -11,26 +11,17 @@
+ #
+ # -----------------------------------------------------------------------------
+
+-cygwin=false
+-
+ # ----- Identify OS we are running under --------------------------------------
+ case "`uname`" in
+- CYGWIN*) cygwin=true;;
Darwin) darwin=true;;
esac
@@ -18,8 +26,14 @@ Index: jruby-1.4.0/bin/jruby
-
# ----- Verify and Set Required Environment Variables -------------------------
++# This will be filled in by the ebuild after install
++JRUBY_HOME=
++
++# ++ebuild-cut-here++
## resolve links - $0 may be a link to home
-@@ -49,12 +39,17 @@ while [ -h "$PRG" ] ; do
+ PRG=$0
+ progname=`basename "$0"`
+@@ -49,13 +40,16 @@ while [ -h "$PRG" ] ; do
fi
done
@@ -29,9 +43,6 @@ Index: jruby-1.4.0/bin/jruby
- JRUBY_HOME=`dirname $cwd` # JRUBY-2699
-else
- JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
-+# This will be filled in by the ebuild after install
-+JRUBY_HOME=
-+
+if [ -z "$JRUBY_HOME" ]; then
+ JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
+ if [ "$JRUBY_HOME_1" = '.' ] ; then
@@ -41,12 +52,52 @@ Index: jruby-1.4.0/bin/jruby
+ JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
+ fi
fi
++# --ebuild-cut-here--
if [ -z "$JRUBY_OPTS" ] ; then
-@@ -122,14 +117,7 @@ if [ "$JRUBY_PARENT_CLASSPATH" != "" ];
- # Use same classpath propagated from parent jruby
- CP=$JRUBY_PARENT_CLASSPATH
- else
+ JRUBY_OPTS=""
+@@ -84,72 +78,17 @@ for opt in ${JRUBY_OPTS[@]}; do
+ done
+ JRUBY_OPTS=${JRUBY_OPTS_TEMP}
+
+-if [ -z "$JAVA_HOME" ] ; then
+- JAVA_CMD='java'
+-else
+- if $cygwin; then
+- JAVA_HOME=`cygpath -u "$JAVA_HOME"`
+- fi
+- JAVA_CMD="$JAVA_HOME/bin/java"
+-fi
+-
+-# If you're seeing odd exceptions, you may have a bad JVM install.
+-# Uncomment this and report the version to the JRuby team along with error.
+-#$JAVA_CMD -version
+-
+ JRUBY_SHELL=/bin/sh
+
+ # ----- Set Up The Boot Classpath -------------------------------------------
+
+-CP_DELIMITER=":"
+-
+-# add jruby jars for command-line execution
+-for j in "$JRUBY_HOME"/lib/{jruby*,bsf}.jar; do
+- if [ "$JRUBY_CP" ]; then
+- JRUBY_CP="$JRUBY_CP$CP_DELIMITER$j"
+- else
+- JRUBY_CP="$j"
+- fi
+-done
+-
+-if $cygwin; then
+- JRUBY_CP=`cygpath -p -w "$JRUBY_CP"`
+-fi
+-
+-# ----- Set Up The System Classpath -------------------------------------------
+-
+-if [ "$JRUBY_PARENT_CLASSPATH" != "" ]; then
+- # Use same classpath propagated from parent jruby
+- CP=$JRUBY_PARENT_CLASSPATH
+-else
- # add other jars in lib to CP for command-line execution
- for j in "$JRUBY_HOME"/lib/*.jar; do
- if [ "$CP" ]; then
@@ -55,11 +106,73 @@ Index: jruby-1.4.0/bin/jruby
- CP="$j"
- fi
- done
-+ CP=$(java-config -d -p jruby)
+-
+- if $cygwin; then
+- CP=`cygpath -p -w "$CP"`
+- fi
+-fi
+-
+-if $cygwin; then
+- # switch delimiter only after building Unix style classpaths
+- CP_DELIMITER=";"
+-fi
++JRUBY_CP=$(java-config -d -p jruby)
++CP=${JRUBY_PARENT_CLASSPATH}
+
+ # ----- Execute The Requested Command -----------------------------------------
- if $cygwin; then
- CP=`cygpath -p -w "$CP"`
-@@ -270,23 +258,9 @@ ruby_args=("${ruby_args[@]}" "$@")
+-if [ -z "$JAVA_MEM" ] ; then
+- JAVA_MEM=-Xmx500m
+-fi
+-
+-if [ -z "$JAVA_STACK" ] ; then
+- JAVA_STACK=-Xss1024k
+-fi
++JAVA_MEM=${JAVA_MEM:--Xmx500m}
++JAVA_STACK=${JAVA_STACK:--Xss1024k}
+
+ JAVA_VM=-client
+ JAVA_ENCODING=""
+@@ -172,18 +111,18 @@ do
+ elif [ "${val:0:4}" = "-Xss" ]; then
+ JAVA_STACK=$val
+ elif [ "${val}" = "" ]; then
+- $JAVA_CMD -help
++ java -help
+ echo "(Prepend -J in front of these options when using 'jruby' command)"
+ exit
+ elif [ "${val}" = "-X" ]; then
+- $JAVA_CMD -X
++ java -X
+ echo "(Prepend -J in front of these options when using 'jruby' command)"
+ exit
+ elif [ "${val}" = "-classpath" ]; then
+- CP="$CP$CP_DELIMITER$2"
++ CP="$CP:$2"
+ shift
+ elif [ "${val}" = "-cp" ]; then
+- CP="$CP$CP_DELIMITER$2"
++ CP="$CP:$2"
+ shift
+ else
+ if [ "${val:0:3}" = "-ea" ]; then
+@@ -221,14 +160,7 @@ do
+ java_args=("${java_args[@]}" "-Djava.awt.headless=true") ;;
+ # Run under JDB
+ --jdb)
+- if [ -z "$JAVA_HOME" ] ; then
+- JAVA_CMD='jdb'
+- else
+- if $cygwin; then
+- JAVA_HOME=`cygpath -u "$JAVA_HOME"`
+- fi
+- JAVA_CMD="$JAVA_HOME/bin/jdb"
+- fi
++ JAVA_CMD='jdb'
+ java_args=("${java_args[@]}" "-sourcepath" "$JRUBY_HOME/lib/ruby/1.8:.")
+ JRUBY_OPTS=("${JRUBY_OPTS[@]}" "-X+C") ;;
+ --client)
+@@ -270,57 +202,18 @@ ruby_args=("${ruby_args[@]}" "$@")
set -- "${ruby_args[@]}"
JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_STACK"
@@ -70,7 +183,6 @@ Index: jruby-1.4.0/bin/jruby
-esac
-#JAVA_OPTS="$JAVA_OPTS -Djna.boot.library.path=$JNA_PATH"
-JAVA_JNA="-Djna.boot.library.path=$JNA_PATH"
-+JAVA_JNA="-Djna.boot.library.path=$(java-config -i jna)"
-JFFI_BOOT=""
-for d in $JRUBY_HOME/lib/native/*`uname -s`; do
@@ -81,13 +193,28 @@ Index: jruby-1.4.0/bin/jruby
- fi
-done
-JFFI_OPTS="-Djffi.boot.library.path=$JFFI_BOOT"
+-
+-if $cygwin; then
+- JRUBY_HOME=`cygpath --mixed "$JRUBY_HOME"`
+- JRUBY_SHELL=`cygpath --mixed "$JRUBY_SHELL"`
+-
+- if [[ ( "${1:0:1}" = "/" ) && ( ( -f "$1" ) || ( -d "$1" )) ]]; then
+- win_arg=`cygpath -w "$1"`
+- shift
+- win_args=("$win_arg" "$@")
+- set -- "${win_args[@]}"
+- fi
+-
+- # fix JLine to use UnixTerminal
+- stty -icanon min 1 -echo > /dev/null 2>&1
+- if [ $? = 0 ]; then
+- JAVA_OPTS="$JAVA_OPTS -Djline.terminal=jline.UnixTerminal"
+- fi
+-
+-fi
++JAVA_JNA="-Djna.boot.library.path=$(java-config -i jna)"
+JFFI_OPTS="-Djffi.boot.library.path=$(java-config -i jffi-0.4)"
- if $cygwin; then
- JRUBY_HOME=`cygpath --mixed "$JRUBY_HOME"`
-@@ -308,12 +282,7 @@ if $cygwin; then
- fi
-
if [ "$nailgun_client" != "" ]; then
- if [ -f $JRUBY_HOME/tool/nailgun/ng ]; then
- exec $JRUBY_HOME/tool/nailgun/ng org.jruby.util.NailMain $JRUBY_OPTS "$@"
@@ -95,7 +222,56 @@ Index: jruby-1.4.0/bin/jruby
- echo "error: ng executable not found; run 'make' in ${JRUBY_HOME}/tool/nailgun"
- exit 1
- fi
+-else
+-if [ "$VERIFY_JRUBY" != "" ]; then
+ exec /usr/bin/ng org.jruby.util.NailMain $JRUBY_OPTS "$@"
- else
- if [ "$VERIFY_JRUBY" != "" ]; then
++elif [ "$VERIFY_JRUBY" != "" ]; then
if [ "$PROFILE_ARGS" != "" ]; then
+ echo "Running with instrumented profiler"
+ fi
+
+- "$JAVA_CMD" $PROFILE_ARGS $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMITER$CP$CP_DELIMITER$CLASSPATH" \
++ "${JAVA_CMD:-java}" $PROFILE_ARGS $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -classpath "$JRUBY_CP:$CP:$CLASSPATH" \
+ "-Djruby.home=$JRUBY_HOME" \
+ "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ "-Djruby.shell=$JRUBY_SHELL" \
+@@ -335,34 +228,13 @@ if [ "$VERIFY_JRUBY" != "" ]; then
+ rm profile.txt
+ fi
+
+- if $cygwin; then
+- stty icanon echo > /dev/null 2>&1
+- fi
+-
+ exit $JRUBY_STATUS
+ else
+- if $cygwin; then
+- # exec doed not work correctly with cygwin bash
+- "$JAVA_CMD" $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
+- "-Djruby.home=$JRUBY_HOME" \
+- "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+- "-Djruby.shell=$JRUBY_SHELL" \
+- $java_class $JRUBY_OPTS "$@"
+-
+- # Record the exit status immediately, or it will be overridden.
+- JRUBY_STATUS=$?
+-
+- stty icanon echo > /dev/null 2>&1
+-
+- exit $JRUBY_STATUS
+- else
+- exec "$JAVA_CMD" $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
+- "-Djruby.home=$JRUBY_HOME" \
+- "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+- "-Djruby.shell=$JRUBY_SHELL" \
+- $java_class $JRUBY_OPTS "$@"
+- fi
+-fi
++ exec "${JAVA_CMD:-java}" $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP:$CLASSPATH" \
++ "-Djruby.home=$JRUBY_HOME" \
++ "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
++ "-Djruby.shell=$JRUBY_SHELL" \
++ $java_class $JRUBY_OPTS "$@"
+ fi
+
+ # Be careful adding code down here, you might override the exit
diff --git a/dev-java/jruby/jruby-1.4.0-r3.ebuild b/dev-java/jruby/jruby-1.4.0-r4.ebuild
index 8492ce0bc3f8..316025187511 100644
--- a/dev-java/jruby/jruby-1.4.0-r3.ebuild
+++ b/dev-java/jruby/jruby-1.4.0-r4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.4.0-r3.ebuild,v 1.1 2010/01/16 23:34:28 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.4.0-r4.ebuild,v 1.1 2010/01/23 23:02:15 flameeyes Exp $
EAPI="2"
JAVA_PKG_IUSE="doc source test"
@@ -45,7 +45,8 @@ DEPEND="${CDEPEND}
test? (
dev-java/ant-junit
dev-java/ant-trax
- )"
+ )
+ !!<dev-ruby/jruby-1.3.1-r1"
PDEPEND="dev-ruby/rubygems
>=dev-ruby/rake-0.7.3
@@ -76,17 +77,12 @@ pkg_setup() {
local fail
- if [[ ! -d "${GEMS}" && -L "${GEMS}" ]]; then
- eerror "${GEMS} is a symlink. Please remove this symlink."
- fail="true"
- fi
-
- # the symlink creates a collision with rubygems, bug #270953
- # cannot be currently solved by removing in pkg_preinst, bug #233278
- if [[ -L "${SITE_RUBY}" ]]; then
- eerror "${SITE_RUBY} is a symlink. Please remove this symlink."
- fail="true"
- fi
+ for directory in "${GEMS}" "${SITE_RUBY}"; do
+ if [[ -L ${directory} ]]; then
+ eerror "${directory} is a symlink. Please remove this symlink."
+ fail="true"
+ fi
+ done
if [[ -n ${fail} ]]; then
eerror "Unmerging the old jruby version should also fix the problem(s)."
@@ -112,9 +108,6 @@ java_prepare() {
# Delete the bundled JARs but keep invokedynamic.jar.
# No source is available and it's only a dummy anyway.
- #
- # yecht should be packaged standalone; for now keep it around
- # http://github.com/olabini/yecht
find build_lib -name "*.jar" ! -name "jsr292-mock.jar" -delete || die
rm lib/profile.jar || die
@@ -163,17 +156,14 @@ src_install() {
use doc && java-pkg_dojavadoc docs/api
use source && java-pkg_dosrc src/org
- dobin "${FILESDIR}/jruby" || die
- exeinto "/usr/share/${PN}/bin"
- doexe "${S}/bin/jruby" || die
-
- # Install some jruby tools.
- dobin "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
+ # We run the sed here in install so that we don't get the wrong
+ # data during the test phase!
+ sed \
+ -e '/++ebuild-cut-here++/, /--ebuild-cut-here--/ d' \
+ -e '/^JRUBY_HOME=/s:=:=/usr/share/jruby:' \
+ bin/jruby > "${T}"/jruby
- # Symlink some common tools so that jruby can launch them internally.
- for bin in {j,}gem jirb jrubyc rdoc ri ; do
- dosym "/usr/bin/${bin}" "/usr/share/${PN}/bin/${bin}" || die
- done
+ dobin "${T}"/jruby "${S}"/bin/j{gem,irb{,_swing},rubyc} || die
insinto "${RUBY_HOME}"
doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby} || die