commit:     3dac0917ca5c20801663f9feff3a4a55b2415bb9
Author:     Hans de Graaff <hans <AT> degraaff <DOT> org>
AuthorDate: Wed Apr  9 17:44:33 2014 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Wed Apr  9 17:44:33 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/ruby-overlay.git;a=commit;h=3dac0917

Work-in-progress version of jruby 1.7. Won't install due to trying to run maven 
to compile.

Package-Manager: portage-2.2.8-r1

---
 dev-java/jruby/ChangeLog                           |  12 ++
 .../jruby/files/jruby-1.7.11-bash-launcher.patch   | 163 +++++++++++++++++
 dev-java/jruby/files/jruby-1.7.11-build.xml.patch  |  12 ++
 dev-java/jruby/jruby-1.7.11.ebuild                 | 197 +++++++++++++++++++++
 dev-java/jruby/metadata.xml                        |   6 +
 5 files changed, 390 insertions(+)

diff --git a/dev-java/jruby/ChangeLog b/dev-java/jruby/ChangeLog
new file mode 100644
index 0000000..4e91393
--- /dev/null
+++ b/dev-java/jruby/ChangeLog
@@ -0,0 +1,12 @@
+# ChangeLog for dev-java/jruby
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*jruby-1.7.11 (09 Apr 2014)
+
+  09 Apr 2014; Hans de Graaff <[email protected]> +jruby-1.7.11.ebuild,
+  +files/jruby-1.7.11-bash-launcher.patch, +files/jruby-1.7.11-build.xml.patch,
+  +metadata.xml:
+  Work-in-progress version of jruby 1.7. Won't install due to trying to run
+  maven to compile.
+

diff --git a/dev-java/jruby/files/jruby-1.7.11-bash-launcher.patch 
b/dev-java/jruby/files/jruby-1.7.11-bash-launcher.patch
new file mode 100644
index 0000000..7226e11
--- /dev/null
+++ b/dev-java/jruby/files/jruby-1.7.11-bash-launcher.patch
@@ -0,0 +1,163 @@
+--- bin/jruby.bash.orig        2013-12-06 16:38:30.000000000 +0100
++++ bin/jruby.bash     2013-12-22 16:50:14.390401944 +0100
+@@ -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)
+@@ -307,8 +231,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"`
+@@ -346,8 +268,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 "$@"
+@@ -369,7 +292,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" \
+@@ -382,8 +305,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-1.7.11-build.xml.patch 
b/dev-java/jruby/files/jruby-1.7.11-build.xml.patch
new file mode 100644
index 0000000..f66b789
--- /dev/null
+++ b/dev-java/jruby/files/jruby-1.7.11-build.xml.patch
@@ -0,0 +1,12 @@
+--- build.xml.~1~      2014-04-05 17:34:18.027962237 +0200
++++ build.xml  2014-04-05 17:35:06.770656344 +0200
+@@ -304,9 +304,6 @@
+     </target>
+ 
+     <target name="bootstrap" >
+-        <exec executable="mvn" >
+-            <arg line="-q -Pbootstrap" ></arg>
+-        </exec>
+     </target>
+ 
+     <target depends="prepare" description="Creates the Java API docs" 
name="apidocs" >

