Major update to jruby-1.3.1.

All JRuby stuff is now living in ${LOCALBASE}/jruby to prevent
problems with rubygem conflicts and to reduce the patches for
the port.
This commit is contained in:
bernd 2009-08-09 11:18:59 +00:00
parent 1d57f3bb22
commit 1c1161dacb
8 changed files with 14848 additions and 3219 deletions

View File

@ -1,11 +1,12 @@
# $OpenBSD: Makefile,v 1.7 2009/04/26 09:38:25 sthen Exp $
# $OpenBSD: Makefile,v 1.8 2009/08/09 11:18:59 bernd Exp $
SHARED_ONLY = Yes
COMMENT = pure-Java implementation of the Ruby language
V = 1.1.3
RUBY_REV = 1.8
V = 1.3.1
DISTNAME = jruby-src-${V}
PKGNAME = jruby-${V}p2
PKGNAME = jruby-${V}
CATEGORIES = lang lang/ruby
HOMEPAGE = http://www.jruby.org/
@ -18,48 +19,61 @@ PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
MASTER_SITES = http://dist.codehaus.org/jruby/
MASTER_SITES = http://dist.codehaus.org/jruby/${V}/
MODULES = java
MODJAVA_VER = 1.5+
MODJAVA_VER = 1.7+
MODJAVA_JRERUN = Yes
BUILD_DEPENDS = ::devel/apache-ant
RUN_DEPENDS = ::java/javaPathHelper
WANTLIB = c
MAKE_ENV = JAVA_HOME=${JAVA_HOME}
JRUBY_LIBDIR = ${PREFIX}/lib/jruby
BUILD_DEPENDS = ::devel/apache-ant
RUN_DEPENDS = ::java/javaPathHelper \
::shells/bash
MAKE_ENV = JAVA_HOME=${JAVA_HOME} ANT_OPTS="-Xmx64m -XX:MaxPermSize=64m"
JRUBY_HOME = ${PREFIX}/jruby
WRKDIST = ${WRKDIR}/jruby-${V}
SUBST_VARS = JRUBY_LIBDIR RUBY_REV
SUBST_VARS = JRUBY_HOME
# disable regress tests for now. i have to figure out how to run them
# properly
NO_REGRESS = Yes
pre-build:
@${SUBST_CMD} ${WRKSRC}/src/org/jruby/runtime/load/LoadService.java \
${WRKSRC}/src/org/jruby/libraries/RbConfigLibrary.java
post-extract:
@cd ${WRKSRC}/lib/native && ls -1 | fgrep -v openbsd | xargs -r rm -rf
@cd ${WRKSRC}/lib/ruby/1.8/ffi/platform && \
ls -1 | fgrep -v openbsd | xargs -r rm -rf
do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/ant
@cd ${WRKSRC}/tool/nailgun && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM}
post-build:
@${SUBST_CMD} ${WRKBUILD}/bin/jruby
do-install:
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jgem ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jirb ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jirb_swing ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jruby ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jrubyc ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/rake ${PREFIX}/bin/jrake
${INSTALL_SCRIPT} ${WRKBUILD}/bin/rdoc ${PREFIX}/bin/jrdoc
${INSTALL_SCRIPT} ${WRKBUILD}/bin/ri ${PREFIX}/bin/jri
${INSTALL_SCRIPT} ${WRKBUILD}/bin/spec ${PREFIX}/bin/jspec
${INSTALL_DATA_DIR} ${JRUBY_LIBDIR}
${INSTALL_DATA_DIR} ${JRUBY_HOME}
${INSTALL_DATA_DIR} ${JRUBY_HOME}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/autospec ${JRUBY_HOME}/bin/jautospec
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jgem ${JRUBY_HOME}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jirb ${JRUBY_HOME}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jirb_swing ${JRUBY_HOME}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jruby ${JRUBY_HOME}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/jrubyc ${JRUBY_HOME}/bin
${INSTALL_SCRIPT} ${WRKBUILD}/bin/rake ${JRUBY_HOME}/bin/jrake
${INSTALL_SCRIPT} ${WRKBUILD}/bin/rdoc ${JRUBY_HOME}/bin/jrdoc
${INSTALL_SCRIPT} ${WRKBUILD}/bin/ri ${JRUBY_HOME}/bin/jri
${INSTALL_SCRIPT} ${WRKBUILD}/bin/spec ${JRUBY_HOME}/bin/jspec
${INSTALL_DATA_DIR} ${JRUBY_HOME}/lib
cd ${WRKBUILD}/lib && tar -cf - * | \
tar -C ${JRUBY_LIBDIR} -xf -
chown -R ${SHAREOWN}:${SHAREGRP} ${JRUBY_LIBDIR}
tar -C ${JRUBY_HOME}/lib -xf -
cd ${WRKBUILD} && tar -cf - share | \
tar -C ${JRUBY_HOME} -xf -
${INSTALL_DATA_DIR} ${JRUBY_HOME}/tool/nailgun
${INSTALL_PROGRAM} ${WRKSRC}/tool/nailgun/ng ${JRUBY_HOME}/tool/nailgun
chown -R ${SHAREOWN}:${SHAREGRP} ${JRUBY_HOME}/lib ${JRUBY_HOME}/share \
${JRUBY_HOME}/tool
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (jruby-src-1.1.3.tar.gz) = GYztFLh3c7BqmESIKjN7fg==
RMD160 (jruby-src-1.1.3.tar.gz) = Vy5kP62hR2kCMvYeTkvRWtjF4v0=
SHA1 (jruby-src-1.1.3.tar.gz) = 7Jp3w6S0JfPs1IKTxGtFimvNGbY=
SHA256 (jruby-src-1.1.3.tar.gz) = QckQRjIzkX6pQGlokaX848oI/7nZlcV4us2G7NxYtQU=
SIZE (jruby-src-1.1.3.tar.gz) = 7531123
MD5 (jruby-src-1.3.1.tar.gz) = x+KqSjBl20Raiz4X7P+f4A==
RMD160 (jruby-src-1.3.1.tar.gz) = 7xA5Xb35SQggyqZf9iNt2Z58Ysg=
SHA1 (jruby-src-1.3.1.tar.gz) = 5N5x5cAfcfI2sxNeB6WEF4R2f9g=
SHA256 (jruby-src-1.3.1.tar.gz) = kJWwvsDujmzZa3LH8q7IqQ+kKbhASE1XpI2Pt2Cq5gA=
SIZE (jruby-src-1.3.1.tar.gz) = 12076705

