From owner-svn-ports-head@freebsd.org Tue Oct 25 19:37:35 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF8FDC22D9D; Tue, 25 Oct 2016 19:37:35 +0000 (UTC) (envelope-from bsam@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B030C287; Tue, 25 Oct 2016 19:37:35 +0000 (UTC) (envelope-from bsam@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9PJbYWg031362; Tue, 25 Oct 2016 19:37:34 GMT (envelope-from bsam@FreeBSD.org) Received: (from bsam@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9PJbXsh031352; Tue, 25 Oct 2016 19:37:33 GMT (envelope-from bsam@FreeBSD.org) Message-Id: <201610251937.u9PJbXsh031352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bsam set sender to bsam@FreeBSD.org using -f From: Boris Samorodov Date: Tue, 25 Oct 2016 19:37:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r424647 - in head/comms: . java-simple-serial-connector java-simple-serial-connector/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 19:37:36 -0000 Author: bsam Date: Tue Oct 25 19:37:33 2016 New Revision: 424647 URL: https://svnweb.freebsd.org/changeset/ports/424647 Log: Library for working with serial ports in Java. WWW: https://github.com/scream3r/java-simple-serial-connector PR: 213758 Submitted by: bsdports@kyle-evans.net Added: head/comms/java-simple-serial-connector/ head/comms/java-simple-serial-connector/Makefile (contents, props changed) head/comms/java-simple-serial-connector/distinfo (contents, props changed) head/comms/java-simple-serial-connector/files/ head/comms/java-simple-serial-connector/files/build.xml.in (contents, props changed) head/comms/java-simple-serial-connector/files/patch-src_cpp___nix__based_jssc.cpp (contents, props changed) head/comms/java-simple-serial-connector/files/patch-src_cpp_jssc__SerialNativeInterface.h (contents, props changed) head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialNativeInterface.java (contents, props changed) head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPort.java (contents, props changed) head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPortList.java (contents, props changed) head/comms/java-simple-serial-connector/pkg-descr (contents, props changed) Modified: head/comms/Makefile Modified: head/comms/Makefile ============================================================================== --- head/comms/Makefile Tue Oct 25 19:27:44 2016 (r424646) +++ head/comms/Makefile Tue Oct 25 19:37:33 2016 (r424647) @@ -70,6 +70,7 @@ SUBDIR += ibp SUBDIR += java-commapi SUBDIR += java-commapi-freebsd + SUBDIR += java-simple-serial-connector SUBDIR += jerm SUBDIR += jsdr SUBDIR += kb Added: head/comms/java-simple-serial-connector/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/Makefile Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +PORTNAME= java-simple-serial-connector +PORTVERSION= 2.8.0 +DISTVERSIONPREFIX= v +CATEGORIES= comms java + +MAINTAINER= bsdports@kyle-evans.net +COMMENT= Library for working with serial ports from Java + +LICENSE= LGPL3 + +USE_GITHUB= yes +GH_ACCOUNT= scream3r + +MAJOR_MINOR= ${PORTVERSION:C/(.*)\.[0-9]*/\\1/} +USE_JAVA= yes +USE_ANT= yes +ALL_TARGET= dist +CXXFLAGS+= -I${JAVA_HOME}/include -I${JAVA_HOME}/include/freebsd +WRKSRC_LIBS= ${WRKSRC}/src/java/libs + +PLIST_FILES= ${JAVA_HOME}/jre/lib/ext/jssc-${PORTVERSION}.jar + +.include + +.if ${ARCH} == "armv6" || ${ARCH} == "aarch64" +ARCH= arm +.endif + +post-extract: + @${CP} ${FILESDIR}/build.xml.in ${WRKSRC}/build.xml + @${REINPLACE_CMD} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${WRKSRC}/build.xml + +pre-build: + ${RM} -r ${WRKSRC_LIBS}/* + ${MKDIR} ${WRKSRC_LIBS}/freebsd + (cd ${WRKSRC}/src/cpp/_nix_based && ${CXX} ${CXXFLAGS} ${CPPFLAGS} -shared -fPIC -o ${WRKSRC_LIBS}/freebsd/libjSSC-${MAJOR_MINOR}_${ARCH}.so jssc.cpp) + ${STRIP_CMD} ${WRKSRC_LIBS}/freebsd/libjSSC-${MAJOR_MINOR}_${ARCH}.so + +do-install: + @${MKDIR} ${STAGEDIR}${JAVA_HOME}/jre/lib/ext + ${CP} ${WRKSRC}/build/jssc-${PORTVERSION}.jar ${STAGEDIR}${JAVA_HOME}/jre/lib/ext + +.include Added: head/comms/java-simple-serial-connector/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/distinfo Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,3 @@ +TIMESTAMP = 1477335330 +SHA256 (scream3r-java-simple-serial-connector-v2.8.0_GH0.tar.gz) = c3287bfc31ea81929739271b087b833fb7050686af6a90ec953c5b2f41b4d42d +SIZE (scream3r-java-simple-serial-connector-v2.8.0_GH0.tar.gz) = 149937 Added: head/comms/java-simple-serial-connector/files/build.xml.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/files/build.xml.in Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Added: head/comms/java-simple-serial-connector/files/patch-src_cpp___nix__based_jssc.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/files/patch-src_cpp___nix__based_jssc.cpp Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,11 @@ +--- src/cpp/_nix_based/jssc.cpp.orig 2016-10-24 19:48:41 UTC ++++ src/cpp/_nix_based/jssc.cpp +@@ -545,7 +545,7 @@ JNIEXPORT jbyteArray JNICALL Java_jssc_S + FD_CLR(portHandle, &read_fd_set); + jbyteArray returnArray = env->NewByteArray(byteCount); + env->SetByteArrayRegion(returnArray, 0, byteCount, lpBuffer); +- delete lpBuffer; ++ delete[] lpBuffer; + return returnArray; + } + Added: head/comms/java-simple-serial-connector/files/patch-src_cpp_jssc__SerialNativeInterface.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/files/patch-src_cpp_jssc__SerialNativeInterface.h Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,11 @@ +--- src/cpp/jssc_SerialNativeInterface.h.orig 2016-10-24 19:47:55 UTC ++++ src/cpp/jssc_SerialNativeInterface.h +@@ -43,6 +43,8 @@ extern "C" { + #define jssc_SerialNativeInterface_OS_SOLARIS 2L + #undef jssc_SerialNativeInterface_OS_MAC_OS_X + #define jssc_SerialNativeInterface_OS_MAC_OS_X 3L ++#undef jssc_SerialNativeInterface_OS_FREEBSD ++#define jssc_SerialNativeInterface_OS_FREEBSD 4L + #undef jssc_SerialNativeInterface_ERR_PORT_BUSY + #define jssc_SerialNativeInterface_ERR_PORT_BUSY -1LL + #undef jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND Added: head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialNativeInterface.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialNativeInterface.java Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,62 @@ +--- src/java/jssc/SerialNativeInterface.java.orig 2014-01-24 14:34:02 UTC ++++ src/java/jssc/SerialNativeInterface.java +@@ -43,6 +43,7 @@ public class SerialNativeInterface { + public static final int OS_WINDOWS = 1; + public static final int OS_SOLARIS = 2;//since 0.9.0 + public static final int OS_MAC_OS_X = 3;//since 0.9.0 ++ public static final int OS_FREEBSD = 4; + + private static int osType = -1; + +@@ -108,36 +109,16 @@ public class SerialNativeInterface { + osName = "mac_os_x"; + osType = OS_MAC_OS_X; + }//<- since 0.9.0 ++ else if(osName.equals("FreeBSD")){ ++ osName = "freebsd"; ++ osType = OS_FREEBSD; ++ } + + if(architecture.equals("i386") || architecture.equals("i686")){ +- architecture = "x86"; ++ architecture = "i386"; + } + else if(architecture.equals("amd64") || architecture.equals("universal")){//os.arch "universal" since 2.6.0 +- architecture = "x86_64"; +- } +- else if(architecture.equals("arm")) {//since 2.1.0 +- String floatStr = "sf"; +- if(javaLibPath.toLowerCase().contains("gnueabihf") || javaLibPath.toLowerCase().contains("armhf")){ +- floatStr = "hf"; +- } +- else { +- try { +- Process readelfProcess = Runtime.getRuntime().exec("readelf -A /proc/self/exe"); +- BufferedReader reader = new BufferedReader(new InputStreamReader(readelfProcess.getInputStream())); +- String buffer = ""; +- while((buffer = reader.readLine()) != null && !buffer.isEmpty()){ +- if(buffer.toLowerCase().contains("Tag_ABI_VFP_args".toLowerCase())){ +- floatStr = "hf"; +- break; +- } +- } +- reader.close(); +- } +- catch (Exception ex) { +- //Do nothing +- } +- } +- architecture = "arm" + floatStr; ++ architecture = "amd64"; + } + + libFolderPath = libRootFolder + fileSeparator + ".jssc" + fileSeparator + osName; +@@ -259,7 +240,7 @@ public class SerialNativeInterface { + } + + /** +- * Get OS type (OS_LINUX || OS_WINDOWS || OS_SOLARIS) ++ * Get OS type (OS_LINUX || OS_WINDOWS || OS_SOLARIS || OS_FREEBSD) + * + * @since 0.8 + */ Added: head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPort.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPort.java Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,32 @@ +--- src/java/jssc/SerialPort.java.orig 2016-10-24 19:44:26 UTC ++++ src/java/jssc/SerialPort.java +@@ -264,7 +264,8 @@ public class SerialPort { + checkPortOpened("setEventsMask()"); + if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || +- SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X || ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_FREEBSD){//since 0.9.0 + linuxMask = mask; + if(mask > 0){ + maskAssigned = true; +@@ -298,7 +299,8 @@ public class SerialPort { + checkPortOpened("getEventsMask()"); + if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || +- SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X || ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_FREEBSD){//since 0.9.0 + return linuxMask; + } + return serialInterface.getEventsMask(portHandle); +@@ -1041,7 +1043,8 @@ public class SerialPort { + private EventThread getNewEventThread() { + if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || +- SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X || ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_FREEBSD){//since 0.9.0 + return new LinuxEventThread(); + } + return new EventThread(); Added: head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPortList.java ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPortList.java Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,14 @@ +--- src/java/jssc/SerialPortList.java.orig 2016-10-24 19:46:27 UTC ++++ src/java/jssc/SerialPortList.java +@@ -57,6 +57,11 @@ public class SerialPortList { + PORTNAMES_PATH = "/dev/"; + break; + } ++ case SerialNativeInterface.OS_FREEBSD: { ++ PORTNAMES_REGEXP = Pattern.compile("cuaU[0-9]{1,3}"); ++ PORTNAMES_PATH = "/dev/"; ++ break; ++ } + case SerialNativeInterface.OS_WINDOWS: { + PORTNAMES_REGEXP = Pattern.compile(""); + PORTNAMES_PATH = ""; Added: head/comms/java-simple-serial-connector/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/java-simple-serial-connector/pkg-descr Tue Oct 25 19:37:33 2016 (r424647) @@ -0,0 +1,3 @@ +Library for working with serial ports in Java. + +WWW: https://github.com/scream3r/java-simple-serial-connector