summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuan Liao <liaoyuan@gmail.com>2022-02-20 06:54:56 -0800
committerMiroslav Šulc <fordfrog@gentoo.org>2022-02-21 10:19:44 +0100
commitf8f2919fe3bbe0063e50b32c7346dde31bd0e174 (patch)
tree915a2f57f22fd98eed7c8c5d9e5646d059dbe85d /dev-java/rxtx/files
parentdev-java/swingx-beaninfo: eapi8, min java 1.8 (diff)
downloadgentoo-f8f2919fe3bbe0063e50b32c7346dde31bd0e174.tar.gz
gentoo-f8f2919fe3bbe0063e50b32c7346dde31bd0e174.tar.bz2
gentoo-f8f2919fe3bbe0063e50b32c7346dde31bd0e174.zip
dev-java/rxtx: Fix various build errors for Java 11+ and others, EAPI 8
- Fix compiler errors due to -Werror=format-security - Fix Javadoc generation errors - Replace 'javah' with 'javac -h' for JDK 10+ - Attempt to fix some random, nondeterministic build-time errors that were speculated to be caused by parallel 'make'. Those errors are not always reproducible and may go away during a retry, which might have stopped some users (including the commit author himself) from reporting them. Another random error popped up when the new ebuild revision was being tested, hence a fix that forces sequential build is attempted in the hope to prevent probable random errors. Bug: https://bugs.gentoo.org/550534 Bug: https://bugs.gentoo.org/642030 Bug: https://bugs.gentoo.org/831394 Bug: https://bugs.gentoo.org/833396 Signed-off-by: Yuan Liao <liaoyuan@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/24289 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java/rxtx/files')
-rw-r--r--dev-java/rxtx/files/rxtx-2.2_pre2-fix-for-java-10+.patch50
-rw-r--r--dev-java/rxtx/files/rxtx-2.2_pre2-fix-invalid-javadoc.patch229
-rw-r--r--dev-java/rxtx/files/rxtx-2.2_pre2-format-security.patch118
3 files changed, 397 insertions, 0 deletions
diff --git a/dev-java/rxtx/files/rxtx-2.2_pre2-fix-for-java-10+.patch b/dev-java/rxtx/files/rxtx-2.2_pre2-fix-for-java-10+.patch
new file mode 100644
index 000000000000..366bb78c2cba
--- /dev/null
+++ b/dev-java/rxtx/files/rxtx-2.2_pre2-fix-for-java-10+.patch
@@ -0,0 +1,50 @@
+Debian patch for fixing build issues on JDK 10 and above.
+In particular, 'javah' needs to replaced by 'javac -h' since 'javah'
+has been removed due to JEP 313 (https://openjdk.java.net/jeps/313).
+
+To support Javadoc generation with JDK 17 and above, the '-source 1.8'
+option must be included in the arguments to 'javadoc'. Otherwise, the
+following error would be raised:
+
+ src/gnu/io/LPRPort.java:373: error: invalid use of a restricted identifier 'yield'
+ yield();
+ ^
+ (to invoke a method called yield, qualify the yield with a receiver or type name)
+
+The original patch can be found at:
+https://salsa.debian.org/java-team/rxtx/-/blob/6500bd55f265de7d2dfef68dc1df5d8b990f66c3/debian/patches/java10-compatibility.patch
+
+Bug: https://bugs.gentoo.org/831394
+
+---
+Description: Fixes the build failure with Java 10
+Author: Emmanuel Bourg <ebourg@apache.org>
+Forwarded: no
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -111,11 +111,6 @@
+ $(CLASSES): $(javafiles) $(TOP)/Makefile
+ $(JAVAH_FIX)
+ $(JAVAC) $(javafiles)
+- $(JAVAH) `(for i in $(javahfiles);do \
+- if grep > /dev/null native.*\( $(SPATH)/gnu/io/$$i.java; then \
+- echo $(CLASSDIR).$$i; \
+- fi; \
+- done)`
+ $(JAR) cf $(JARTARGET) $(CLASSTOP)/*
+
+ # install librxtxSerial.so into the proper directory and copy $(JARTARGET) to its
+--- a/configure.in
++++ b/configure.in
+@@ -485,9 +485,9 @@
+ *)
+ find_java_native_include jni_md.h
+ JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni"
+- JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.8 -target 1.8"
++ JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.8 -target 1.8 -h \$(DEST)"
+ JAR="\$(JPATH)/bin/jar"
+- JAVADOC="\$(JPATH)/bin/javadoc"
++ JAVADOC="\$(JPATH)/bin/javadoc -source 1.8"
+ CFLAGS=$CFLAGS" -D_BSD_SOURCE"
+ ;;
+ esac
diff --git a/dev-java/rxtx/files/rxtx-2.2_pre2-fix-invalid-javadoc.patch b/dev-java/rxtx/files/rxtx-2.2_pre2-fix-invalid-javadoc.patch
new file mode 100644
index 000000000000..a00ed96f7e5a
--- /dev/null
+++ b/dev-java/rxtx/files/rxtx-2.2_pre2-fix-invalid-javadoc.patch
@@ -0,0 +1,229 @@
+From 4c47d6d133f727a9615987d582fa143e4a17cd01 Mon Sep 17 00:00:00 2001
+From: Yuan Liao <liaoyuan@gmail.com>
+Date: Sun, 20 Feb 2022 08:17:59 -0800
+Subject: [PATCH] Fix invalid Javadoc syntax that leads to errors
+
+Bug: https://bugs.gentoo.org/642030
+Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
+---
+ src/gnu/io/RXTXPort.java | 50 ++++++++++++++++++++++------------------
+ 1 file changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/src/gnu/io/RXTXPort.java b/src/gnu/io/RXTXPort.java
+index 622a6a8..77a23ea 100644
+--- a/src/gnu/io/RXTXPort.java
++++ b/src/gnu/io/RXTXPort.java
+@@ -1732,7 +1732,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port the name of the port thats been preopened
+ * @return BaudRate on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ * This will not behave as expected with custom speeds
+ *
+ */
+@@ -1751,7 +1751,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port the name of the port thats been preopened
+ * @return DataBits on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+ public static int staticGetDataBits( String port )
+@@ -1770,7 +1770,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port the name of the port thats been preopened
+ * @return Parity on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+ public static int staticGetParity( String port )
+@@ -1789,7 +1789,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port the name of the port thats been preopened
+ * @return StopBits on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+ public static int staticGetStopBits( String port )
+@@ -1839,7 +1839,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * the port a second time later on.
+ *
+ * @return true on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1862,7 +1862,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * the port a second time later on.
+ *
+ * @return true on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1885,7 +1885,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * the port a second time later on.
+ *
+ * @return none
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1907,7 +1907,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port
+ * @return true if asserted
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1927,7 +1927,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port
+ * @return true if asserted
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1947,7 +1947,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port
+ * @return true if asserted
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1967,7 +1967,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port
+ * @return true if asserted
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -1987,7 +1987,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port
+ * @return true if asserted
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -2007,7 +2007,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ *
+ * @param port
+ * @return true if asserted
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ */
+
+@@ -2025,7 +2025,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * This is an extension to CommAPI. It may not be supported on
+ * all operating systems.
+ * @return int the Parity Error Character
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ * Anyone know how to do this in Unix?
+ */
+@@ -2049,7 +2049,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * all operating systems.
+ * @param b Parity Error Character
+ * @return boolean true on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ * Anyone know how to do this in Unix?
+ */
+@@ -2067,7 +2067,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * This is an extension to CommAPI. It may not be supported on
+ * all operating systems.
+ * @return int the End of Input Character
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ *
+ * Anyone know how to do this in Unix?
+ */
+@@ -2091,7 +2091,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * all operating systems.
+ * @param b End Of Input Character
+ * @return boolean true on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ */
+
+ public boolean setEndOfInputChar( byte b )
+@@ -2111,7 +2111,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * or "16750".
+ * @param test boolean flag to determin if the UART should be tested.
+ * @return boolean true on success
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ */
+ public boolean setUARTType(String type, boolean test)
+ throws UnsupportedCommOperationException
+@@ -2127,7 +2127,7 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * @return type String representation of the UART type which mayb
+ * be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
+ * or "16750".
+- * @throws UnsupportedCommOperationException;
++ * @throws UnsupportedCommOperationException
+ */
+ public String getUARTType() throws UnsupportedCommOperationException
+ {
+@@ -2140,7 +2140,8 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * @param BaudBase The clock frequency divided by 16. Default
+ * BaudBase is 115200.
+ * @return true on success
+- * @throws UnsupportedCommOperationException, IOException
++ * @throws UnsupportedCommOperationException
++ * @throws IOException
+ */
+
+ public boolean setBaudBase(int BaudBase)
+@@ -2155,7 +2156,8 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ /**
+ * Extension to CommAPI
+ * @return BaudBase
+- * @throws UnsupportedCommOperationException, IOException
++ * @throws UnsupportedCommOperationException
++ * @throws IOException
+ */
+
+ public int getBaudBase() throws UnsupportedCommOperationException,
+@@ -2170,7 +2172,8 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32
+ * before using.
+ * @param Divisor
+- * @throws UnsupportedCommOperationException, IOException
++ * @throws UnsupportedCommOperationException
++ * @throws IOException
+ */
+
+ public boolean setDivisor(int Divisor)
+@@ -2184,7 +2187,8 @@ Documentation is at http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputS
+ /**
+ * Extension to CommAPI
+ * @return Divisor;
+- * @throws UnsupportedCommOperationException, IOException
++ * @throws UnsupportedCommOperationException
++ * @throws IOException
+ */
+
+ public int getDivisor() throws UnsupportedCommOperationException,
+--
+2.34.1
+
diff --git a/dev-java/rxtx/files/rxtx-2.2_pre2-format-security.patch b/dev-java/rxtx/files/rxtx-2.2_pre2-format-security.patch
new file mode 100644
index 000000000000..1337cce3c546
--- /dev/null
+++ b/dev-java/rxtx/files/rxtx-2.2_pre2-format-security.patch
@@ -0,0 +1,118 @@
+Debian patch for fixing errors emitted due to -Werror=format-security.
+The patch can be found at:
+https://salsa.debian.org/java-team/rxtx/-/blob/6500bd55f265de7d2dfef68dc1df5d8b990f66c3/debian/patches/format_security.patch
+
+Bug: https://bugs.gentoo.org/550534
+
+---
+From: tony mancill <tmancill@debian.org>
+Forwarded: no
+Description: use format specifiers in fprintf statements for hardening flags
+
+--- a/src/SerialImp.c
++++ b/src/SerialImp.c
+@@ -5108,7 +5108,7 @@
+ void report_warning(const char *msg)
+ {
+ #ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #else
+ mexWarnMsgTxt( (const char *) msg );
+ #endif /* DEBUG_MW */
+@@ -5129,7 +5129,7 @@
+ #ifdef DEBUG_MW
+ mexErrMsgTxt( msg );
+ #else
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #endif /* DEBUG_MW */
+ #endif /* DEBUG_VERBOSE */
+ }
+@@ -5145,7 +5145,7 @@
+ void report_error(const char *msg)
+ {
+ #ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #else
+ mexWarnMsgTxt( msg );
+ #endif /* DEBUG_MW */
+@@ -5164,7 +5164,7 @@
+ {
+ #ifdef DEBUG
+ # ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ # else
+ mexPrintf( msg );
+ # endif /* DEBUG_MW */
+--- a/src/ParallelImp.c
++++ b/src/ParallelImp.c
+@@ -920,7 +920,7 @@
+ void report_error(char *msg)
+ {
+ #ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #else
+ mexWarnMsgTxt( msg );
+ #endif /* DEBUG_MW */
+@@ -938,7 +938,7 @@
+ void report(char *msg)
+ {
+ #ifdef DEBUG
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #endif /* DEBUG */
+ }
+
+--- a/src/SerialImp.cpp
++++ b/src/SerialImp.cpp
+@@ -1844,7 +1844,7 @@
+
+
+ #ifdef DEBUG
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #endif
+ }
+
+--- a/CNI/SerialImp.c
++++ b/CNI/SerialImp.c
+@@ -4549,7 +4549,7 @@
+ void report_warning(char *msg)
+ {
+ #ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #else
+ mexWarnMsgTxt( (const char *) msg );
+ #endif /* DEBUG_MW */
+@@ -4570,7 +4570,7 @@
+ #ifdef DEBUG_MW
+ mexErrMsgTxt( msg );
+ #else
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #endif /* DEBUG_MW */
+ #endif /* DEBUG_VERBOSE */
+ }
+@@ -4586,7 +4586,7 @@
+ void report_error(char *msg)
+ {
+ #ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ #else
+ mexWarnMsgTxt( msg );
+ #endif /* DEBUG_MW */
+@@ -4605,7 +4605,7 @@
+ {
+ #ifdef DEBUG
+ # ifndef DEBUG_MW
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ # else
+ mexPrintf( msg );
+ # endif /* DEBUG_MW */