View File

@ -1,187 +1,17 @@
$OpenBSD: patch-bin_jruby,v 1.2 2008/07/21 11:17:33 bernd Exp $
--- bin/jruby.orig Sat Jul 19 07:12:22 2008
+++ bin/jruby Sun Jul 20 14:43:56 2008
$OpenBSD: patch-bin_jruby,v 1.3 2009/08/09 11:18:59 bernd Exp $
--- bin/jruby.orig Mon Jun 15 19:13:13 2009
+++ bin/jruby Sun Aug 9 11:34:44 2009
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
+#!${TRUEPREFIX}/bin/bash
# -----------------------------------------------------------------------------
# jruby.sh - Start Script for the JRuby interpreter
#
@@ -20,6 +20,9 @@ esac
@@ -30,6 +30,7 @@ case "`uname -m`" in
esac
# ----- Verify and Set Required Environment Variables -------------------------
+JAVA_HOME=$(javaPathHelper -h jruby)
+JRUBY_LIBDIR=${JRUBY_LIBDIR}
+
## resolve links - $0 may be a link to home
PRG=$0
progname=`basename "$0"`
@@ -34,12 +37,14 @@ while [ -h "$PRG" ] ; do
fi
done
-JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
-JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
-# When . == bin and . is in path, need to make home be .. (JRUBY-2699)
-#if [ $JRUBY_HOME = '.' ] ; then
-# JRUBY_HOME='..'
-#fi
+if [ -z "$JRUBY_HOME" ]; then
+ JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
+ JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
+ # When . == bin and . is in path, need to make home be .. (JRUBY-2699)
+ #if [ $JRUBY_HOME = '.' ] ; then
+ # JRUBY_HOME='..'
+ #fi
+fi
if [ -z "$JRUBY_OPTS" ] ; then
JRUBY_OPTS=""
@@ -61,7 +66,7 @@ JRUBY_SHELL=/bin/sh
CP_DELIMETER=":"
# add jruby jars for command-line execution
-for j in "$JRUBY_HOME"/lib/jruby*.jar; do
+for j in "$JRUBY_LIBDIR"/jruby*.jar; do
if [ "$JRUBY_CP" ]; then
JRUBY_CP="$JRUBY_CP$CP_DELIMETER$j"
else
@@ -107,17 +112,18 @@ JAVA_VM=-client
# Split out any -J argument for passing to the JVM.
# Scanning for args is aborted by '--'.
-declare -a java_args
-declare -a ruby_args
+java_args=
+ruby_args=
while [ $# -gt 0 ]
do
case "$1" in
# Stuff after '-J' in this argument goes to JVM
-J*)
- val=${1:2}
- if [ "${val:0:4}" = "-Xmx" ]; then
+ val=$(expr "$1" : "-J\(.*\)")
+ jvm_arg=$(expr "$val" : "\(....\)")
+ if [ "$jvm_arg" = "-Xmx" ]; then
JAVA_MEM=$val
- elif [ "${val:0:4}" = "-Xss" ]; then
+ elif [ "$jvm_arg" = "-Xss" ]; then
JAVA_STACK=$val
elif [ "${val}" = "" ]; then
$JAVA_CMD -help
@@ -128,16 +134,16 @@ do
echo "(Prepend -J in front of these options when using 'jruby' command)"
exit
else
- if [ "${val:0:3}" = "-ea" ]; then
+ if [ "$(expr "$val" : "\(...\)")" = "-ea" ]; then
VERIFY_JRUBY="yes"
fi
- java_args=("${java_args[@]}" "${1:2}")
+ java_args="$java_args $jvm_arg"
fi
;;
# Match switches that take an argument
- -e|-I|-S) ruby_args=("${ruby_args[@]}" "$1" "$2"); shift ;;
+ -e|-I|-S) ruby_args="$ruby_args $1 \"$2\""; shift ;;
# Match same switches with argument stuck together
- -e*|-I*|-S*) ruby_args=("${ruby_args[@]}" "$1" ) ;;
+ -e*|-I*|-S*) ruby_args="$ruby_args \"$1\"" ;;
# Run with the instrumented profiler: http://jiprof.sourceforge.net/
--profile)
PROFILE_ARGS="-javaagent:$JRUBY_HOME/lib/profile.jar -Dprofile.properties=$JRUBY_HOME/lib/profile-ruby.properties"
@@ -150,7 +156,7 @@ do
;;
# Run with JMX management enabled
--manage)
- java_args=("${java_args[@]}" "-Dcom.sun.management.jmxremote") ;;
+ java_args="$java_args -Dcom.sun.management.jmxremote" ;;
# Run under JDB
--jdb)
if [ -z "$JAVA_HOME" ] ; then
@@ -166,15 +172,15 @@ do
--server)
JAVA_VM=-server ;;
--sample)
- java_args=("${java_args[@]}" "-Xprof") ;;
+ java_args="$java_args -Xprof" ;;
--1.9)
- java_args=("${java_args[@]}" "-Djruby.compat.version=RUBY1_9") ;;
+ java_args="$java_args -Djruby.compat.version=RUBY1_9" ;;
--1.8)
- java_args=("${java_args[@]}" "-Djruby.compat.version=RUBY1_8") ;;
+ java_args="$java_args -Djruby.compat.version=RUBY1_8" ;;
# Abort processing on the double dash
--) break ;;
# Other opts go to ruby
- -*) ruby_args=("${ruby_args[@]}" "$1") ;;
+ -*) ruby_args="$ruby_args $1" ;;
# Abort processing on first non-opt arg
*) break ;;
esac
@@ -182,13 +188,15 @@ do
done
# Add a property to report memory max
-JAVA_OPTS="$JAVA_OPTS $JAVA_VM -Djruby.memory.max=${JAVA_MEM:4} -Djruby.stack.max=${JAVA_STACK:4}"
+java_mem_max=$(expr "$JAVA_MEM" : "....\(.*\)")
+java_stack_max=$(expr "$JAVA_STACK" : "....\(.*\)")
+JAVA_OPTS="$JAVA_OPTS $JAVA_VM -Djruby.memory.max=$java_mem_max -Djruby.stack.max=$java_stack_max"
# Append the rest of the arguments
-ruby_args=("${ruby_args[@]}" "$@")
+ruby_args="$ruby_args $@"
# Put the ruby_args back into the position arguments $1, $2 etc
-set -- "${ruby_args[@]}"
+set -- "$ruby_args"
JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_STACK"
@@ -196,11 +204,13 @@ 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[@]}"
+ if [ "$(expr "$1" : "\(.\).*")" = "/" ]; then
+ if [ -f "$1" -o -d "$1" ]; then
+ win_arg=`cygpath -w "$1"`
+ shift
+ win_args="$win_arg $@"
+ set -- "$win_args"
+ fi
fi
fi
@@ -209,9 +219,9 @@ if [ "$VERIFY_JRUBY" != "" ]; then
echo "Running with instrumented profiler"
fi
- $JAVA_CMD $PROFILE_ARGS $JAVA_OPTS "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMETER$CP$CP_DELIMETER$CLASSPATH" \
- "-Djruby.home=$JRUBY_HOME" \
- "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ eval $JAVA_CMD $PROFILE_ARGS $JAVA_OPTS "$java_args" -classpath "$JRUBY_CP$CP_DELIMETER$CP$CP_DELIMETER$CLASSPATH" \
+ "-Djruby.home=$JRUBY_LIBDIR" \
+ "-Djruby.lib=$JRUBY_LIBDIR" -Djruby.script=jruby \
"-Djruby.shell=$JRUBY_SHELL" \
org.jruby.Main $JRUBY_OPTS "$@"
@@ -221,9 +231,9 @@ if [ "$VERIFY_JRUBY" != "" ]; then
cat profile.txt
fi
else
- exec "$JAVA_CMD" $JAVA_OPTS "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMETER$CLASSPATH" \
- "-Djruby.home=$JRUBY_HOME" \
- "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
+ eval exec "$JAVA_CMD" $JAVA_OPTS "$java_args" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMETER$CLASSPATH" \
+ "-Djruby.home=$JRUBY_LIBDIR" \
+ "-Djruby.lib=$JRUBY_LIBDIR" -Djruby.script=jruby \
"-Djruby.shell=$JRUBY_SHELL" \
org.jruby.Main $JRUBY_OPTS "$@"
fi

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-src_org_jruby_libraries_RbConfigLibrary_java,v 1.1 2008/07/21 11:17:33 bernd Exp $
--- src/org/jruby/libraries/RbConfigLibrary.java.orig Sat Jul 19 07:10:14 2008
+++ src/org/jruby/libraries/RbConfigLibrary.java Sun Jul 20 11:02:42 2008
@@ -111,7 +111,7 @@ public class RbConfigLibrary implements Library {
} else {
normalizedHome = runtime.getJRubyHome();
}
- setConfig(configHash, "bindir", new NormalizedFile(normalizedHome, "bin").getPath());
+ setConfig(configHash, "bindir", "${PREFIX}/bin");
setConfig(configHash, "RUBY_INSTALL_NAME", jrubyScript());
setConfig(configHash, "ruby_install_name", jrubyScript());
setConfig(configHash, "SHELL", jrubyShell());

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-src_org_jruby_runtime_load_LoadService_java,v 1.2 2008/07/21 11:17:33 bernd Exp $
Add the JRUBY_LIBDIR to the library search path so we can run jruby from
anywhere.
--- src/org/jruby/runtime/load/LoadService.java.orig Sat Jul 19 07:09:36 2008
+++ src/org/jruby/runtime/load/LoadService.java Sun Jul 20 11:02:42 2008
@@ -161,6 +161,15 @@ public class LoadService {
}
}
+ // add localbase
+ char psep = '/';
+ String jrubyLibdir = "${JRUBY_LIBDIR}" + psep + "ruby" + psep;
+
+ addPath(jrubyLibdir + "site_ruby" + psep + Constants.RUBY_MAJOR_VERSION);
+ addPath(jrubyLibdir + "site_ruby");
+ addPath(jrubyLibdir + Constants.RUBY_MAJOR_VERSION);
+ addPath(jrubyLibdir + Constants.RUBY_MAJOR_VERSION + psep + "java");
+
// wrap in try/catch for security exceptions in an applet
if (!Ruby.isSecurityRestricted()) {
String jrubyHome = runtime.getJRubyHome();

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-tool_nailgun_Makefile,v 1.1 2009/08/09 11:18:59 bernd Exp $
--- tool/nailgun/Makefile.orig Sun Aug 9 12:42:49 2009
+++ tool/nailgun/Makefile Sun Aug 9 12:43:04 2009
@@ -5,9 +5,9 @@
#
# Marty Lamb
-CC=gcc
+#CC=gcc
WIN32_CC=/usr/local/mingw32/bin/mingw32-gcc
-CFLAGS=-Wall -pedantic -s -O3
+CFLAGS+=-Wall -pedantic -s
ng: src/c/ng.c
@echo "Building ng client. To build a Windows binary, type 'make ng.exe'"

1
lang/jruby/pkg/MESSAGE Normal file
View File

@ -0,0 +1 @@
Please add ${JRUBY_HOME}/bin to your PATH to access the JRuby programs.

File diff suppressed because it is too large Load Diff