From 477ff9e2a62a1bc06acdfeeb21c2059e940dc876 Mon Sep 17 00:00:00 2001 From: Tom Wijsman Date: Sat, 3 May 2014 21:31:48 +0000 Subject: 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) --- dev-java/jruby/ChangeLog | 11 +- .../jruby/files/jruby-1.7.12-bash-launcher.patch | 164 ++++++++++++++++++ dev-java/jruby/jruby-1.6.5.1.ebuild | 4 +- dev-java/jruby/jruby-1.7.12.ebuild | 185 +++++++++++++++++++++ 4 files changed, 361 insertions(+), 3 deletions(-) create mode 100644 dev-java/jruby/files/jruby-1.7.12-bash-launcher.patch create mode 100644 dev-java/jruby/jruby-1.7.12.ebuild (limited to 'dev-java/jruby') diff --git a/dev-java/jruby/ChangeLog b/dev-java/jruby/ChangeLog index 4dd1cbce3eaa..dca0aaa8ae45 100644 --- a/dev-java/jruby/ChangeLog +++ b/dev-java/jruby/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-java/jruby # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v 1.95 2014/03/03 23:39:57 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/ChangeLog,v 1.96 2014/05/03 21:31:48 tomwij Exp $ + +*jruby-1.7.12 (03 May 2014) + + 03 May 2014; Tom Wijsman + +files/jruby-1.7.12-bash-launcher.patch, +jruby-1.7.12.ebuild, + jruby-1.6.5.1.ebuild: + 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. 03 Mar 2014; Pacho Ramos jruby-1.6.8-r1.ebuild: amd64 stable, bug #495016 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/jruby-1.6.5.1.ebuild b/dev-java/jruby/jruby-1.6.5.1.ebuild index effe497f8f4d..54a2cc0ec6f0 100644 --- a/dev-java/jruby/jruby-1.6.5.1.ebuild +++ b/dev-java/jruby/jruby-1.6.5.1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.6.5.1.ebuild,v 1.4 2012/06/25 07:43:03 nativemad Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.6.5.1.ebuild,v 1.5 2014/05/03 21:31:48 tomwij Exp $ EAPI="4" JAVA_PKG_IUSE="doc source test" 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..0df28319a703 --- /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 +# $Header: /var/cvsroot/gentoo-x86/dev-java/jruby/jruby-1.7.12.ebuild,v 1.1 2014/05/03 21:31:48 tomwij Exp $ + +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 "" +} -- cgit v1.2.3-65-gdbad