diff options
author | matoro <matoro@users.noreply.github.com> | 2022-05-06 16:23:28 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-06-30 21:46:40 +0000 |
commit | 5f6f16ac7353a21dbd8a526fd2b1fc1dac13f15f (patch) | |
tree | 965df183ddd56f14d521a2a6f9a987d1189321b3 /dev-java/rxtx | |
parent | dev-python/matplotlib: Stabilize 3.5.2-r2 sparc, #849992 (diff) | |
download | gentoo-5f6f16ac7353a21dbd8a526fd2b1fc1dac13f15f.tar.gz gentoo-5f6f16ac7353a21dbd8a526fd2b1fc1dac13f15f.tar.bz2 gentoo-5f6f16ac7353a21dbd8a526fd2b1fc1dac13f15f.zip |
dev-java/rxtx: keyword 2.2_pre2-r2 for ~ppc64
This not only builds but works on ppc64. I tested this on my system with serial ports in use using the below program:
$ cat Main.java
import gnu.io.*;
import java.util.*;
public class Main {
/**
* @return A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
*/
public static HashSet<CommPortIdentifier> getAvailableSerialPorts() {
HashSet<CommPortIdentifier> h = new HashSet<CommPortIdentifier>();
Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
while (thePorts.hasMoreElements()) {
CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
switch (com.getPortType()) {
case CommPortIdentifier.PORT_SERIAL:
try {
CommPort thePort = com.open("CommUtil", 50);
thePort.close();
h.add(com);
} catch (PortInUseException e) {
System.out.println("Port, " + com.getName() + ", is in use.");
} catch (Exception e) {
System.err.println("Failed to open port " + com.getName());
e.printStackTrace();
}
}
}
return h;
}
public static void main(String[] args) {
for (CommPortIdentifier element : getAvailableSerialPorts())
{
System.out.println(element.getName());
}
}
}
$ javac -cp /usr/share/rxtx-2/lib/RXTXcomm.jar Main.java
$ java -Djava.library.path=/usr/lib64/rxtx-2 -cp .:/usr/share/rxtx-2/lib/RXTXcomm.jar Main
/dev/ttyUSB0
/dev/ttyUSB1
Closes: https://bugs.gentoo.org/454608
Signed-off-by: matoro <matoro@users.noreply.github.com>
Closes: https://github.com/gentoo/gentoo/pull/25356
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-java/rxtx')
-rw-r--r-- | dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff | 16 | ||||
-rw-r--r-- | dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff | 20 | ||||
-rw-r--r-- | dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild | 4 |
3 files changed, 39 insertions, 1 deletions
diff --git a/dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff b/dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff new file mode 100644 index 000000000000..2f3f5d623ca9 --- /dev/null +++ b/dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff @@ -0,0 +1,16 @@ +diff --git a/src/RawImp.c b/src/RawImp.c +index 077f30e..813fcf9 100644 +--- a/src/RawImp.c ++++ b/src/RawImp.c +@@ -99,10 +99,8 @@ + # include <linux/serial.h> + # include <linux/version.h> + #endif +-#ifndef __APPLE__ /* dima */ +-#ifndef PPC ++#if !defined(__APPLE__) && !defined(PPC) && !defined(__powerpc__) && !defined(__powerpc64__) /* dima */ + #include <sys/io.h> +-#endif /* PPC */ + #endif /* dima */ + + extern int errno; diff --git a/dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff b/dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff new file mode 100644 index 000000000000..b8fa3edf5016 --- /dev/null +++ b/dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff @@ -0,0 +1,20 @@ +diff --git a/src/gnu/io/RXTXCommDriver.java b/src/gnu/io/RXTXCommDriver.java +index 3dce198..954b102 100644 +--- a/src/gnu/io/RXTXCommDriver.java ++++ b/src/gnu/io/RXTXCommDriver.java +@@ -576,6 +576,7 @@ public class RXTXCommDriver implements CommDriver + String[] Temp = { + "ttyS", // linux Serial Ports + "ttySA", // for the IPAQs ++ "ttyPZ", // for G4/G5 RackMac + "ttyUSB", // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) +@@ -608,6 +609,7 @@ public class RXTXCommDriver implements CommDriver + // linux ISI serial card + "ttyMX",// linux Moxa Smart IO cards + "ttyP", // linux Hayes ESP serial card ++ "ttyPZ", // linux PPC/PPC64 Zilog serial ports + "ttyR", // linux comtrol cards + // linux Specialix RIO serial card + "ttyS", // linux Serial Ports diff --git a/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild b/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild index 16874cfaeefa..2d39447cb63b 100644 --- a/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild +++ b/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild @@ -17,7 +17,7 @@ HOMEPAGE="http://rxtx.qbang.org/" SRC_URI="ftp://ftp.qbang.org/pub/rxtx/${MY_P}.zip" LICENSE="LGPL-2.1+" SLOT="2" -KEYWORDS="amd64 x86" +KEYWORDS="amd64 ~ppc64 x86" IUSE="lfd" RDEPEND=">=virtual/jre-1.8:* @@ -39,6 +39,8 @@ src_prepare() { eapply -p0 "${FILESDIR}/${PN}-2.1-7r2-lfd.diff" eapply -p0 "${FILESDIR}/${PN}-2.1-7r2-nouts.diff" + eapply "${FILESDIR}/${PN}-2.1-7r2-ppcioh.diff" + eapply "${FILESDIR}/${PN}-2.1-7r2-ttyPZ.diff" eapply -p0 "${FILESDIR}/${P}-limits.patch" eapply "${FILESDIR}/${P}-add-ttyACM.patch" eapply "${FILESDIR}/${P}-format-security.patch" |