diff options
author | Antoine Brodin <antoine@FreeBSD.org> | 2013-12-16 18:01:50 +0000 |
---|---|---|
committer | Antoine Brodin <antoine@FreeBSD.org> | 2013-12-16 18:01:50 +0000 |
commit | e107c3d2641695dde16905548e329abf58045e6c (patch) | |
tree | 38a6d5750c49d2a865d1792733f974494bc11f03 /devel/libreadline-java | |
parent | 3025f9978bf1494a5af3f02f5a586d963a991619 (diff) | |
download | ports-e107c3d2641695dde16905548e329abf58045e6c.tar.gz ports-e107c3d2641695dde16905548e329abf58045e6c.zip |
Notes
Diffstat (limited to 'devel/libreadline-java')
-rw-r--r-- | devel/libreadline-java/Makefile | 42 | ||||
-rw-r--r-- | devel/libreadline-java/files/JReadlineCompleter.py | 12 | ||||
-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-Makefile | 16 | ||||
-rw-r--r-- | devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c | 11 | ||||
-rw-r--r-- | devel/libreadline-java/files/pkg-message.in (renamed from devel/libreadline-java/pkg-message) | 0 |
6 files changed, 65 insertions, 38 deletions
diff --git a/devel/libreadline-java/Makefile b/devel/libreadline-java/Makefile index 259cf4d95c99..7d8840e91d07 100644 --- a/devel/libreadline-java/Makefile +++ b/devel/libreadline-java/Makefile @@ -4,7 +4,7 @@ PORTNAME= libreadline-java PORTVERSION= 0.8.0 DISTVERSIONSUFFIX= -src -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel java MASTER_SITES= SF/java-readline/java-readline/${PORTVERSION} @@ -17,39 +17,33 @@ RUN_DEPENDS= ${LOCALBASE}/include/editline/readline.h:${PORTSDIR}/devel/libedit ALL_TARGET= # empty MAKE_ENV= JAVA_HOME="${JAVA_HOME}" JAVA="${JAVA}" JAVAC="${JAVAC}" \ JAVAH="${JAVAH}" JAR_="${JAR}" -PKGMESSAGE= ${WRKDIR}/pkg-message +SUB_FILES= pkg-message jython.sh PLIST_FILES= %%JAVAJARDIR%%/libreadline-java.jar lib/libJavaReadline.so \ lib/libJavaEditline.so lib/libJavaGetline.so -.if !defined(NOPORTDOCS) -PLIST_FILES+= %%DOCSDIR%%/README.1st %%DOCSDIR%%/README \ - %%DOCSDIR%%/jython.sh %%DOCSDIR%%/JReadlineCompleter.py \ - @dirrm\ %%DOCSDIR%% -.endif -USE_GMAKE= yes +PORTDOCS= README.1st README jython.sh JReadlineCompleter.py +USES= gmake USE_JAVA= yes USE_LDCONFIG= yes WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} MAKE_JOBS_UNSAFE= yes -NO_STAGE= yes +OPTIONS_DEFINE= DOCS + +.include <bsd.port.options.mk> + do-install: - ${INSTALL_DATA} ${WRKSRC}/libreadline-java.jar ${JAVAJARDIR} - ${INSTALL_DATA} ${WRKSRC}/libJavaReadline.so ${PREFIX}/lib - ${INSTALL_DATA} ${WRKSRC}/libJavaEditline.so ${PREFIX}/lib - ${INSTALL_DATA} ${WRKSRC}/libJavaGetline.so ${PREFIX}/lib -.if !defined(NOPORTDOCS) - ${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/README.1st ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} - ${INSTALL_DATA} ${FILESDIR}/jython.sh ${DOCSDIR} - ${INSTALL_DATA} ${FILESDIR}/JReadlineCompleter.py ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/libreadline-java.jar ${STAGEDIR}${JAVAJARDIR} + ${INSTALL_DATA} ${WRKSRC}/libJavaReadline.so ${STAGEDIR}${PREFIX}/lib + ${INSTALL_DATA} ${WRKSRC}/libJavaEditline.so ${STAGEDIR}${PREFIX}/lib + ${INSTALL_DATA} ${WRKSRC}/libJavaGetline.so ${STAGEDIR}${PREFIX}/lib +.if ${PORT_OPTIONS:MDOCS} + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README.1st ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKDIR}/jython.sh ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${FILESDIR}/JReadlineCompleter.py ${STAGEDIR}${DOCSDIR} .endif -post-install: - @${SED} -e 's|%%JAVAJARDIR%%|${JAVAJARDIR}|g' -- \ - ${.CURDIR}/pkg-message >${PKGMESSAGE} - @${CAT} ${PKGMESSAGE} - .if !defined(BATCH) test: cd ${WRKSRC} && ${MAKE_ENV} ${GMAKE} test # Now type something! 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/pkg-message b/devel/libreadline-java/files/pkg-message.in index 4c02f1058fae..4c02f1058fae 100644 --- a/devel/libreadline-java/pkg-message +++ b/devel/libreadline-java/files/pkg-message.in |