diff --git a/dev-java/jruby/jruby-1.7.11.ebuild 
b/dev-java/jruby/jruby-1.7.11.ebuild
new file mode 100644
index 0000000..590900e
--- /dev/null
+++ b/dev-java/jruby/jruby-1.7.11.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source test"
+
+inherit eutils java-pkg-2 java-ant-2
+
+MY_PV="${PV/_rc1/RC1}"
+
+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";
+LICENSE="|| ( CPL-1.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="bsf ssl"
+
+# jffi still needed? Or do we call that jnr-ffi?
+#  jnr-ffi depends on jffi which depends on libffi
+CDEPEND=">=dev-java/bytelist-1.0.8:0
+       >=dev-java/joni-1.1.3:0
+       >=dev-java/jnr-netdb-1.0:0
+       >=dev-java/jvyamlb-0.2.5:0
+       >=dev-java/jcodings-1.0.5:0
+       dev-java/asm:4
+       dev-java/bcpkix:0
+       dev-java/bcprov:0
+       dev-java/invokebinder:0
+       dev-java/jffi:1.2
+       dev-java/jline:2
+       dev-java/jnr-constants:0
+       dev-java/jnr-ffi:0.7
+       dev-java/jnr-posix:2.4
+       dev-java/jnr-unixsocket:0
+       dev-java/joda-time:0
+       dev-util/jay:0[java]
+       dev-java/nailgun:0
+       dev-java/jgrapht:0
+       dev-java/ant-core:0
+       dev-java/bsf:2.3
+       dev-java/osgi-core-api:0
+       >=dev-java/snakeyaml-1.9:1.9
+       dev-java/jzlib:1.1"
+
+RDEPEND="${CDEPEND}
+       >=virtual/jre-1.6"
+
+# Is jna-posix still needed? Or has that been renamed to jnr-posix?
+#  jna-posix is the original project name which was abononed years ago.
+#  jnr-posix < 1.1.8 are from the original fork
+#  later jnr-posix are from the jnr umbrella project.
+DEPEND="${CDEPEND}
+       >=virtual/jdk-1.6
+       test? (
+               dev-java/ant-junit4:0
+               dev-java/ant-trax:0
+               dev-java/junit:4
+               java-virtuals/jdk-with-com-sun
+               dev-java/commons-logging:0
+               dev-java/xalan:0
+       )
+       !!<dev-ruby/jruby-1.3.1-r1"
+
+PDEPEND="ssl? ( dev-ruby/jruby-openssl )"
+
+# Tests fail.
+# Need to stop injecting jar's into classpath.
+RESTRICT="test"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+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 bcpkix bcprov bsf-2.3 bytelist \
+invokebinder jnr-constants jay jcodings jffi-1.2 jline-2 joda-time joni \
+jnr-ffi-0.7 jnr-posix-2.4 jnr-netdb jnr-unixsocket jvyamlb nailgun
+jgrapht osgi-core-api snakeyaml jzlib-1.1"
+EANT_NEEDS_TOOLS="true"
+
+pkg_setup() {
+       unset 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/^/=/ > ~/jruby.fix'
+                       echo 'emerge -1C $(< ~/jruby.fix)'
+                       echo "rm ${directory}"
+                       echo 'emerge -1 $(< ~/jruby.fix)'
+                       echo 'rm ~/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() {
+       epatch "${FILESDIR}"/${P}-bash-launcher.patch
+#      epatch "${FILESDIR}/${P}-build.xml.patch"
+
+# This is in a comment, compile issue?
+#      sed -i -e '/Arndt/d' src/org/jruby/RubyBigDecimal.java
+
+       # Delete the bundled JARs but keep invokedynamic.jar.
+       # No source is available and it's only a dummy anyway.
+#      find build_lib -name "*.jar" ! -name "jsr292-mock.jar" ! -name 
"yecht.jar" ! -name 'coro-mock-1.0-SNAPSHOT.jar' -delete || die
+}
+
+src_compile() {
+       # Avoid generating the ri cache since that currently fails.
+       local flags="-Dgenerate-ri-cache.hasrun=true"
+       #local flags=""
+       use bsf && flags="-Dbsf.present=true"
+
+       export RUBYOPT=""
+       einfo $RUBYOPT
+       #eant jar $(use_doc apidocs) -Djdk1.5+=true ${flags}
+       eant -Djdk1.5+=true ${flags}
+}
+
+src_test() {
+       if [ ${UID} == 0 ] ; then
+               ewarn 'The tests will fail if run as root so skipping them.'
+               ewarn 'Enable FEATURES="userpriv" if you want to run them.'
+               return
+       fi
+       # Our jruby.jar is unbundled so we need to add the classpath to this 
test.
+       sed -i "s:java -jar:java -Xbootclasspath/a\:#{ENV['JRUBY_CP']} -jar:g" 
test/test_load_compiled_ruby_class_from_classpath.rb || die
+       sed -i "s@:refid => 'build.classpath'@:path 
=>\"#{ENV['JRUBY_CP']}:lib/jruby.jar\"@g" \
+               rakelib/commands.rake || die
+       #sed -i "s@:refid => 'test.class.path'@:path => \"#{ENV['JRUBY_CP']}@g" 
\
+       #       rakelib/commands.rake || die
+
+       #bsf optionally depends on jruby, which means that the previously
+       #installed jruby will be added to classpath, nasty things will happen.
+       local cpath=`java-pkg_getjars ${EANT_GENTOO_CLASSPATH// /,},junit-4`
+       cpath="$(echo ${cpath} | sed -e 
"s_${EROOT}/usr/share/jruby/lib/jruby.jar:__g")"
+       cpath="${cpath}:$(java-pkg_getjars --build-only commons-logging,xalan)"
+       EANT_GENTOO_CLASSPATH=""
+
+       local flags=""
+       use bsf && flags="-Dbsf.present=true"
+
+       #Clear RUBYOPT
+       export RUBYOPT=""
+       export JRUBY_CP="${cpath}"
+       ANT_TASKS="ant-junit4 ant-trax" \
+               JRUBY_OPTS="" eant test -Djdk1.5+=true -Djruby.bindir=bin \
+               -Dgentoo.classpath="${cpath}" ${flags}
+}
+
+src_install() {
+       java-pkg_dojar lib/${PN}.jar
+       dodoc README docs/{*.txt,README.*} || die
+
+       use doc && java-pkg_dojavadoc docs/api
+       use source && java-pkg_dosrc src/org
+
+# Use the bash based launcher to preserve whitespace in arguments.
+# Ie allow >jruby -e "puts 'hello'"< to work otherwise
+# >jruby -e "\"puts 'hello'\""< is needed.
+#
+#      # 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.sh > "${T}"/jruby
+
+       newbin bin/jruby.bash jruby
+       dobin bin/j{irb{,_swing},rubyc}
+
+       insinto "${RUBY_HOME}"
+       doins -r "${S}"/lib/ruby/{1.8,1.9,site_ruby}
+
+       # 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
+}

diff --git a/dev-java/jruby/metadata.xml b/dev-java/jruby/metadata.xml
new file mode 100644
index 0000000..0b15377
--- /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>

Reply via email to