1 |
commit: fb32d4101bf8109323038c698dba8f456883e9bc |
2 |
Author: Yuan Liao <liaoyuan <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Feb 20 19:15:09 2022 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 21 09:16:42 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb32d410 |
7 |
|
8 |
dev-java/swingx-ws: Use EAPI 8, set minimum Java version to 1.8 |
9 |
|
10 |
Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com> |
11 |
Closes: https://github.com/gentoo/gentoo/pull/24292 |
12 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
13 |
|
14 |
...0515-replace-sun.misc-classes-for-java-9+.patch | 40 ++++++++++++ |
15 |
.../swingx-ws/swingx-ws-1.0_p20110515-r2.ebuild | 74 ++++++++++++++++++++++ |
16 |
2 files changed, 114 insertions(+) |
17 |
|
18 |
diff --git a/dev-java/swingx-ws/files/swingx-ws-1.0_p20110515-replace-sun.misc-classes-for-java-9+.patch b/dev-java/swingx-ws/files/swingx-ws-1.0_p20110515-replace-sun.misc-classes-for-java-9+.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..f254274c62cc |
21 |
--- /dev/null |
22 |
+++ b/dev-java/swingx-ws/files/swingx-ws-1.0_p20110515-replace-sun.misc-classes-for-java-9+.patch |
23 |
@@ -0,0 +1,40 @@ |
24 |
+From 803016b9b4bd6cc96efb6cba8c37befaf410be61 Mon Sep 17 00:00:00 2001 |
25 |
+From: Yuan Liao <liaoyuan@×××××.com> |
26 |
+Date: Sun, 20 Feb 2022 11:07:41 -0800 |
27 |
+Subject: [PATCH] Replace use of sun.misc.BASE64{En,De}coder for Java 9+ |
28 |
+ |
29 |
+Signed-off-by: Yuan Liao <liaoyuan@×××××.com> |
30 |
+--- |
31 |
+ java/org/jdesktop/http/Request.java | 7 +++---- |
32 |
+ 1 file changed, 3 insertions(+), 4 deletions(-) |
33 |
+ |
34 |
+diff --git a/java/org/jdesktop/http/Request.java b/java/org/jdesktop/http/Request.java |
35 |
+index ff72322..57c4bf8 100644 |
36 |
+--- a/java/org/jdesktop/http/Request.java |
37 |
++++ b/java/org/jdesktop/http/Request.java |
38 |
+@@ -30,8 +30,7 @@ import org.jdesktop.beans.AbstractBean; |
39 |
+ import org.jdesktop.http.Header.Element; |
40 |
+ import org.jdesktop.xpath.XPathUtils; |
41 |
+ import org.w3c.dom.Document; |
42 |
+-import sun.misc.BASE64Decoder; |
43 |
+-import sun.misc.BASE64Encoder; |
44 |
++import java.util.Base64; |
45 |
+ |
46 |
+ /** |
47 |
+ * <p>Represents an http request. A <code>Request</code> is constructed and then |
48 |
+@@ -613,10 +612,10 @@ public class Request extends AbstractBean { |
49 |
+ } |
50 |
+ |
51 |
+ private static String base64Encode(String s) throws Exception { |
52 |
+- return new String(new BASE64Encoder().encode(s.getBytes())); |
53 |
++ return Base64.getEncoder().encodeToString(s.getBytes()); |
54 |
+ } |
55 |
+ |
56 |
+ private static String base64Decode(String s) throws Exception { |
57 |
+- return new String(new BASE64Decoder().decodeBuffer(s)); |
58 |
++ return new String(Base64.getDecoder().decode(s)); |
59 |
+ } |
60 |
+ } |
61 |
+-- |
62 |
+2.34.1 |
63 |
+ |
64 |
|
65 |
diff --git a/dev-java/swingx-ws/swingx-ws-1.0_p20110515-r2.ebuild b/dev-java/swingx-ws/swingx-ws-1.0_p20110515-r2.ebuild |
66 |
new file mode 100644 |
67 |
index 000000000000..92355258c5ef |
68 |
--- /dev/null |
69 |
+++ b/dev-java/swingx-ws/swingx-ws-1.0_p20110515-r2.ebuild |
70 |
@@ -0,0 +1,74 @@ |
71 |
+# Copyright 1999-2022 Gentoo Authors |
72 |
+# Distributed under the terms of the GNU General Public License v2 |
73 |
+ |
74 |
+EAPI=8 |
75 |
+ |
76 |
+MY_P="${PN}-2011_05_15-src" |
77 |
+JAVA_PKG_IUSE="doc source" |
78 |
+ |
79 |
+inherit java-pkg-2 java-pkg-simple |
80 |
+ |
81 |
+DESCRIPTION="Utilities and widgets to integrate Swing GUIs with web applications" |
82 |
+HOMEPAGE="https://java.net/projects/swingx-ws/" |
83 |
+SRC_URI="mirror://sourceforge/bt747/Development/${MY_P}.zip" |
84 |
+LICENSE="LGPL-2.1" |
85 |
+SLOT="bt747" |
86 |
+KEYWORDS="~amd64 ~x86" |
87 |
+ |
88 |
+CP_DEPEND=" |
89 |
+ dev-java/jakarta-xml-soap-api:1 |
90 |
+ dev-java/jdom:0 |
91 |
+ dev-java/json:0 |
92 |
+ dev-java/rome:0 |
93 |
+ dev-java/jtidy:0 |
94 |
+ dev-java/xerces:2 |
95 |
+ dev-java/swingx:1.6 |
96 |
+ dev-java/swing-layout:1 |
97 |
+ dev-java/swingx-beaninfo:0 |
98 |
+ dev-java/commons-httpclient:3 |
99 |
+ dev-java/xml-commons-external:1.4" |
100 |
+ |
101 |
+RDEPEND=" |
102 |
+ ${CP_DEPEND} |
103 |
+ >=virtual/jre-1.8:*" |
104 |
+ |
105 |
+DEPEND=" |
106 |
+ ${CP_DEPEND} |
107 |
+ >=virtual/jdk-1.8:*" |
108 |
+ |
109 |
+BDEPEND=" |
110 |
+ app-arch/unzip" |
111 |
+ |
112 |
+S="${WORKDIR}/${MY_P}/src" |
113 |
+JAVA_SRC_DIR=( "beaninfo" "java" ) |
114 |
+ |
115 |
+PATCHES=( |
116 |
+ "${FILESDIR}/${P}-replace-sun.misc-classes-for-java-9+.patch" |
117 |
+) |
118 |
+ |
119 |
+src_prepare() { |
120 |
+ default |
121 |
+ java-pkg_clean "${WORKDIR}" |
122 |
+ |
123 |
+ # SwingWorker has been built-in since Java 6. |
124 |
+ find java -name "*.java" -exec sed -i -r "s:org\.jdesktop\.swingworker\.:javax.swing.:g" {} + || die |
125 |
+ |
126 |
+ # Fixes for newer swingx-beaninfo. |
127 |
+ sed -i "s:BeanInfoSupport:org.jdesktop.beans.\0:g" beaninfo/org/jdesktop/swingx/*.java || die |
128 |
+ find beaninfo -name "*.java" -exec sed -i -r "s:org\.jdesktop\.swingx\.(editors|BeanInfoSupport|EnumerationValue):org.jdesktop.beans.\1:g" {} + || die |
129 |
+ |
130 |
+ # GraphicsUtilities moved in later SwingX versions. |
131 |
+ sed -i "s:org\.jdesktop\.swingx\.graphics\.GraphicsUtilities:org.jdesktop.swingx.util.GraphicsUtilities:g" \ |
132 |
+ java/org/jdesktop/swingx/mapviewer/AbstractTileFactory.java || die |
133 |
+ |
134 |
+ java-pkg-2_src_prepare |
135 |
+} |
136 |
+ |
137 |
+src_compile() { |
138 |
+ java-pkg-simple_src_compile |
139 |
+ |
140 |
+ local DIR |
141 |
+ for DIR in "${JAVA_SRC_DIR[@]}"; do |
142 |
+ java-pkg_addres ${PN}.jar ${DIR} |
143 |
+ done |
144 |
+} |