diff options
author | mi <mi@FreeBSD.org> | 2016-06-30 15:42:20 +0800 |
---|---|---|
committer | mi <mi@FreeBSD.org> | 2016-06-30 15:42:20 +0800 |
commit | 8ce0122cebad8b9168a11ce63c48424608d036f9 (patch) | |
tree | 0da080f30cf90886b91fcff64c8f9b1f066b35ea /java | |
parent | 3bc5d9992087d3180a7b2e5c8d1d521906fd3e1f (diff) | |
download | freebsd-ports-gnome-8ce0122cebad8b9168a11ce63c48424608d036f9.tar.gz freebsd-ports-gnome-8ce0122cebad8b9168a11ce63c48424608d036f9.tar.zst freebsd-ports-gnome-8ce0122cebad8b9168a11ce63c48424608d036f9.zip |
Add port of JXGrabKey -- a Java library for working with X11
keys.
Diffstat (limited to 'java')
-rw-r--r-- | java/Makefile | 1 | ||||
-rw-r--r-- | java/jxgrabkey/Makefile | 42 | ||||
-rw-r--r-- | java/jxgrabkey/distinfo | 3 | ||||
-rw-r--r-- | java/jxgrabkey/files/Makefile.JXGrabKey | 14 | ||||
-rw-r--r-- | java/jxgrabkey/files/patch-shlib-path | 9 | ||||
-rw-r--r-- | java/jxgrabkey/files/patch-warnings | 24 | ||||
-rw-r--r-- | java/jxgrabkey/pkg-descr | 4 |
7 files changed, 97 insertions, 0 deletions
diff --git a/java/Makefile b/java/Makefile index 87ab0d699444..681e2616dc9a 100644 --- a/java/Makefile +++ b/java/Makefile @@ -91,6 +91,7 @@ SUBDIR += jtiger SUBDIR += jump SUBDIR += junit + SUBDIR += jxgrabkey SUBDIR += langspec SUBDIR += linux-oracle-jdk18 SUBDIR += linux-oracle-jre18 diff --git a/java/jxgrabkey/Makefile b/java/jxgrabkey/Makefile new file mode 100644 index 000000000000..b7720f9067dd --- /dev/null +++ b/java/jxgrabkey/Makefile @@ -0,0 +1,42 @@ +# Created by: Mikhail T. <mi@aldan.algebra.com> +# $FreeBSD$ + +PORTNAME= jxgrabkey +PORTVERSION= 0.3.2 +CATEGORIES= java devel +MASTER_SITES= SF +DISTFILES= ${PORTNAME}-${PORTVERSION}_src${EXTRACT_SUFX} + +MAINTAINER= mi@aldan.algebra.com +COMMENT= JNI library for easy use of global X11 hotkeys from Java + +LICENSE= LGPL3 + +USES= tar:bz2 +USE_JAVA= yes +USE_ANT= yes +OPTIONS_DEFINE= TEST +TEST_BUILD_DEPENDS= ${JAVALIBDIR}/junit.jar:java/junit \ + ${JAVALIBDIR}/hamcrest.jar:java/hamcrest +MAKE_ENV+= JAVA_HOME=${JAVA_HOME} OPSYS=${OPSYS} +PLIST_FILES= %%JAVAJARDIR%%/JXGrabKey.jar lib/libJXGrabKey.so +USE_LDCONFIG= yes + +do-build: + ${SETENV} ${MAKE_ENV} ${MAKE} -C ${WRKSRC}/JXGrabKey/C++ \ + -f ${FILESDIR}/Makefile.JXGrabKey + cd ${WRKSRC}/JXGrabKey/Java && ${ANT} -verbose jar + +do-install: + ${INSTALL_LIB} ${WRKSRC}/JXGrabKey/C++/libJXGrabKey.so ${STAGEDIR}${PREFIX}/lib/ + ${INSTALL_DATA} ${WRKSRC}/JXGrabKey/Java/dist/JXGrabKey.jar ${STAGEDIR}${JAVAJARDIR}/ + +do-test-TEST-on: build + ${ECHO_MSG} Tests require a valid DISPLAY + cd ${WRKSRC}/JXGrabKey/Java && \ + ${SETENV} CLASSPATH=${JAVALIBDIR}/junit.jar:${JAVALIBDIR}/hamcrest.jar \ + LD_LIBRARY_PATH=${WRKSRC}/JXGrabKey/C++ \ + ${ANT} -Djavac.classpath=${JAVALIBDIR}/junit.jar \ + test + +.include <bsd.port.mk> diff --git a/java/jxgrabkey/distinfo b/java/jxgrabkey/distinfo new file mode 100644 index 000000000000..f614f62a71a3 --- /dev/null +++ b/java/jxgrabkey/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1467261857 +SHA256 (jxgrabkey-0.3.2_src.tar.bz2) = 2465c556f5e4100931f68d35d1211ac65dd92773cb58775585abb9e55c32c66c +SIZE (jxgrabkey-0.3.2_src.tar.bz2) = 32061 diff --git a/java/jxgrabkey/files/Makefile.JXGrabKey b/java/jxgrabkey/files/Makefile.JXGrabKey new file mode 100644 index 000000000000..06298499b5bd --- /dev/null +++ b/java/jxgrabkey/files/Makefile.JXGrabKey @@ -0,0 +1,14 @@ +# $FreeBSD$ + +LIB_CXX= JXGrabKey +SHLIB_NAME= lib${LIB_CXX}.so +NO_PROFILE= nope + +SRCS= JXGrabKey.cpp +VPATH= src +CXXFLAGS+= -I${JAVA_HOME}/include \ + -I${JAVA_HOME}/include/${OPSYS:tl} \ + -I${LOCALBASE}/include +LDADD= -L${LOCALBASE}/lib -lX11 + +.include <bsd.lib.mk> diff --git a/java/jxgrabkey/files/patch-shlib-path b/java/jxgrabkey/files/patch-shlib-path new file mode 100644 index 000000000000..abf4176a1365 --- /dev/null +++ b/java/jxgrabkey/files/patch-shlib-path @@ -0,0 +1,9 @@ +--- JXGrabKey/Java/test/jxgrabkey/JXGrabKeyTest.java 2010-02-28 10:11:49.000000000 -0500 ++++ JXGrabKey/Java/test/jxgrabkey/JXGrabKeyTest.java 2016-06-30 02:51:50.285529000 -0400 +@@ -16,5 +16,5 @@ + @BeforeClass + public static void setUpClass() throws Exception { +- System.load(new File("../C++/dist/Release/GNU-Linux-x86/libJXGrabKey.so").getCanonicalPath()); ++ System.loadLibrary("JXGrabKey"); + JXGrabKey.setDebugOutput(true); + JXGrabKey.getInstance(); diff --git a/java/jxgrabkey/files/patch-warnings b/java/jxgrabkey/files/patch-warnings new file mode 100644 index 000000000000..fed1556455b8 --- /dev/null +++ b/java/jxgrabkey/files/patch-warnings @@ -0,0 +1,24 @@ +--- JXGrabKey/C++/src/JXGrabKey.cpp 2010-02-28 10:11:49.000000000 -0500 ++++ JXGrabKey/C++/src/JXGrabKey.cpp 2016-06-30 03:15:41.718599000 -0400 +@@ -24,4 +24,5 @@ + #include <X11/Xlib.h> + #include <X11/keysym.h> ++#include <X11/XKBlib.h> + + #include <pthread.h> +@@ -319,5 +320,5 @@ + + XSetErrorHandler((XErrorHandler) xErrorHandler); +- pthread_spin_init(&x_lock, NULL); // init here bcoz of the returns ++ pthread_spin_init(&x_lock, PTHREAD_PROCESS_SHARED); // init here bcoz of the returns + + doListen = true; +@@ -347,6 +348,6 @@ + << keys.at(i).id + << "; type = KeyPress; x11Keycode = '" +- << XKeysymToString(XKeycodeToKeysym(dpy, +- ev.xkey.keycode, 0)) << "' (0x" ++ << XKeysymToString(XkbKeycodeToKeysym(dpy, ++ ev.xkey.keycode, 0, 0)) << "' (0x" + << std::hex << ev.xkey.keycode + << "); x11Mask = 0x" << std::hex diff --git a/java/jxgrabkey/pkg-descr b/java/jxgrabkey/pkg-descr new file mode 100644 index 000000000000..b028b2a22e63 --- /dev/null +++ b/java/jxgrabkey/pkg-descr @@ -0,0 +1,4 @@ +JXGrabKey is a jni library for easy use of global X11 hotkeys on +from Java. + +WWW: http://jxgrabkey.sourceforge.net/ |