summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-java/jruby
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-java/jruby')
-rw-r--r--dev-java/jruby/Manifest2
-rw-r--r--dev-java/jruby/files/10jruby1
-rw-r--r--dev-java/jruby/files/ftype-test-fixes.patch79
-rw-r--r--dev-java/jruby/files/gentoo.rb8
-rwxr-xr-xdev-java/jruby/files/jruby4
-rw-r--r--dev-java/jruby/files/jruby-1.7.12-bash-launcher.patch164
-rw-r--r--dev-java/jruby/files/jruby-bash-launcher.patch180
-rw-r--r--dev-java/jruby/files/user-test-fixes.patch124
-rw-r--r--dev-java/jruby/jruby-1.7.12.ebuild185
-rw-r--r--dev-java/jruby/metadata.xml6
10 files changed, 753 insertions, 0 deletions
diff --git a/dev-java/jruby/Manifest b/dev-java/jruby/Manifest
new file mode 100644
index 000000000000..d3068c236511
--- /dev/null
+++ b/dev-java/jruby/Manifest
@@ -0,0 +1,2 @@
+DIST jruby-1.7.12-mvn-ant-ant.patch 210806 SHA256 3a46445615a3b4c6dcfea5e8b1cbf00177e81516c7fd70c619812be8ae0edf98 SHA512 18ab5e9a0ca04deccfe2ffaeba54c2c79c6f17fc5277bf32b800279f5a2a1c6e62ec273276b5b951d13d78b0de7b535b651a0d564b788cd972186895a3ab96ae WHIRLPOOL 23cdec09c9cae819d184676c57cc6fe2bc01b1c1a3dd574ae264e22796624beec31b2d5f8bec195594292b7dc742427c6e8f2f2bd48fad552a3fdb2cab0a2f07
+DIST jruby-src-1.7.12.tar.gz 10537791 SHA256 c10c0581abe7d55519273b91bddf9d44610baf69b875473593fd739b0c059cc7 SHA512 f68e72c37543a5301041a1700b9a3ef07ea5be43b806187f49e7ef6172315c5cd2aa4d74466273122e35b1a190f9a0fb097127c9530f48740f278ff6f87704fe WHIRLPOOL 5b82c5ac00761a62c6d319dc9ff319a5036c7b30724449149595fbaac117a2dca61bc13480db79ef85f10278607556f7091698021c3a7cfd3b1359603755e01a
diff --git a/dev-java/jruby/files/10jruby b/dev-java/jruby/files/10jruby
new file mode 100644
index 000000000000..13cb1f984cff
--- /dev/null
+++ b/dev-java/jruby/files/10jruby
@@ -0,0 +1 @@
+JRUBY_OPTS="-rgentoo"
diff --git a/dev-java/jruby/files/ftype-test-fixes.patch b/dev-java/jruby/files/ftype-test-fixes.patch
new file mode 100644
index 000000000000..77bdbda1a61f
--- /dev/null
+++ b/dev-java/jruby/files/ftype-test-fixes.patch
@@ -0,0 +1,79 @@
+diff -Naur jruby-1.2.0.orig/test/externals/ruby_test/test/core/File/class/tc_ftype.rb jruby-1.2.0/test/externals/ruby_test/test/core/File/class/tc_ftype.rb
+--- jruby-1.2.0.orig/test/externals/ruby_test/test/core/File/class/tc_ftype.rb 2009-04-26 12:01:41.912584566 +0100
++++ jruby-1.2.0/test/externals/ruby_test/test/core/File/class/tc_ftype.rb 2009-04-26 12:03:56.000210377 +0100
+@@ -26,28 +26,13 @@
+ else
+ @char = Pathname.new('/dev/null').realpath
+ @fifo = "test_fifo"
++ @link = "test_link"
+
+ system("mkfifo #{@fifo}")
++ system("ln -snf . #{@link}")
+
+- if File.exists?("/dev/fd0")
+- @block = Pathname.new("/dev/fd0").realpath
+- @link = "/dev/fd0" if File.symlink?("/dev/fd0")
+- elsif File.exists?("/dev/diskette")
+- @block = Pathname.new("/dev/diskette").realpath
+- @link = "/dev/diskette" if File.symlink?("/dev/diskette")
+- elsif File.exists?("/dev/cdrom")
+- @block = Pathname.new("/dev/cdrom").realpath
+- @link = "/dev/cdrom" if File.symlink?("/dev/cdrom")
+- elsif File.exists?("/dev/sr0") # CDROM
+- @block = Pathname.new("/dev/sr0").realpath
+- @link = "/dev/sr0" if File.symlink?("/dev/sr0")
+- elsif File.exists?("/dev/disk0")
+- @block = "/dev/disk0"
+- @link = "/tmp"
+- else
+- @block = nil
+- @link = nil
+- end
++ @block = %w( /dev/fd0 /dev/diskette /dev/cdrom /dev/sr0 /dev/disk0 ).find { |dev| File.exists?(dev) }
++ @block = Pathname.new(@block).realpath if @block
+ end
+ end
+
+@@ -66,22 +51,21 @@
+ end
+
+ # TODO: Find appropriate tests for MS Windows
+- unless WINDOWS
+- def test_ftype_char
+- assert_equal('characterSpecial', File.ftype(@char))
+- end
++
++ def test_ftype_char
++ assert_equal('characterSpecial', File.ftype(@char)) if @char
++ end
+
+- def test_ftype_block
+- assert_equal('blockSpecial', File.ftype(@block), "BLOCK WAS: #{@block}")
+- end
++ def test_ftype_block
++ assert_equal('blockSpecial', File.ftype(@block), "BLOCK WAS: #{@block}") if @block
++ end
+
+- def test_ftype_link
+- assert_equal('link', File.ftype(@link))
+- end
++ def test_ftype_link
++ assert_equal('link', File.ftype(@link)) if @link
++ end
+
+- def test_ftype_fifo
+- assert_equal('fifo', File.ftype(@fifo))
+- end
++ def test_ftype_fifo
++ assert_equal('fifo', File.ftype(@fifo)) if @fifo
+ end
+
+ def test_ftype_expected_errors
+@@ -91,6 +75,7 @@
+
+ def teardown
+ remove_file(@fifo)
++ remove_file(@link)
+
+ @file = nil
+ @dir = nil
diff --git a/dev-java/jruby/files/gentoo.rb b/dev-java/jruby/files/gentoo.rb
new file mode 100644
index 000000000000..20c50f96c0d2
--- /dev/null
+++ b/dev-java/jruby/files/gentoo.rb
@@ -0,0 +1,8 @@
+# Autoload rubygems as with regular Ruby.
+begin
+require 'rubygems'
+rescue LoadError
+end
+
+# Append regular site_ruby to $LOAD_PATH. Unfortunately the -I option prepends instead.
+$LOAD_PATH.insert(-2, '/usr/lib/ruby/site_ruby/1.8', '/usr/lib/ruby/site_ruby')
diff --git a/dev-java/jruby/files/jruby b/dev-java/jruby/files/jruby
new file mode 100755
index 000000000000..804d788037fd
--- /dev/null
+++ b/dev-java/jruby/files/jruby
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+export JRUBY_CP=`java-config -d -p jruby`
+exec bash /usr/share/jruby/bin/jruby "${@}"
diff --git a/dev-java/jruby/files/jruby-1.7.12-bash-launcher.patch b/dev-java/jruby/files/jruby-1.7.12-bash-launcher.patch
new file mode 100644
index 000000000000..2fe9eb457de0
--- /dev/null
+++ b/dev-java/jruby/files/jruby-1.7.12-bash-launcher.patch
@@ -0,0 +1,164 @@
+diff -Naur a/bin/jruby.bash b/bin/jruby.bash
+--- a/bin/jruby.bash 2014-05-03 17:55:20.665665383 +0200
++++ b/bin/jruby.bash 2014-05-03 17:58:37.095630622 +0200
+@@ -25,29 +25,7 @@
+ JAVA_VM=-client
+ fi
+
+-# get the absolute path of the executable
+-SELF_PATH=$(builtin cd -P -- "$(dirname -- "$0")" >/dev/null && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
+-
+-# resolve symlinks
+-while [ -h $SELF_PATH ]; do
+- # 1) cd to directory of the symlink
+- # 2) cd to the directory of where the symlink points
+- # 3) get the pwd
+- # 4) append the basename
+- DIR=$(dirname -- "$SELF_PATH")
+- SYM=$(readlink $SELF_PATH)
+- SELF_PATH=$(cd $DIR && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
+-done
+-
+-PRG=$SELF_PATH
+-
+-JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
+-if [ "$JRUBY_HOME_1" = '.' ] ; then
+- cwd=`pwd`
+- JRUBY_HOME=`dirname $cwd` # JRUBY-2699
+-else
+- JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
+-fi
++JRUBY_HOME="${JRUBY_HOME:-/usr/share/jruby}"
+
+ if [ -z "$JRUBY_OPTS" ] ; then
+ JRUBY_OPTS=""
+@@ -79,17 +57,7 @@
+ done
+ JRUBY_OPTS=${JRUBY_OPTS_TEMP}
+
+-if [ -z "$JAVACMD" ] ; then
+- if [ -z "$JAVA_HOME" ] ; then
+- JAVACMD='java'
+- else
+- if $cygwin; then
+- JAVACMD="`cygpath -u "$JAVA_HOME"`/bin/java"
+- else
+- JAVACMD="$JAVA_HOME/bin/java"
+- fi
+- fi
+-fi
++JAVACMD=java
+
+ if [ -z "$JAVA_MEM" ] ; then
+ JAVA_MEM=-Xmx500m
+@@ -130,21 +98,7 @@
+
+ CP_DELIMITER=":"
+
+-# add main jruby jar to the bootclasspath
+-for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
+- if [ ! -e "$j" ]; then
+- continue
+- fi
+- if [ "$JRUBY_CP" ]; then
+- JRUBY_CP="$JRUBY_CP$CP_DELIMITER$j"
+- else
+- JRUBY_CP="$j"
+- fi
+- if [ $JRUBY_ALREADY_ADDED ]; then
+- echo "WARNING: more than one JRuby JAR found in lib directory"
+- fi
+- JRUBY_ALREADY_ADDED=true
+-done
++JRUBY_CP="$(java-config-2 -d -p jruby)"
+
+ if $cygwin; then
+ JRUBY_CP=`cygpath -p -w "$JRUBY_CP"`
+@@ -152,29 +106,7 @@
+
+ # ----- 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 [ "$j" == "$JRUBY_HOME"/lib/jruby.jar ]; then
+- continue
+- fi
+- if [ "$j" == "$JRUBY_HOME"/lib/jruby-complete.jar ]; then
+- continue
+- fi
+- if [ "$CP" ]; then
+- CP="$CP$CP_DELIMITER$j"
+- else
+- CP="$j"
+- fi
+- done
+-
+- if [ "$CP" != "" ] && $cygwin; then
+- CP=`cygpath -p -w "$CP"`
+- fi
+-fi
++CP="${JRUBY_PARENT_CLASSPATH}"
+
+ if $cygwin; then
+ # switch delimiter only after building Unix style classpaths
+@@ -254,15 +186,7 @@
+ java_args=("${java_args[@]}" "-Djava.awt.headless=true") ;;
+ # Run under JDB
+ --jdb)
+- if [ -z "$JAVA_HOME" ] ; then
+- JAVACMD='jdb'
+- else
+- if $cygwin; then
+- JAVACMD="`cygpath -u "$JAVA_HOME"`/bin/jdb"
+- else
+- JAVACMD="$JAVA_HOME/bin/jdb"
+- fi
+- fi
++ JAVACMD='jdb'
+ java_args=("${java_args[@]}" "-sourcepath" "$JRUBY_HOME/lib/ruby/1.8:.")
+ JRUBY_OPTS=("${JRUBY_OPTS[@]}" "-X+C") ;;
+ --client)
+@@ -310,8 +234,6 @@
+
+ JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_MEM_MIN $JAVA_STACK"
+
+-JFFI_OPTS="-Djffi.boot.library.path=$JRUBY_HOME/lib/jni"
+-
+ if $cygwin; then
+ JRUBY_HOME=`cygpath --mixed "$JRUBY_HOME"`
+ JRUBY_SHELL=`cygpath --mixed "$JRUBY_SHELL"`
+@@ -349,8 +271,9 @@
+ JRUBY_OPTS=''
+ fi
+
+- "$JAVACMD" $PROFILE_ARGS $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMITER$CP$CP_DELIMITER$CLASSPATH" \
++ "$JAVACMD" $PROFILE_ARGS $JAVA_OPTS "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMITER$CP$CP_DELIMITER$CLASSPATH" \
+ "-Djruby.home=$JRUBY_HOME" \
++ "-Djruby.bindir=/usr/bin" \
+ "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ "-Djruby.shell=$JRUBY_SHELL" \
+ $java_class $JRUBY_OPTS "$@"
+@@ -372,7 +295,7 @@
+ else
+ if $cygwin; then
+ # exec doed not work correctly with cygwin bash
+- "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
++ "$JAVACMD" $JAVA_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" \
+@@ -385,8 +308,9 @@
+
+ exit $JRUBY_STATUS
+ else
+- exec "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
++ exec "$JAVACMD" $JAVA_OPTS "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
+ "-Djruby.home=$JRUBY_HOME" \
++ "-Djruby.bindir=/usr/bin" \
+ "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ "-Djruby.shell=$JRUBY_SHELL" \
+ $java_class $mode "$@"
diff --git a/dev-java/jruby/files/jruby-bash-launcher.patch b/dev-java/jruby/files/jruby-bash-launcher.patch
new file mode 100644
index 000000000000..d23f6cf200f3
--- /dev/null
+++ b/dev-java/jruby/files/jruby-bash-launcher.patch
@@ -0,0 +1,180 @@
+Author: Ralph Sennhauser <sera@gentoo.org>
+
+Set JRUBY_HOME, JRUBY_CP, CP and JAVACMD as appropriate for Gentoo.
+Remove JFFI_OPTS as the system jar knows where to look for the native lib.
+
+diff --git a/bin/jruby.bash b/bin/jruby.bash
+index 731f85e..8299557 100755
+--- a/bin/jruby.bash
++++ b/bin/jruby.bash
+@@ -25,31 +25,7 @@ if [ -z "$JAVA_VM" ]; then
+ JAVA_VM=-client
+ fi
+
+-## resolve links - $0 may be a link to home
+-PRG=$0
+-progname=`basename "$0"`
+-
+-while [ -h "$PRG" ] ; do
+- ls=`ls -ld "$PRG"`
+- link=`expr "$ls" : '.*-> \(.*\)$'`
+- if expr "$link" : '.*/.*' > /dev/null; then
+- if expr "$link" : '/' > /dev/null; then
+- PRG="$link"
+- else
+- PRG="`dirname ${PRG}`/${link}"
+- fi
+- else
+- PRG="`dirname $PRG`/$link"
+- fi
+-done
+-
+-JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
+-if [ "$JRUBY_HOME_1" = '.' ] ; then
+- cwd=`pwd`
+- JRUBY_HOME=`dirname $cwd` # JRUBY-2699
+-else
+- JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
+-fi
++JRUBY_HOME="${JRUBY_HOME:-/usr/share/jruby}"
+
+ if [ -z "$JRUBY_OPTS" ] ; then
+ JRUBY_OPTS=""
+@@ -81,17 +57,7 @@ for opt in ${JRUBY_OPTS[@]}; do
+ done
+ JRUBY_OPTS=${JRUBY_OPTS_TEMP}
+
+-if [ -z "$JAVACMD" ] ; then
+- if [ -z "$JAVA_HOME" ] ; then
+- JAVACMD='java'
+- else
+- if $cygwin; then
+- JAVACMD="`cygpath -u "$JAVA_HOME"`/bin/java"
+- else
+- JAVACMD="$JAVA_HOME/bin/java"
+- fi
+- fi
+-fi
++JAVACMD=java
+
+ if [ -z "$JAVA_MEM" ] ; then
+ JAVA_MEM=-Xmx500m
+@@ -132,21 +98,7 @@ JRUBY_SHELL=/bin/sh
+
+ CP_DELIMITER=":"
+
+-# add main jruby jar to the bootclasspath
+-for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
+- if [ ! -e "$j" ]; then
+- continue
+- fi
+- if [ "$JRUBY_CP" ]; then
+- JRUBY_CP="$JRUBY_CP$CP_DELIMITER$j"
+- else
+- JRUBY_CP="$j"
+- fi
+- if [ $JRUBY_ALREADY_ADDED ]; then
+- echo "WARNING: more than one JRuby JAR found in lib directory"
+- fi
+- JRUBY_ALREADY_ADDED=true
+-done
++JRUBY_CP="$(java-config-2 -d -p jruby)"
+
+ if $cygwin; then
+ JRUBY_CP=`cygpath -p -w "$JRUBY_CP"`
+@@ -154,29 +106,7 @@ 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 [ "$j" == "$JRUBY_HOME"/lib/jruby.jar ]; then
+- continue
+- fi
+- if [ "$j" == "$JRUBY_HOME"/lib/jruby-complete.jar ]; then
+- continue
+- fi
+- if [ "$CP" ]; then
+- CP="$CP$CP_DELIMITER$j"
+- else
+- CP="$j"
+- fi
+- done
+-
+- if $cygwin; then
+- CP=`cygpath -p -w "$CP"`
+- fi
+-fi
++CP="${JRUBY_PARENT_CLASSPATH}"
+
+ if $cygwin; then
+ # switch delimiter only after building Unix style classpaths
+@@ -254,15 +184,7 @@ do
+ java_args=("${java_args[@]}" "-Djava.awt.headless=true") ;;
+ # Run under JDB
+ --jdb)
+- if [ -z "$JAVA_HOME" ] ; then
+- JAVACMD='jdb'
+- else
+- if $cygwin; then
+- JAVACMD="`cygpath -u "$JAVA_HOME"`/bin/jdb"
+- else
+- JAVACMD="$JAVA_HOME/bin/jdb"
+- fi
+- fi
++ JAVACMD='jdb'
+ java_args=("${java_args[@]}" "-sourcepath" "$JRUBY_HOME/lib/ruby/1.8:.")
+ JRUBY_OPTS=("${JRUBY_OPTS[@]}" "-X+C") ;;
+ --client)
+@@ -310,18 +232,6 @@ set -- "${ruby_args[@]}"
+
+ JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_MEM_MIN $JAVA_STACK"
+
+-JFFI_BOOT=""
+-if [ -d "$JRUBY_HOME/lib/native/" ]; then
+- for d in $JRUBY_HOME/lib/native/*`uname -s`; do
+- if [ -z "$JFFI_BOOT" ]; then
+- JFFI_BOOT="$d"
+- else
+- JFFI_BOOT="$JFFI_BOOT:$d"
+- fi
+- done
+-fi
+-JFFI_OPTS="-Djffi.boot.library.path=$JFFI_BOOT"
+-
+ if $cygwin; then
+ JRUBY_HOME=`cygpath --mixed "$JRUBY_HOME"`
+ JRUBY_SHELL=`cygpath --mixed "$JRUBY_SHELL"`
+@@ -354,7 +264,8 @@ if [ "$VERIFY_JRUBY" != "" ]; then
+ echo "Running with instrumented profiler"
+ fi
+
+- "$JAVACMD" $PROFILE_ARGS $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMITER$CP$CP_DELIMITER$CLASSPATH" \
++ "$JAVACMD" $PROFILE_ARGS $JAVA_OPTS "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMITER$CP$CP_DELIMITER$CLASSPATH" \
+ "-Djruby.home=$JRUBY_HOME" \
++ "-Djruby.bindir=/usr/bin" \
+ "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ "-Djruby.shell=$JRUBY_SHELL" \
+@@ -377,7 +287,7 @@ if [ "$VERIFY_JRUBY" != "" ]; then
+ else
+ if $cygwin; then
+ # exec doed not work correctly with cygwin bash
+- "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
++ "$JAVACMD" $JAVA_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" \
+@@ -390,7 +300,8 @@ else
+
+ exit $JRUBY_STATUS
+ else
+- exec "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
++ exec "$JAVACMD" $JAVA_OPTS "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
+ "-Djruby.home=$JRUBY_HOME" \
++ "-Djruby.bindir=/usr/bin" \
+ "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ "-Djruby.shell=$JRUBY_SHELL" \
diff --git a/dev-java/jruby/files/user-test-fixes.patch b/dev-java/jruby/files/user-test-fixes.patch
new file mode 100644
index 000000000000..6688fa9aa01a
--- /dev/null
+++ b/dev-java/jruby/files/user-test-fixes.patch
@@ -0,0 +1,124 @@
+diff -Naur jruby-1.2.0.orig/test/externals/ruby_test/lib/test/helper.rb jruby-1.2.0/test/externals/ruby_test/lib/test/helper.rb
+--- jruby-1.2.0.orig/test/externals/ruby_test/lib/test/helper.rb 2009-03-16 15:16:02.000000000 +0000
++++ jruby-1.2.0/test/externals/ruby_test/lib/test/helper.rb 2009-04-18 00:34:02.198853097 +0100
+@@ -235,31 +235,34 @@
+ # Get the user of the current process.
+ #
+ def get_user
+- user = ENV['USERNAME'] || ENV['USER']
+ if WINDOWS
+- if user.nil?
+- buf = 0.chr * MAX_PATH
+- if GetUserName.call(buf, buf.length) == 0
+- raise "Unable to get user name"
+- end
+- user = buf.unpack("A*")
++ buf = 0.chr * MAX_PATH
++ if GetUserName.call(buf, buf.length) != 0
++ buf.unpack("A*")
++ elsif user = ENV['USERNAME'] || ENV['USER']
++ user
++ else
++ raise "Unable to get user name"
+ end
+ else
+- user ||= Etc.getpwuid(Process.uid).name
++ Etc.getpwuid(Process.uid).name
+ end
+- user
+ end
+
+- # Returns the home directory of the current process owner.
+- #
++ # Returns the home directory of the current process owner
++ # according to the HOME/USERPROFILE variable.
+ def get_home
+- home = ENV['HOME'] || ENV['USERPROFILE']
++ ENV['HOME'] || ENV['USERPROFILE'] || get_real_home
++ end
++
++ # Returns the home directory of the current process owner
++ # according to the system.
++ def get_real_home
+ if WINDOWS
+- home ||= "C:\\Documents and Settings\\" + get_user
++ "C:\\Documents and Settings\\" + get_user
+ else
+- home ||= Etc.getpwuid(Process.uid).dir
++ Etc.getpwuid(Process.uid).dir
+ end
+- home
+ end
+
+ # Returns the current umask of the process.
+diff -Naur jruby-1.2.0.orig/test/externals/ruby_test/test/core/File/class/tc_expand_path.rb jruby-1.2.0/test/externals/ruby_test/test/core/File/class/tc_expand_path.rb
+--- jruby-1.2.0.orig/test/externals/ruby_test/test/core/File/class/tc_expand_path.rb 2009-03-16 15:15:49.000000000 +0000
++++ jruby-1.2.0/test/externals/ruby_test/test/core/File/class/tc_expand_path.rb 2009-04-18 00:20:58.966617568 +0100
+@@ -12,6 +12,7 @@
+ def setup
+ @user = get_user
+ @home = get_home
++ @real_home = get_real_home
+ @pwd = Dir.pwd
+ ENV['HOME'] = ENV['USERPROFILE'] if WINDOWS
+ end
+@@ -88,17 +89,21 @@
+ end
+
+ def test_expand_path_with_tilde
+- assert_equal(@home, File.expand_path("~#{@user}"))
+- assert_equal(File.join(@home, 'bin'), File.expand_path("~#{@user}/bin"))
++ { "~" => @home, "~#{@user}" => @real_home }.each do |tilde,path|
++ assert_equal(path, File.expand_path(tilde))
++ assert_equal(File.join(path, 'bin'), File.expand_path("#{tilde}/bin"))
++ end
+ end
+
+ # Second argument ignored if tilde is present and it's at position 0.
+ def test_expand_path_with_tilde_and_dir
+- assert_equal(@home, File.expand_path("~#{@user}", '.'))
+- assert_equal(@home, File.expand_path("~#{@user}", '..'))
+- assert_equal(@home, File.expand_path("~#{@user}", '/tmp'))
+- assert_equal(@home, File.expand_path("~#{@user}", '../tmp'))
+- assert_equal(File.join(@home, 'bin'), File.expand_path("~#{@user}/bin", '/tmp'))
++ { "~" => @home, "~#{@user}" => @real_home }.each do |tilde,path|
++ assert_equal(path, File.expand_path(tilde, '.'))
++ assert_equal(path, File.expand_path(tilde, '..'))
++ assert_equal(path, File.expand_path(tilde, '/tmp'))
++ assert_equal(path, File.expand_path(tilde, '../tmp'))
++ assert_equal(File.join(path, 'bin'), File.expand_path("#{tilde}/bin", '/tmp'))
++ end
+ end
+
+ def test_expand_path_returns_tainted_string
+@@ -120,5 +126,6 @@
+ @pwd = nil
+ @user = nil
+ @home = nil
++ @real_home = nil
+ end
+ end
+diff -Naur jruby-1.2.0.orig/test/externals/ruby_test/test/core/ProcessGID/class/tc_rid.rb jruby-1.2.0/test/externals/ruby_test/test/core/ProcessGID/class/tc_rid.rb
+--- jruby-1.2.0.orig/test/externals/ruby_test/test/core/ProcessGID/class/tc_rid.rb 2009-03-16 15:16:00.000000000 +0000
++++ jruby-1.2.0/test/externals/ruby_test/test/core/ProcessGID/class/tc_rid.rb 2009-04-18 21:24:02.653686353 +0100
+@@ -12,7 +12,7 @@
+
+ def setup
+ unless WINDOWS
+- @gid = Etc.getpwnam(Etc.getlogin).gid
++ @gid = `id -g`.to_i
+ end
+ end
+
+diff -Naur jruby-1.2.0.orig/test/externals/ruby_test/test/core/ProcessUID/class/tc_rid.rb jruby-1.2.0/test/externals/ruby_test/test/core/ProcessUID/class/tc_rid.rb
+--- jruby-1.2.0.orig/test/externals/ruby_test/test/core/ProcessUID/class/tc_rid.rb 2009-03-16 15:15:50.000000000 +0000
++++ jruby-1.2.0/test/externals/ruby_test/test/core/ProcessUID/class/tc_rid.rb 2009-04-18 21:30:26.748686198 +0100
+@@ -12,7 +12,7 @@
+
+ def setup
+ unless WINDOWS
+- @uid = Etc.getpwnam(Etc.getlogin).uid
++ @uid = `id -u`.to_i
+ end
+ end
+
diff --git a/dev-java/jruby/jruby-1.7.12.ebuild b/dev-java/jruby/jruby-1.7.12.ebuild
new file mode 100644
index 000000000000..dee4cd51abd6
--- /dev/null
+++ b/dev-java/jruby/jruby-1.7.12.ebuild
@@ -0,0 +1,185 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source test"
+
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="Java-based Ruby interpreter implementation"
+HOMEPAGE="http://jruby.codehaus.org/"
+SRC_URI="http://jruby.org.s3.amazonaws.com/downloads/${PV}/${PN}-src-${PV}.tar.gz
+ http://dev.gentoo.org/~tomwij/files/dist/${P}-mvn-ant-ant.patch"
+
+LICENSE="|| ( EPL-1.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
+
+RUBY_VERSION=1.9
+RUBY_REVISION=0
+
+CDEPEND="
+ dev-java/ant-core:0
+ dev-java/asm:4
+ dev-java/bsf:2.3
+ >=dev-java/bytelist-1.0.8:0
+ dev-java/headius-options:0
+ dev-java/invokebinder:0
+ dev-java/jcodings:1
+ dev-java/jffi:1.2
+ dev-java/jnr-constants:0
+ dev-java/jnr-enxio:0
+ dev-java/jnr-ffi:0.7
+ >=dev-java/jnr-netdb-1.0:0
+ dev-java/jnr-posix:2.4
+ dev-java/jnr-unixsocket:0
+ dev-java/joda-time:0
+ dev-java/joni:2.1
+ dev-java/nailgun:0
+ dev-java/osgi-core-api:0
+ dev-lang/ruby:${RUBY_VERSION}
+ >=dev-java/snakeyaml-1.9:0
+ dev-java/jzlib:1.1
+"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.8
+"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.8
+ test? (
+ dev-java/ant-junit4:0
+ dev-java/ant-trax:0
+ dev-java/commons-logging:0
+ dev-java/junit:4
+ dev-java/xalan:0
+ java-virtuals/jdk-with-com-sun:0
+ )
+"
+
+RUBY_HOME=/usr/share/${PN}/lib/ruby
+SITE_RUBY=${RUBY_HOME}/site_ruby
+GEMS=${RUBY_HOME}/gems
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
+
+EANT_GENTOO_CLASSPATH="ant-core asm-4 bsf-2.3 bytelist headius-options \
+invokebinder jcodings-1 jffi-1.2 jnr-constants jnr-enxio jnr-ffi-0.7 jnr-netdb \
+jnr-posix-2.4 jnr-unixsocket joda-time joni-2.1 nailgun osgi-core-api snakeyaml \
+jzlib-1.1"
+
+EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} ant-junit4 ant-trax \
+commons-logging junit-4 xalan jdk-with-com-sun"
+
+EANT_BUILD_TARGET="package"
+
+pkg_setup() {
+ export RUBYOPT=""
+ java-pkg-2_pkg_setup
+
+ local fail
+ for directory in "${GEMS}" "${SITE_RUBY}"; do
+ if [[ -L ${directory} ]]; then
+ eerror "${directory} is a symlink. Please do the following to resolve the situation:"
+ echo 'emerge -an app-portage/gentoolkit'
+ echo 'equery -qC b '"${directory}"' | sort | uniq | sed s/^/=/ > /tmp/jruby.fix'
+ echo 'emerge -1C $(< /tmp/jruby.fix)'
+ echo "rm ${directory}"
+ echo 'emerge -1 $(< /tmp/jruby.fix)'
+
+ eerror "For more information, please see http://bugs.gentoo.org/show_bug.cgi?id=302187"
+ fail="true"
+ fi
+ done
+
+ if [[ -n ${fail} ]]; then
+ die "Please address the above errors, then run emerge --resume"
+ fi
+}
+
+java_prepare() {
+ einfo "Cleaning up bash launcher ..."
+ epatch "${FILESDIR}"/${P}-bash-launcher.patch
+
+ # When you capture a new patch, and it misses org.jruby.runtime.Constants;
+ # add maven.build.resourceDir.1 as a pathelement to the javac task of the
+ # compilation target. Also add jruby-core-GENTOO_JRUY_VER in ext classpaths.
+ # Also reorder the root maven-build.xml such that core compiles before ext.
+ einfo "Patching build.xml ..."
+ epatch "${DISTDIR}"/${P}-mvn-ant-ant.patch
+ find . -name '*build.xml' -exec \
+ sed -i "s/jruby-core-GENTOO_JRUY_VER/jruby-core-${PV}/" {} \;
+
+ einfo "Removing classes and jars ..."
+ find . -name "*.class" -or -name "*.jar" -print -delete
+
+ einfo "Fixing up properties ..."
+ JRUBY_CONSTANTS="core/src/main/resources/org/jruby/runtime/Constants.java"
+ for repvar in $(grep "@.*@\".*;" ${JRUBY_CONSTANTS} | sed 's:.*@\(.*\)@.*:\1:') ; do
+ VAR=$(grep "<${repvar}>" pom.xml | sed 's/.*>\(.*\)<\/.*/\1/')
+ sed -i "s/@${repvar}@/${VAR}/" \
+ ${JRUBY_CONSTANTS} || die
+ done
+ sed -i "s/String VERSION = \".*\"/String VERSION = \"${PV}\"/" \
+ ${JRUBY_CONSTANTS} || die
+
+ einfo "Setting Ruby version to use ..."
+ sed -i -e "s/String jruby_revision = \"\"/String jruby_revision = \"${RUBY_REVISION}\"/" \
+ -e "s/String jruby_default_ruby_version = \"\"/String jruby_default_ruby_version = \"${RUBY_VERSION}\"/" \
+ ${JRUBY_CONSTANTS} || die
+}
+
+# Java based tests return propertly, I guess that is because there are none;
+# I've found an executable that can you can run, but it bails out about libyaml.
+#
+# $ bin/testrb test
+# /usr/share/jruby/lib/ruby/1.9/yaml/store.rb:1:in `require':
+# It seems your ruby installation is missing psych (for YAML output).
+# To eliminate this warning, please install libyaml and reinstall your ruby.
+# JRuby 1.9 mode only supports the `psych` YAML engine; ignoring `syck`
+# NoMethodError: undefined method `to_yaml' for {}:Hash
+# Store at /usr/share/jruby/lib/ruby/1.9/yaml/store.rb:78
+# ...
+RESTRICT="${RESTRICT} test"
+
+src_test() {
+ export RUBYOPT=""
+
+ mv maven-build.xml build.xml || die
+
+ java-pkg-2_src_test
+
+ bin/testrb test || die ""
+}
+
+src_install() {
+ java-pkg_newjar core/target/${PN}-core-${PV}.jar
+ dodoc README.md docs/{*.txt,README.*} || die
+
+ use doc && java-pkg_dojavadoc core/target/site/apidocs
+ use source && java-pkg_dosrc core/src/main/java/org
+
+ newbin bin/jruby.bash jruby
+ dobin bin/j{irb{,_swing},rubyc}
+
+ insinto "${RUBY_HOME}"
+ doins -r "${S}"/lib/ruby/{1.8,1.9,2.0,shared}
+
+ # Remove all the references to RubyGems as we're just going to
+ # install it through dev-ruby/rubygems.
+ find "${ED}${RUBY_HOME}" -type f \
+ '(' '(' -path '*rubygems*' -not -name 'jruby.rb' ')' -or -name 'ubygems.rb' -or -name 'datadir.rb' ')' \
+ -delete || die
+}
+
+pkg_postinst() {
+ ewarn ""
+ ewarn "Make sure RUBYOPT is unset in the environment when using JRuby:"
+ ewarn ""
+ ewarn " export RUBYOPT=\"\""
+ ewarn ""
+}
diff --git a/dev-java/jruby/metadata.xml b/dev-java/jruby/metadata.xml
new file mode 100644
index 000000000000..0b153778e653
--- /dev/null
+++ b/dev-java/jruby/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <herd>ruby</herd>
+</pkgmetadata>