svn commit: r419271 - in head/devel/libreadline-java: . files
Baptiste Daroussin
bapt at FreeBSD.org
Fri Jul 29 22:52:27 UTC 2016
Author: bapt
Date: Fri Jul 29 22:52:24 2016
New Revision: 419271
URL: https://svnweb.freebsd.org/changeset/ports/419271
Log:
Prevent collision with getline(3)
While here regenerate the patches
Added:
head/devel/libreadline-java/files/patch-src_Makefile (contents, props changed)
head/devel/libreadline-java/files/patch-src_native_Makefile (contents, props changed)
head/devel/libreadline-java/files/patch-src_native_getline.c (contents, props changed)
head/devel/libreadline-java/files/patch-src_native_getline.h (contents, props changed)
head/devel/libreadline-java/files/patch-src_native_org__gnu__readline__Readline.c (contents, props changed)
head/devel/libreadline-java/files/patch-src_org_gnu_readline_Readline.java (contents, props changed)
Deleted:
head/devel/libreadline-java/files/patch-src-Makefile
head/devel/libreadline-java/files/patch-src-native-Makefile
head/devel/libreadline-java/files/patch-src-native-getline.c
head/devel/libreadline-java/files/patch-src-native-org_gnu_readline_Readline.c
head/devel/libreadline-java/files/patch-src-org-gnu-readline-Readline.java
Modified:
head/devel/libreadline-java/Makefile
head/devel/libreadline-java/files/patch-Makefile
Modified: head/devel/libreadline-java/Makefile
==============================================================================
--- head/devel/libreadline-java/Makefile Fri Jul 29 21:10:42 2016 (r419270)
+++ head/devel/libreadline-java/Makefile Fri Jul 29 22:52:24 2016 (r419271)
@@ -28,10 +28,6 @@ MAKE_JOBS_UNSAFE= yes
OPTIONS_DEFINE= DOCS
-post-patch:
- ${REINPLACE_CMD} -e 's|-ltermcap|-lncurses|' \
- ${WRKSRC}/src/native/Makefile
-
do-install:
${INSTALL_DATA} ${WRKSRC}/libreadline-java.jar \
${STAGEDIR}${JAVAJARDIR}
Modified: head/devel/libreadline-java/files/patch-Makefile
==============================================================================
--- head/devel/libreadline-java/files/patch-Makefile Fri Jul 29 21:10:42 2016 (r419270)
+++ head/devel/libreadline-java/files/patch-Makefile Fri Jul 29 22:52:24 2016 (r419271)
@@ -1,6 +1,6 @@
---- Makefile 2003-01-07 11:14:35.000000000 +0100
-+++ /tmp/libreadline-java-0.8.0/Makefile 2007-09-22 22:11:13.000000000 +0200
-@@ -54,11 +54,11 @@
+--- Makefile.orig 2003-01-07 10:14:35 UTC
++++ Makefile
+@@ -54,11 +54,11 @@ DOCDIR = $(PREFIX)/doc
JAVALIBDIR= $(PREFIX)/share/java
# libraries to build
@@ -14,7 +14,7 @@
ifeq (MSC,$(WIN32))
JAVA_HOME := c:/j2sdk1.4.0
-@@ -69,9 +69,14 @@
+@@ -69,9 +69,14 @@ ARGS = Getline
endif
## normal javac
@@ -30,7 +30,7 @@
## with jikes
#JAVAC = jikes
#JC_FLAGS = -O +E
-@@ -86,7 +91,7 @@
+@@ -86,7 +91,7 @@ RPM_BASE = `pwd`/$(BUILDDIR)/
world : jar build-native
jar: build-java
@@ -39,7 +39,7 @@
$(JAR):
cd $(BUILDDIR) ; jar -cvmf ../$(MF_STUB) ../$(JAR) *
-@@ -96,7 +101,7 @@
+@@ -96,7 +101,7 @@ build-java: $(BUILDDIR)
build-native:
cd src; $(MAKE) T_LIBS="$(T_LIBS)" JAVAINCLUDE="$(JAVAINCLUDE)" \
@@ -48,7 +48,7 @@
apidoc: $(APIDIR)
javadoc -sourcepath src -d $(APIDIR) -windowtitle $(WTITLE) \
-@@ -140,7 +145,7 @@
+@@ -140,7 +145,7 @@ rpm: src-dist
rpm --define _topdir$(RPM_BASE) -ba $(RPM_BASE)/SPECS/libreadline-java.spec
test: $(JAR) build-native
Added: head/devel/libreadline-java/files/patch-src_Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libreadline-java/files/patch-src_Makefile Fri Jul 29 22:52:24 2016 (r419271)
@@ -0,0 +1,11 @@
+--- src/Makefile.orig 2003-01-07 10:14:35 UTC
++++ src/Makefile
+@@ -10,7 +10,7 @@ java: always $(BUILD)
+
+ native: always
+ cd native ; $(MAKE) T_LIBS="$(T_LIBS)" JAVAINCLUDE="$(JAVAINCLUDE)" \
+- JAVANATINC="$(JAVANATINC)" all
++ JAVANATINC="$(JAVANATINC)" JAVAH="$(JAVAH)" all
+
+ $(BUILD):
+ mkdir $@
Added: head/devel/libreadline-java/files/patch-src_native_Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libreadline-java/files/patch-src_native_Makefile Fri Jul 29 22:52:24 2016 (r419271)
@@ -0,0 +1,67 @@
+--- src/native/Makefile.orig 2003-01-07 10:14:35 UTC
++++ src/native/Makefile
+@@ -38,25 +38,31 @@ ifeq (MSC,$(WIN32))
+ 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
+-INCLUDES = -I $(JAVAINCLUDE) -I $(JAVANATINC)
+-LIBPATH = -L/usr/lib/termcap
+-JavaReadline_LIBS = -lreadline -ltermcap -lhistory
+-JavaEditline_LIBS = -ledit -ltermcap
++INCLUDES = -I $(JAVAINCLUDE) -I $(JAVANATINC) -I $(LOCALBASE)/include
++ifeq (JavaEditline,$(TG))
++LIBPATH = -L$(LOCALBASE)/lib -rpath $(LOCALBASE)/lib
++endif
++ifeq (JavaReadline,$(TG))
++LIBPATH = -L$(LOCALBASE)/lib -rpath $(LOCALBASE)/lib
++endif
++JavaReadline_LIBS = -lreadline -lncurses -lhistory
++JavaEditline_LIBS = $(LOCALBASE)/lib/libedit.so -lncurses
+ ifeq (cygwin,$(WIN32))
+ JavaGetline_LIBS = -lcygwin
+ endif
+-CC = gcc
++CC = cc
+ OBJ_EXT := o
+ LIB_PRE := lib
+ LIB_EXT := so
+-CFLAGS=-fPIC -DPOSIX
++CFLAGS+=-fPIC -DPOSIX
+ endif
++JAVAH ?= javah
+
+
+ OBJECTS := org_gnu_readline_Readline.$(OBJ_EXT)
+@@ -69,13 +75,13 @@ all: $(T_LIBS)
+ lib: $(ROOTDIR)/$(LIB_PRE)$(TG).$(LIB_EXT)
+
+ JavaReadline:
+- make TG=$@ lib
++ $(MAKE) TG=$@ lib
+
+ JavaEditline:
+- make TG=$@ lib
++ $(MAKE) TG=$@ lib
+
+ JavaGetline:
+- make TG=$@ lib
++ $(MAKE) TG=$@ lib
+
+ $(ROOTDIR)/$(LIB_PRE)$(TG).$(LIB_EXT): $(OBJECTS)
+ ifeq (MSC,$(WIN32))
+@@ -110,7 +116,7 @@ org_gnu_readline_Readline.$(OBJ_EXT): or
+ -c org_gnu_readline_Readline.c
+
+ org_gnu_readline_Readline.h: $(BUILDDIR)/org/gnu/readline/Readline.class
+- javah -classpath $(BUILDDIR) -jni org.gnu.readline.Readline
++ $(JAVAH) -classpath $(BUILDDIR) -jni org.gnu.readline.Readline
+ touch org_gnu_readline_Readline.h
+
+ clean:
Added: head/devel/libreadline-java/files/patch-src_native_getline.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libreadline-java/files/patch-src_native_getline.c Fri Jul 29 22:52:24 2016 (r419271)
@@ -0,0 +1,82 @@
+--- src/native/getline.c.orig 2003-01-07 10:14:35 UTC
++++ src/native/getline.c
+@@ -41,7 +41,7 @@ char* rl_readline_name;
+
+ /********************* exported interface ********************************/
+
+-char *getline(); /* read a line of input */
++char *get_line(); /* read a line of input */
+ void gl_setwidth(); /* specify width of screen */
+ void gl_histadd(); /* adds entries to hist */
+ void gl_strwidth(); /* to bind gl_strlen */
+@@ -136,7 +136,6 @@ extern void exit();
+ #ifndef __convexc__
+ extern int read();
+ extern int kill();
+-extern int ioctl();
+ #endif /* not __convexc__ */
+ #ifdef POSIX /* use POSIX interface */
+ #include <termios.h>
+@@ -387,7 +386,7 @@ gl_init()
+ hist_init();
+ }
+ if (isatty(0) == 0 || isatty(1) == 0)
+- gl_error("\n*** Error: getline(): not interactive, use stdio.\n");
++ gl_error("\n*** Error: get_line(): not interactive, use stdio.\n");
+ gl_char_init();
+ gl_init_done = 1;
+ }
+@@ -414,7 +413,7 @@ int w;
+ }
+
+ char *
+-getline(prompt)
++get_line(prompt)
+ char *prompt;
+ {
+ int c, loc, tmp;
+@@ -585,7 +584,7 @@ int c;
+ int i;
+
+ if (gl_cnt >= BUF_SIZE - 1)
+- gl_error("\n*** Error: getline(): input buffer overflow\n");
++ gl_error("\n*** Error: get_line(): input buffer overflow\n");
+ if (gl_overwrite == 0 || gl_pos == gl_cnt) {
+ for (i=gl_cnt; i >= gl_pos; i--)
+ gl_buf[i+1] = gl_buf[i];
+@@ -608,7 +607,7 @@ gl_yank()
+ if (len > 0) {
+ if (gl_overwrite == 0) {
+ if (gl_cnt + len >= BUF_SIZE - 1)
+- gl_error("\n*** Error: getline(): input buffer overflow\n");
++ gl_error("\n*** Error: get_line(): input buffer overflow\n");
+ for (i=gl_cnt; i >= gl_pos; i--)
+ gl_buf[i+len] = gl_buf[i];
+ for (i=0; i < len; i++)
+@@ -617,7 +616,7 @@ gl_yank()
+ } else {
+ if (gl_pos + len > gl_cnt) {
+ if (gl_pos + len >= BUF_SIZE - 1)
+- gl_error("\n*** Error: getline(): input buffer overflow\n");
++ gl_error("\n*** Error: get_line(): input buffer overflow\n");
+ gl_buf[gl_pos + len] = 0;
+ }
+ for (i=0; i < len; i++)
+@@ -657,7 +656,7 @@ gl_newline()
+ int loc = gl_width - 5; /* shifts line back to start position */
+
+ if (gl_cnt >= BUF_SIZE - 1)
+- gl_error("\n*** Error: getline(): input buffer overflow\n");
++ gl_error("\n*** Error: get_line(): input buffer overflow\n");
+ if (gl_out_hook) {
+ change = gl_out_hook(gl_buf);
+ len = strlen(gl_buf);
+@@ -916,7 +915,7 @@ char *buf;
+ char *p = buf;
+ int len;
+
+- /* in case we call gl_histadd() before we call getline() */
++ /* in case we call gl_histadd() before we call get_line() */
+ if (gl_init_done < 0) { /* -1 only on startup */
+ hist_init();
+ gl_init_done = 0;
Added: head/devel/libreadline-java/files/patch-src_native_getline.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libreadline-java/files/patch-src_native_getline.h Fri Jul 29 22:52:24 2016 (r419271)
@@ -0,0 +1,29 @@
+--- src/native/getline.h.orig 2003-01-07 10:14:35 UTC
++++ src/native/getline.h
+@@ -9,7 +9,7 @@
+
+ extern char* rl_readline_name; /* unused by getline */
+ #define add_history(buffer) gl_histadd(buffer)
+-#define readline(buffer) getline(buffer)
++#define readline(buffer) get_line(buffer)
+ #define clear_history() hist_init()
+ #define using_history() hist_init()
+
+@@ -18,7 +18,7 @@ extern char* rl_readline_name;
+
+ typedef size_t (*gl_strwidth_proc)(char *);
+
+-char *getline(char *); /* read a line of input */
++char *get_line(char *); /* read a line of input */
+ void gl_setwidth(int); /* specify width of screen */
+ void gl_histadd(char *); /* adds entries to hist */
+ void gl_strwidth(gl_strwidth_proc); /* to bind gl_strlen */
+@@ -30,7 +30,7 @@ extern int (*gl_tab_hook)(char *, int, i
+
+ #else /* not __STDC__ */
+
+-char *getline();
++char *get_line();
+ void gl_setwidth();
+ void gl_histadd();
+ void gl_strwidth();
Added: head/devel/libreadline-java/files/patch-src_native_org__gnu__readline__Readline.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libreadline-java/files/patch-src_native_org__gnu__readline__Readline.c Fri Jul 29 22:52:24 2016 (r419271)
@@ -0,0 +1,33 @@
+--- src/native/org_gnu_readline_Readline.c.orig 2003-01-07 10:14:35 UTC
++++ src/native/org_gnu_readline_Readline.c
+@@ -430,7 +430,7 @@ const char *java_completer(char *text, i
+ jtext = (*jniEnv)->NewStringUTF(jniEnv,text);
+
+ if (jniMethodId == 0) {
+- return;
++ return 0;
+ }
+
+ completion = (*jniEnv)->CallObjectMethod(jniEnv, jniObject,
+@@ -560,6 +560,21 @@ JNIEXPORT void JNICALL
+ #endif
+
+ /* -------------------------------------------------------------------------- */
++/* Sets/gets rl_completion_append_character */
++/* -------------------------------------------------------------------------- */
++
++#ifndef JavaGetline
++JNIEXPORT jchar JNICALL
++Java_org_gnu_readline_Readline_setCompletionAppendCharacterImpl
++(JNIEnv * env, jclass class, jchar appendCharacter) {
++ int previous_setting = rl_completion_append_character;
++
++ rl_completion_append_character = (int)appendCharacter;
++ return (jchar)previous_setting;
++}
++#endif
++
++/* -------------------------------------------------------------------------- */
+ /* Convert utf8-string to ucs1-string . */
+ /* -------------------------------------------------------------------------- */
+
Added: head/devel/libreadline-java/files/patch-src_org_gnu_readline_Readline.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libreadline-java/files/patch-src_org_gnu_readline_Readline.java Fri Jul 29 22:52:24 2016 (r419271)
@@ -0,0 +1,52 @@
+--- src/org/gnu/readline/Readline.java.orig 2003-01-07 10:14:35 UTC
++++ src/org/gnu/readline/Readline.java
+@@ -568,6 +568,31 @@ public class Readline {
+ /////////////////////////////////////////////////////////////////////////////
+
+ /**
++ Query and set the completion append character. You might need
++ this in a {@link ReadlineCompleter} implementation. The argument
++ appendCharacter should be in the ASCII range.
++
++ <p>Supporting implementations:
++ <ul>
++ <li>GNU-Readline</li>
++ <li>Editline</li>
++ </ul>
++ </p>
++
++ */
++
++ public static char setCompletionAppendCharacter(char appendCharacter) {
++ if (iLib == ReadlineLibrary.GnuReadline || iLib == ReadlineLibrary.Editline)
++ return setCompletionAppendCharacterImpl(appendCharacter);
++ else if (iThrowException)
++ throw new UnsupportedOperationException();
++ else
++ return '\uFFFF';
++ }
++
++ /////////////////////////////////////////////////////////////////////////////
++
++ /**
+ Query the current line buffer. This returns the current content of
+ the internal line buffer. You might need this in a
+ {@link ReadlineCompleter} implementation to access the full text
+@@ -838,4 +863,17 @@ public class Readline {
+ private native static void
+ setWordBreakCharactersImpl(String wordBreakCharacters)
+ throws UnsupportedEncodingException;
++
++ /////////////////////////////////////////////////////////////////////////////
++
++ /**
++ Native implementation of setCompletionAppendCharacter()
++
++ @see
++ org.gnu.readline.Readline#setCompletionAppendCharacter(char appendCharacter)
++ */
++
++ private native static char
++ setCompletionAppendCharacterImpl(char appendCharacter);
++
+ }
More information about the svn-ports-all
mailing list