Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/rxtx/, dev-java/rxtx/files/
Date: Thu, 30 Jun 2022 21:47:40
Message-Id: 1656625600.5f6f16ac7353a21dbd8a526fd2b1fc1dac13f15f.sam@gentoo
1 commit: 5f6f16ac7353a21dbd8a526fd2b1fc1dac13f15f
2 Author: matoro <matoro <AT> users <DOT> noreply <DOT> github <DOT> com>
3 AuthorDate: Fri May 6 20:23:28 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 21:46:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f6f16ac
7
8 dev-java/rxtx: keyword 2.2_pre2-r2 for ~ppc64
9
10 This not only builds but works on ppc64. I tested this on my system with serial ports in use using the below program:
11
12 $ cat Main.java
13 import gnu.io.*;
14 import java.util.*;
15
16 public class Main {
17 /**
18 * @return A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
19 */
20 public static HashSet<CommPortIdentifier> getAvailableSerialPorts() {
21 HashSet<CommPortIdentifier> h = new HashSet<CommPortIdentifier>();
22 Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
23 while (thePorts.hasMoreElements()) {
24 CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
25 switch (com.getPortType()) {
26 case CommPortIdentifier.PORT_SERIAL:
27 try {
28 CommPort thePort = com.open("CommUtil", 50);
29 thePort.close();
30 h.add(com);
31 } catch (PortInUseException e) {
32 System.out.println("Port, " + com.getName() + ", is in use.");
33 } catch (Exception e) {
34 System.err.println("Failed to open port " + com.getName());
35 e.printStackTrace();
36 }
37 }
38 }
39 return h;
40 }
41
42 public static void main(String[] args) {
43 for (CommPortIdentifier element : getAvailableSerialPorts())
44 {
45 System.out.println(element.getName());
46 }
47 }
48 }
49
50 $ javac -cp /usr/share/rxtx-2/lib/RXTXcomm.jar Main.java
51 $ java -Djava.library.path=/usr/lib64/rxtx-2 -cp .:/usr/share/rxtx-2/lib/RXTXcomm.jar Main
52 /dev/ttyUSB0
53 /dev/ttyUSB1
54
55 Closes: https://bugs.gentoo.org/454608
56 Signed-off-by: matoro <matoro <AT> users.noreply.github.com>
57 Closes: https://github.com/gentoo/gentoo/pull/25356
58 Signed-off-by: Sam James <sam <AT> gentoo.org>
59
60 dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff | 16 ++++++++++++++++
61 dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff | 20 ++++++++++++++++++++
62 dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild | 4 +++-
63 3 files changed, 39 insertions(+), 1 deletion(-)
64
65 diff --git a/dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff b/dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff
66 new file mode 100644
67 index 000000000000..2f3f5d623ca9
68 --- /dev/null
69 +++ b/dev-java/rxtx/files/rxtx-2.1-7r2-ppcioh.diff
70 @@ -0,0 +1,16 @@
71 +diff --git a/src/RawImp.c b/src/RawImp.c
72 +index 077f30e..813fcf9 100644
73 +--- a/src/RawImp.c
74 ++++ b/src/RawImp.c
75 +@@ -99,10 +99,8 @@
76 + # include <linux/serial.h>
77 + # include <linux/version.h>
78 + #endif
79 +-#ifndef __APPLE__ /* dima */
80 +-#ifndef PPC
81 ++#if !defined(__APPLE__) && !defined(PPC) && !defined(__powerpc__) && !defined(__powerpc64__) /* dima */
82 + #include <sys/io.h>
83 +-#endif /* PPC */
84 + #endif /* dima */
85 +
86 + extern int errno;
87
88 diff --git a/dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff b/dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff
89 new file mode 100644
90 index 000000000000..b8fa3edf5016
91 --- /dev/null
92 +++ b/dev-java/rxtx/files/rxtx-2.1-7r2-ttyPZ.diff
93 @@ -0,0 +1,20 @@
94 +diff --git a/src/gnu/io/RXTXCommDriver.java b/src/gnu/io/RXTXCommDriver.java
95 +index 3dce198..954b102 100644
96 +--- a/src/gnu/io/RXTXCommDriver.java
97 ++++ b/src/gnu/io/RXTXCommDriver.java
98 +@@ -576,6 +576,7 @@ public class RXTXCommDriver implements CommDriver
99 + String[] Temp = {
100 + "ttyS", // linux Serial Ports
101 + "ttySA", // for the IPAQs
102 ++ "ttyPZ", // for G4/G5 RackMac
103 + "ttyUSB", // for USB frobs
104 + "rfcomm", // bluetooth serial device
105 + "ttyircomm", // linux IrCommdevices (IrDA serial emu)
106 +@@ -608,6 +609,7 @@ public class RXTXCommDriver implements CommDriver
107 + // linux ISI serial card
108 + "ttyMX",// linux Moxa Smart IO cards
109 + "ttyP", // linux Hayes ESP serial card
110 ++ "ttyPZ", // linux PPC/PPC64 Zilog serial ports
111 + "ttyR", // linux comtrol cards
112 + // linux Specialix RIO serial card
113 + "ttyS", // linux Serial Ports
114
115 diff --git a/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild b/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild
116 index 16874cfaeefa..2d39447cb63b 100644
117 --- a/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild
118 +++ b/dev-java/rxtx/rxtx-2.2_pre2-r2.ebuild
119 @@ -17,7 +17,7 @@ HOMEPAGE="http://rxtx.qbang.org/"
120 SRC_URI="ftp://ftp.qbang.org/pub/rxtx/${MY_P}.zip"
121 LICENSE="LGPL-2.1+"
122 SLOT="2"
123 -KEYWORDS="amd64 x86"
124 +KEYWORDS="amd64 ~ppc64 x86"
125 IUSE="lfd"
126
127 RDEPEND=">=virtual/jre-1.8:*
128 @@ -39,6 +39,8 @@ src_prepare() {
129
130 eapply -p0 "${FILESDIR}/${PN}-2.1-7r2-lfd.diff"
131 eapply -p0 "${FILESDIR}/${PN}-2.1-7r2-nouts.diff"
132 + eapply "${FILESDIR}/${PN}-2.1-7r2-ppcioh.diff"
133 + eapply "${FILESDIR}/${PN}-2.1-7r2-ttyPZ.diff"
134 eapply -p0 "${FILESDIR}/${P}-limits.patch"
135 eapply "${FILESDIR}/${P}-add-ttyACM.patch"
136 eapply "${FILESDIR}/${P}-format-security.patch"