From: "Hans de Graaff" <graaff@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/ruby-overlay:master commit in: dev-java/jruby/files/, dev-java/jruby/
Date: Mon, 23 Jan 2012 19:52:11 +0000 (UTC) [thread overview]
Message-ID: <998220263f240e7b3e4340e273c51881cf5b719e.graaff@gentoo> (raw)
commit: 998220263f240e7b3e4340e273c51881cf5b719e
Author: Hans de Graaff <hans <AT> degraaff <DOT> org>
AuthorDate: Mon Jan 23 19:41:01 2012 +0000
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Mon Jan 23 19:41:01 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ruby-overlay.git;a=commit;h=99822026
Various fixes by sera, most notably to fix preservation of whitespace in shell arguments.
---
dev-java/jruby/files/jruby-1.6.0-system-jars.patch | 5 +-
dev-java/jruby/files/jruby-bash-launcher.patch | 178 ++++++++++++++++++++
dev-java/jruby/jruby-1.6.5.1.ebuild | 50 +++---
3 files changed, 208 insertions(+), 25 deletions(-)
diff --git a/dev-java/jruby/files/jruby-1.6.0-system-jars.patch b/dev-java/jruby/files/jruby-1.6.0-system-jars.patch
index 89e86a0..9e31275 100644
--- a/dev-java/jruby/files/jruby-1.6.0-system-jars.patch
+++ b/dev-java/jruby/files/jruby-1.6.0-system-jars.patch
@@ -158,7 +158,7 @@
# Append the rest of the arguments
ruby_args="${ruby_args} $@"
-@@ -257,33 +202,19 @@
+@@ -257,33 +202,17 @@
JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_STACK"
@@ -172,8 +172,7 @@
- fi
- done
-fi
-+JFFI_BOOT=$(java-config -di jffi-0.4)
- JFFI_OPTS="-Djffi.boot.library.path=$JFFI_BOOT"
+-JFFI_OPTS="-Djffi.boot.library.path=$JFFI_BOOT"
if [ "$nailgun_client" != "" ]; then
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 0000000..e962872
--- /dev/null
+++ b/dev-java/jruby/files/jruby-bash-launcher.patch
@@ -0,0 +1,178 @@
+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,7 @@ 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.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,7 @@ 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.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ "-Djruby.shell=$JRUBY_SHELL" \
diff --git a/dev-java/jruby/jruby-1.6.5.1.ebuild b/dev-java/jruby/jruby-1.6.5.1.ebuild
index 40e9929..e5ecfe1 100644
--- a/dev-java/jruby/jruby-1.6.5.1.ebuild
+++ b/dev-java/jruby/jruby-1.6.5.1.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.5.6.ebuild,v 1.2 2011/06/14 18:59:32 maekke Exp $
-EAPI="2"
+EAPI="4"
JAVA_PKG_IUSE="doc source test"
inherit eutils java-pkg-2 java-ant-2
@@ -17,30 +17,34 @@ KEYWORDS="~amd64 ~x86"
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/constantine-0.6:0
>=dev-java/jline-0.9.94:0
>=dev-java/joni-1.1.3:0
- >=dev-java/jnr-posix-1.1.8:1.1
>=dev-java/jnr-netdb-1.0:0
>=dev-java/jvyamlb-0.2.5:0
>=dev-java/asm-3.2:3
>=dev-java/jcodings-1.0.5:0
- >=dev-java/jffi-1.0.10:1.0
+ dev-java/jffi:1.0
+ dev-java/jnr-constants:0
+ dev-java/jnr-ffi:0.5
+ dev-java/jnr-posix:1.1
dev-java/joda-time:0
dev-util/jay:0[java]
dev-java/nailgun:0
- dev-java/jaffl:0
dev-java/jgrapht:0
dev-java/ant-core:0
dev-java/bsf:2.3
- dev-java/osgi-core-api
- >=dev-java/snakeyaml-1.9"
+ dev-java/osgi-core-api:0
+ >=dev-java/snakeyaml-1.9:0"
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? (
@@ -50,7 +54,6 @@ DEPEND="${CDEPEND}
java-virtuals/jdk-with-com-sun
dev-java/commons-logging:0
dev-java/xalan:0
- >=dev-java/jna-posix-1.0.1:0
)
!!<dev-ruby/jruby-1.3.1-r1"
@@ -68,9 +71,9 @@ GEMS=${RUBY_HOME}/gems
JAVA_ANT_REWRITE_CLASSPATH="true"
JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
-EANT_GENTOO_CLASSPATH="ant-core asm-3 bsf-2.3 bytelist constantine jay \
-jcodings jffi-1.0 jline constantine \
-joda-time joni jnr-posix-1.1 jnr-netdb jvyamlb nailgun jaffl jgrapht osgi-core-api \
+EANT_GENTOO_CLASSPATH="ant-core asm-3 bsf-2.3 bytelist jnr-constants jay \
+jcodings jffi-1.0 jline \
+joda-time joni jnr-ffi-0.5 jnr-posix-1.1 jnr-netdb jvyamlb nailgun jgrapht osgi-core-api \
snakeyaml"
EANT_NEEDS_TOOLS="true"
@@ -101,7 +104,7 @@ pkg_setup() {
}
java_prepare() {
- epatch "${FILESDIR}"/${PN}-1.6.0-system-jars.patch
+ epatch "${FILESDIR}"/${PN}-bash-launcher.patch
epatch "${FILESDIR}/1.5.1/build.xml.patch"
# We don't need to use Retroweaver. There is a jarjar and a regular jar
@@ -169,25 +172,28 @@ src_test() {
}
src_install() {
- local bin
-
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
- # 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
+# 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
- dobin "${T}"/jruby "${S}"/bin/j{irb{,_swing},rubyc} || die
+ 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} || die
+ 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.
next reply other threads:[~2012-01-23 19:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-23 19:52 Hans de Graaff [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-01-25 7:10 [gentoo-commits] proj/ruby-overlay:master commit in: dev-java/jruby/files/, dev-java/jruby/ Hans de Graaff
2014-04-09 17:44 Hans de Graaff
2014-04-21 11:58 Manuel Rüger
2014-04-21 21:52 Manuel Rüger
2014-06-16 19:58 Hans de Graaff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=998220263f240e7b3e4340e273c51881cf5b719e.graaff@gentoo \
--to=graaff@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox