Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-java/jruby/files: jruby-1.4.0-system-jars-r2.patch
Date: Sun, 31 Jan 2010 17:19:13
Message-Id: E1NbdS2-0000u6-UP@stork.gentoo.org
1 flameeyes 10/01/31 17:19:10
2
3 Added: jruby-1.4.0-system-jars-r2.patch
4 Log:
5 Require a new version of jffi so that the jruby wrapper has one less java-config call. Also drop RubyGems and leave it to dev-ruby/rubygems to install it.
6 (Portage version: 2.2_rc62/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-java/jruby/files/jruby-1.4.0-system-jars-r2.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/files/jruby-1.4.0-system-jars-r2.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/jruby/files/jruby-1.4.0-system-jars-r2.patch?rev=1.1&content-type=text/plain
13
14 Index: jruby-1.4.0-system-jars-r2.patch
15 ===================================================================
16 Index: jruby-1.4.0/bin/jruby
17 ===================================================================
18 --- jruby-1.4.0.orig/bin/jruby
19 +++ jruby-1.4.0/bin/jruby
20 @@ -11,26 +11,17 @@
21 #
22 # -----------------------------------------------------------------------------
23
24 -cygwin=false
25 -
26 # ----- Identify OS we are running under --------------------------------------
27 case "`uname`" in
28 - CYGWIN*) cygwin=true;;
29 Darwin) darwin=true;;
30 esac
31
32 -#
33 -# Figure out the OS and cpu the same as JNA would, so the library path can be set
34 -#
35 -case "`uname -m`" in
36 - i[34567]86) JNA_CPU=i386; JNA_ALT_CPU=amd64;;
37 - i86pc) JNA_CPU="x86"; JNA_ALT_CPU=amd64;;
38 - amd64|x86_64) JNA_CPU=amd64; JNA_ALT_CPU=i386;;
39 - sparc*) JNA_CPU=sparc; JNA_ALT_CPU=sparcv9;;
40 -esac
41 -
42 # ----- Verify and Set Required Environment Variables -------------------------
43
44 +# This will be filled in by the ebuild after install
45 +JRUBY_HOME=
46 +
47 +# ++ebuild-cut-here++
48 ## resolve links - $0 may be a link to home
49 PRG=$0
50 progname=`basename "$0"`
51 @@ -49,13 +40,16 @@ while [ -h "$PRG" ] ; do
52 fi
53 done
54
55 -JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
56 -if [ "$JRUBY_HOME_1" = '.' ] ; then
57 - cwd=`pwd`
58 - JRUBY_HOME=`dirname $cwd` # JRUBY-2699
59 -else
60 - JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
61 +if [ -z "$JRUBY_HOME" ]; then
62 + JRUBY_HOME_1=`dirname "$PRG"` # the ./bin dir
63 + if [ "$JRUBY_HOME_1" = '.' ] ; then
64 + cwd=`pwd`
65 + JRUBY_HOME=`dirname $cwd` # JRUBY-2699
66 + else
67 + JRUBY_HOME=`dirname "$JRUBY_HOME_1"` # the . dir
68 + fi
69 fi
70 +# --ebuild-cut-here--
71
72 if [ -z "$JRUBY_OPTS" ] ; then
73 JRUBY_OPTS=""
74 @@ -84,72 +78,17 @@ for opt in ${JRUBY_OPTS[@]}; do
75 done
76 JRUBY_OPTS=${JRUBY_OPTS_TEMP}
77
78 -if [ -z "$JAVA_HOME" ] ; then
79 - JAVA_CMD='java'
80 -else
81 - if $cygwin; then
82 - JAVA_HOME=`cygpath -u "$JAVA_HOME"`
83 - fi
84 - JAVA_CMD="$JAVA_HOME/bin/java"
85 -fi
86 -
87 -# If you're seeing odd exceptions, you may have a bad JVM install.
88 -# Uncomment this and report the version to the JRuby team along with error.
89 -#$JAVA_CMD -version
90 -
91 JRUBY_SHELL=/bin/sh
92
93 # ----- Set Up The Boot Classpath -------------------------------------------
94
95 -CP_DELIMITER=":"
96 -
97 -# add jruby jars for command-line execution
98 -for j in "$JRUBY_HOME"/lib/{jruby*,bsf}.jar; do
99 - if [ "$JRUBY_CP" ]; then
100 - JRUBY_CP="$JRUBY_CP$CP_DELIMITER$j"
101 - else
102 - JRUBY_CP="$j"
103 - fi
104 -done
105 -
106 -if $cygwin; then
107 - JRUBY_CP=`cygpath -p -w "$JRUBY_CP"`
108 -fi
109 -
110 -# ----- Set Up The System Classpath -------------------------------------------
111 -
112 -if [ "$JRUBY_PARENT_CLASSPATH" != "" ]; then
113 - # Use same classpath propagated from parent jruby
114 - CP=$JRUBY_PARENT_CLASSPATH
115 -else
116 - # add other jars in lib to CP for command-line execution
117 - for j in "$JRUBY_HOME"/lib/*.jar; do
118 - if [ "$CP" ]; then
119 - CP="$CP$CP_DELIMITER$j"
120 - else
121 - CP="$j"
122 - fi
123 - done
124 -
125 - if $cygwin; then
126 - CP=`cygpath -p -w "$CP"`
127 - fi
128 -fi
129 -
130 -if $cygwin; then
131 - # switch delimiter only after building Unix style classpaths
132 - CP_DELIMITER=";"
133 -fi
134 +JRUBY_CP=$(java-config -d -p jruby)
135 +CP=${JRUBY_PARENT_CLASSPATH}
136
137 # ----- Execute The Requested Command -----------------------------------------
138
139 -if [ -z "$JAVA_MEM" ] ; then
140 - JAVA_MEM=-Xmx500m
141 -fi
142 -
143 -if [ -z "$JAVA_STACK" ] ; then
144 - JAVA_STACK=-Xss1024k
145 -fi
146 +JAVA_MEM=${JAVA_MEM:--Xmx500m}
147 +JAVA_STACK=${JAVA_STACK:--Xss1024k}
148
149 JAVA_VM=-client
150 JAVA_ENCODING=""
151 @@ -172,18 +111,18 @@ do
152 elif [ "${val:0:4}" = "-Xss" ]; then
153 JAVA_STACK=$val
154 elif [ "${val}" = "" ]; then
155 - $JAVA_CMD -help
156 + java -help
157 echo "(Prepend -J in front of these options when using 'jruby' command)"
158 exit
159 elif [ "${val}" = "-X" ]; then
160 - $JAVA_CMD -X
161 + java -X
162 echo "(Prepend -J in front of these options when using 'jruby' command)"
163 exit
164 elif [ "${val}" = "-classpath" ]; then
165 - CP="$CP$CP_DELIMITER$2"
166 + CP="$CP:$2"
167 shift
168 elif [ "${val}" = "-cp" ]; then
169 - CP="$CP$CP_DELIMITER$2"
170 + CP="$CP:$2"
171 shift
172 else
173 if [ "${val:0:3}" = "-ea" ]; then
174 @@ -221,14 +160,7 @@ do
175 java_args=("${java_args[@]}" "-Djava.awt.headless=true") ;;
176 # Run under JDB
177 --jdb)
178 - if [ -z "$JAVA_HOME" ] ; then
179 - JAVA_CMD='jdb'
180 - else
181 - if $cygwin; then
182 - JAVA_HOME=`cygpath -u "$JAVA_HOME"`
183 - fi
184 - JAVA_CMD="$JAVA_HOME/bin/jdb"
185 - fi
186 + JAVA_CMD='jdb'
187 java_args=("${java_args[@]}" "-sourcepath" "$JRUBY_HOME/lib/ruby/1.8:.")
188 JRUBY_OPTS=("${JRUBY_OPTS[@]}" "-X+C") ;;
189 --client)
190 @@ -270,57 +202,17 @@ ruby_args=("${ruby_args[@]}" "$@")
191 set -- "${ruby_args[@]}"
192
193 JAVA_OPTS="$JAVA_OPTS $JAVA_MEM $JAVA_STACK"
194 -JNA_OS="`uname -s | tr '[:upper:]' '[:lower:]'`"
195 -case "$JNA_OS" in
196 -darwin) JNA_PATH="$JRUBY_HOME/lib/native/darwin";;
197 - *) JNA_PATH="$JRUBY_HOME/lib/native/${JNA_OS}-${JNA_CPU}:$JRUBY_HOME/lib/native/${JNA_OS}-${JNA_ALT_CPU}";;
198 -esac
199 -#JAVA_OPTS="$JAVA_OPTS -Djna.boot.library.path=$JNA_PATH"
200 -JAVA_JNA="-Djna.boot.library.path=$JNA_PATH"
201
202 -JFFI_BOOT=""
203 -for d in $JRUBY_HOME/lib/native/*`uname -s`; do
204 - if [ -z "$JFFI_BOOT" ]; then
205 - JFFI_BOOT="$d"
206 - else
207 - JFFI_BOOT="$JFFI_BOOT:$d"
208 - fi
209 -done
210 -JFFI_OPTS="-Djffi.boot.library.path=$JFFI_BOOT"
211 -
212 -if $cygwin; then
213 - JRUBY_HOME=`cygpath --mixed "$JRUBY_HOME"`
214 - JRUBY_SHELL=`cygpath --mixed "$JRUBY_SHELL"`
215 -
216 - if [[ ( "${1:0:1}" = "/" ) && ( ( -f "$1" ) || ( -d "$1" )) ]]; then
217 - win_arg=`cygpath -w "$1"`
218 - shift
219 - win_args=("$win_arg" "$@")
220 - set -- "${win_args[@]}"
221 - fi
222 -
223 - # fix JLine to use UnixTerminal
224 - stty -icanon min 1 -echo > /dev/null 2>&1
225 - if [ $? = 0 ]; then
226 - JAVA_OPTS="$JAVA_OPTS -Djline.terminal=jline.UnixTerminal"
227 - fi
228 -
229 -fi
230 +JAVA_JNA="-Djna.boot.library.path=$(java-config -i jna)"
231
232 if [ "$nailgun_client" != "" ]; then
233 - if [ -f $JRUBY_HOME/tool/nailgun/ng ]; then
234 - exec $JRUBY_HOME/tool/nailgun/ng org.jruby.util.NailMain $JRUBY_OPTS "$@"
235 - else
236 - echo "error: ng executable not found; run 'make' in ${JRUBY_HOME}/tool/nailgun"
237 - exit 1
238 - fi
239 -else
240 -if [ "$VERIFY_JRUBY" != "" ]; then
241 + exec /usr/bin/ng org.jruby.util.NailMain $JRUBY_OPTS "$@"
242 +elif [ "$VERIFY_JRUBY" != "" ]; then
243 if [ "$PROFILE_ARGS" != "" ]; then
244 echo "Running with instrumented profiler"
245 fi
246
247 - "$JAVA_CMD" $PROFILE_ARGS $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -classpath "$JRUBY_CP$CP_DELIMITER$CP$CP_DELIMITER$CLASSPATH" \
248 + "${JAVA_CMD:-java}" $PROFILE_ARGS $JAVA_OPTS "$JAVA_JNA" "${java_args[@]}" -classpath "$JRUBY_CP:$CP:$CLASSPATH" \
249 "-Djruby.home=$JRUBY_HOME" \
250 "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
251 "-Djruby.shell=$JRUBY_SHELL" \
252 @@ -335,34 +228,13 @@ if [ "$VERIFY_JRUBY" != "" ]; then
253 rm profile.txt
254 fi
255
256 - if $cygwin; then
257 - stty icanon echo > /dev/null 2>&1
258 - fi
259 -
260 exit $JRUBY_STATUS
261 else
262 - if $cygwin; then
263 - # exec doed not work correctly with cygwin bash
264 - "$JAVA_CMD" $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
265 - "-Djruby.home=$JRUBY_HOME" \
266 - "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
267 - "-Djruby.shell=$JRUBY_SHELL" \
268 - $java_class $JRUBY_OPTS "$@"
269 -
270 - # Record the exit status immediately, or it will be overridden.
271 - JRUBY_STATUS=$?
272 -
273 - stty icanon echo > /dev/null 2>&1
274 -
275 - exit $JRUBY_STATUS
276 - else
277 - exec "$JAVA_CMD" $JAVA_OPTS "$JAVA_JNA" "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
278 - "-Djruby.home=$JRUBY_HOME" \
279 - "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
280 - "-Djruby.shell=$JRUBY_SHELL" \
281 - $java_class $JRUBY_OPTS "$@"
282 - fi
283 -fi
284 + exec "${JAVA_CMD:-java}" $JAVA_OPTS "$JAVA_JNA" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP:$CLASSPATH" \
285 + "-Djruby.home=$JRUBY_HOME" \
286 + "-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
287 + "-Djruby.shell=$JRUBY_SHELL" \
288 + $java_class $JRUBY_OPTS "$@"
289 fi
290
291 # Be careful adding code down here, you might override the exit