new package: libjansi
This commit is contained in:
parent
0686a0b769
commit
3adddff5f8
14
packages/libjansi/Makefile
Normal file
14
packages/libjansi/Makefile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
all: libjansi.so
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
||||||
|
|
||||||
|
libjansi.so: jansi.o jansi_isatty.o jansi_structs.o jansi_ttyname.o
|
||||||
|
$(CC) $^ -shared -o $@ $(LDFLAGS) $(LIBS)
|
||||||
|
|
||||||
|
install: libjansi.so
|
||||||
|
install -Dm700 -t $(PREFIX)/lib $^
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) *.o *.so
|
15
packages/libjansi/build.sh
Normal file
15
packages/libjansi/build.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
TERMUX_PKG_HOMEPAGE=https://fusesource.github.io/jansi/
|
||||||
|
TERMUX_PKG_DESCRIPTION="A small java library that allows you to use ANSI escape codes to format your console output"
|
||||||
|
TERMUX_PKG_LICENSE="Apache-2.0"
|
||||||
|
TERMUX_PKG_MAINTAINER="@termux"
|
||||||
|
TERMUX_PKG_VERSION=2.4.0
|
||||||
|
TERMUX_PKG_SRCURL=https://github.com/fusesource/jansi.git
|
||||||
|
TERMUX_PKG_GIT_BRANCH=jansi-${TERMUX_PKG_VERSION}
|
||||||
|
TERMUX_PKG_BUILD_IN_SRC=true
|
||||||
|
TERMUX_PKG_EXTRA_MAKE_ARGS="-C src/main/native PREFIX=$TERMUX_PREFIX"
|
||||||
|
|
||||||
|
termux_step_pre_configure() {
|
||||||
|
cp $TERMUX_PKG_BUILDER_DIR/Makefile $TERMUX_PKG_SRCDIR/src/main/native/
|
||||||
|
|
||||||
|
CFLAGS+=" -fPIC"
|
||||||
|
}
|
43
packages/libjansi/src-main-native-jansi_structs.c.patch
Normal file
43
packages/libjansi/src-main-native-jansi_structs.c.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
--- a/src/main/native/jansi_structs.c
|
||||||
|
+++ b/src/main/native/jansi_structs.c
|
||||||
|
@@ -34,8 +34,10 @@ void cacheTermiosFields(JNIEnv *env, job
|
||||||
|
TermiosFc.c_cflag = (*env)->GetFieldID(env, TermiosFc.clazz, "c_cflag", "J");
|
||||||
|
TermiosFc.c_lflag = (*env)->GetFieldID(env, TermiosFc.clazz, "c_lflag", "J");
|
||||||
|
TermiosFc.c_cc = (*env)->GetFieldID(env, TermiosFc.clazz, "c_cc", "[B");
|
||||||
|
+#ifndef __ANDROID__
|
||||||
|
TermiosFc.c_ispeed = (*env)->GetFieldID(env, TermiosFc.clazz, "c_ispeed", "J");
|
||||||
|
TermiosFc.c_ospeed = (*env)->GetFieldID(env, TermiosFc.clazz, "c_ospeed", "J");
|
||||||
|
+#endif
|
||||||
|
hawtjni_w_barrier();
|
||||||
|
TermiosFc.cached = 1;
|
||||||
|
}
|
||||||
|
@@ -61,12 +63,14 @@ struct termios *getTermiosFields(JNIEnv
|
||||||
|
(*env)->GetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->c_cc), (jbyte *)lpStruct->c_cc);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+#ifndef __ANDROID__
|
||||||
|
#if defined(HAVE_IOCTL)
|
||||||
|
lpStruct->c_ispeed = (*env)->GetLongField(env, lpObject, TermiosFc.c_ispeed);
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_IOCTL)
|
||||||
|
lpStruct->c_ospeed = (*env)->GetLongField(env, lpObject, TermiosFc.c_ospeed);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
return lpStruct;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -91,12 +95,14 @@ void setTermiosFields(JNIEnv *env, jobje
|
||||||
|
(*env)->SetByteArrayRegion(env, lpObject1, 0, sizeof(lpStruct->c_cc), (jbyte *)lpStruct->c_cc);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+#ifndef __ANDROID__
|
||||||
|
#if defined(HAVE_IOCTL)
|
||||||
|
(*env)->SetLongField(env, lpObject, TermiosFc.c_ispeed, (jlong)lpStruct->c_ispeed);
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_IOCTL)
|
||||||
|
(*env)->SetLongField(env, lpObject, TermiosFc.c_ospeed, (jlong)lpStruct->c_ospeed);
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user