aboutsummaryrefslogtreecommitdiff
path: root/devel/libreadline-java/files
diff options
context:
space:
mode:
Diffstat (limited to 'devel/libreadline-java/files')
-rw-r--r--devel/libreadline-java/files/JReadlineCompleter.py12
-rw-r--r--devel/libreadline-java/files/jython.sh.in (renamed from devel/libreadline-java/files/jython.sh)22
-rw-r--r--devel/libreadline-java/files/patch-src-native-Makefile16
-rw-r--r--devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c11
-rw-r--r--devel/libreadline-java/files/pkg-message.in5
5 files changed, 52 insertions, 14 deletions
diff --git a/devel/libreadline-java/files/JReadlineCompleter.py b/devel/libreadline-java/files/JReadlineCompleter.py
index 9eccfe314aaf..355543428f74 100644
--- a/devel/libreadline-java/files/JReadlineCompleter.py
+++ b/devel/libreadline-java/files/JReadlineCompleter.py
@@ -4,6 +4,10 @@
#
# This is rlcompleter.py from CPython 2.5.1 adapted for Jython
# and libreadline-java.
+#
+# NOTE: Jython >= 2.5 already includes rlcompleter,
+# see http://www.jython.org/docs/library/rlcompleter.html
+# This is useful for older Jython versions only!
"""TAB-completion for Jython + libreadline-java
@@ -105,9 +109,13 @@ class PyCompleter:
try:
if state == 0:
if "." in text:
- self.matches = self.attr_matches(text)
+ matches = self.attr_matches(text)
else:
- self.matches = self.global_matches(text)
+ matches = self.global_matches(text)
+ # remove duplicates and sort
+ matches = list(set(matches))
+ matches.sort()
+ self.matches = matches
return self.matches[state]
except (AttributeError, IndexError, NameError):
return None
diff --git a/devel/libreadline-java/files/jython.sh b/devel/libreadline-java/files/jython.sh.in
index 631dffbfc651..6356a48b7717 100644
--- a/devel/libreadline-java/files/jython.sh
+++ b/devel/libreadline-java/files/jython.sh.in
@@ -2,31 +2,39 @@
# Invoke Jython.
# jython.sh,v 1.5 2007/09/28 09:13:55 martin Exp
#
-# The path names below are for Jython 2.2 on FreeBSD.
+# The path names below are for Jython 2.5.3 on FreeBSD.
#
+# NOTE: Jython >= 2.5 already includes rlcompleter,
+# see http://www.jython.org/docs/library/rlcompleter.html
+# This is useful for older Jython versions only!
-CP="/usr/local/lib/jython22/jython.jar"
+if [ -d "%%LOCALBASE%%/lib/jython22" ] ; then
+ _ver=22
+else
+ _ver=
+fi
+CP="%%LOCALBASE%%/lib/jython${_ver}/jython.jar"
defs=
wrapper=
case "${JYTHON_CONSOLE:-Editline}" in
*[Ee]dit[Ll]ine)
- CP="$CP:/usr/local/share/java/classes/libreadline-java.jar"
+ CP="$CP:%%LOCALBASE%%/share/java/classes/libreadline-java.jar"
defs="-Dpython.console=org.python.util.ReadlineConsole"
defs="$defs -Dpython.console.readlinelib=Editline"
;;
*[Gg]et[Ll]ine)
- CP="$CP:/usr/local/share/java/classes/libreadline-java.jar"
+ CP="$CP:%%LOCALBASE%%/share/java/classes/libreadline-java.jar"
defs="-Dpython.console=org.python.util.ReadlineConsole"
defs="$defs -Dpython.console.readlinelib=Getline"
;;
*[Jj][Ll]ine)
- CP="$CP:/usr/local/share/java/classes/jline.jar"
+ CP="$CP:%%LOCALBASE%%/share/java/classes/jline.jar"
defs="-Dpython.console="
wrapper=jline.ConsoleRunner
;;
*[Rr]ead[Ll]ine)
- CP="$CP:/usr/local/share/java/classes/libreadline-java.jar"
+ CP="$CP:%%LOCALBASE%%/share/java/classes/libreadline-java.jar"
defs="-Dpython.console=org.python.util.ReadlineConsole"
defs="$defs -Dpython.console.readlinelib=GnuReadline"
;;
@@ -41,7 +49,7 @@ if [ -n "$CLASSPATH" ]; then
CP="$CP:$CLASSPATH"
fi
-exec java -Dpython.home="/usr/local/lib/jython22" \
+exec java -Dpython.home="%%LOCALBASE%%/lib/jython${_ver}" \
-Dpython.cachedir="${HOME}/.jython-cachedir" \
-classpath "$CP" $wrapper org.python.util.jython $defs "$@"
diff --git a/devel/libreadline-java/files/patch-src-native-Makefile b/devel/libreadline-java/files/patch-src-native-Makefile
index e12715ec5f38..781fff283a7b 100644
--- a/devel/libreadline-java/files/patch-src-native-Makefile
+++ b/devel/libreadline-java/files/patch-src-native-Makefile
@@ -1,6 +1,13 @@
---- src/native/Makefile.orig 2003-01-07 07:14:35.000000000 -0300
-+++ src/native/Makefile 2008-02-16 18:53:37.000000000 -0300
-@@ -44,10 +44,12 @@
+--- src/native/Makefile.orig 2003-01-07 11:14:35.000000000 +0100
++++ src/native/Makefile 2013-12-13 08:29:23.000000000 +0100
+@@ -38,25 +38,28 @@
+ INCLUDES = -I "c:/Programme/DevStudio/VC/include" \
+ -I $(JAVAINCLUDE) -I $(JAVANATINC)
+ LIB = "c:/Programme/DevStudio/VC/lib"
+-CC = cl
++#CC = gcc
+ OBJ_EXT := obj
+ LIB_PRE :=
LIB_EXT := dll
CFLAGS=-DWIN32=$(WIN32) -D__IBMC__
else
@@ -16,7 +23,8 @@
ifeq (cygwin,$(WIN32))
JavaGetline_LIBS = -lcygwin
endif
-@@ -55,8 +57,9 @@
+-CC = gcc
++CC = cc
OBJ_EXT := o
LIB_PRE := lib
LIB_EXT := so
diff --git a/devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c b/devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c
index 6389e13dbd5c..f7dda9011c7e 100644
--- a/devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c
+++ b/devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c
@@ -1,5 +1,14 @@
--- src/native/org_gnu_readline_Readline.c.orig 2003-01-07 11:14:35.000000000 +0100
-+++ src/native/org_gnu_readline_Readline.c 2007-09-27 09:21:14.000000000 +0200
++++ src/native/org_gnu_readline_Readline.c 2013-12-12 20:40:36.000000000 +0100
+@@ -430,7 +430,7 @@
+ jtext = (*jniEnv)->NewStringUTF(jniEnv,text);
+
+ if (jniMethodId == 0) {
+- return;
++ return 0;
+ }
+
+ completion = (*jniEnv)->CallObjectMethod(jniEnv, jniObject,
@@ -560,6 +560,21 @@
#endif
diff --git a/devel/libreadline-java/files/pkg-message.in b/devel/libreadline-java/files/pkg-message.in
new file mode 100644
index 000000000000..4c02f1058fae
--- /dev/null
+++ b/devel/libreadline-java/files/pkg-message.in
@@ -0,0 +1,5 @@
+--------------------------------------------------
+To use readline-java add the file
+%%JAVAJARDIR%%/libreadline-java.jar
+to your classpath!
+--------------------------------------------------