Package list lwjgl / dc13727
Fixed the build failures with Java 9/10/11 (Closes: #893302) Emmanuel Bourg 2 years ago
7 changed file(s) with 192 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
00 lwjgl (2.9.3+dfsg-4) UNRELEASED; urgency=medium
11
22 * Team upload.
3 * Fixed the build failures with Java 9/10/11 (Closes: #893302)
34 * Simplified the OS X and ASM patches
45 * Filter the upstream tarball with the Files-Excluded field in d/copyright
56 * Standards-Version updated to 4.2.1
88 ant,
99 ant-optional,
1010 debhelper (>= 11),
11 default-jdk,
1112 default-jdk-doc,
1213 javahelper,
1314 libjinput-java,
1415 libxcursor-dev,
1516 libxrandr-dev,
1617 libxt-dev,
17 libxxf86vm-dev,
18 openjdk-8-jdk
18 libxxf86vm-dev
1919 Standards-Version: 4.2.1
2020 Vcs-Git: https://salsa.debian.org/java-team/lwjgl.git
2121 Vcs-Browser: https://salsa.debian.org/java-team/lwjgl
0 Description: Workaround for a regression in the annotation processor with Java 9+
1 Author: Emmanuel Bourg <ebourg@apache.org>
2 Forwarded: no
3 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893302
4 --- a/src/java/org/lwjgl/util/generator/GeneratorVisitor.java
5 +++ b/src/java/org/lwjgl/util/generator/GeneratorVisitor.java
6 @@ -300,8 +300,8 @@
7 }
8
9 // TODO: Back-port LWJGL 3's generation file handling (generate in-memory and avoid touching files if nothing has changed)
10 - java_writer = new PrintWriter(env.getFiler().createSourceFile(Utils.getQualifiedClassName(e), env.getElementUtils().getPackageOf(e)).openWriter());
11 - generateJavaSource(e, java_writer);
12 + outputJava.getParentFile().mkdirs();
13 + generateJavaSource(e, new PrintWriter(new java.io.FileWriter(outputJava)));
14
15 if ( methods.size() > 0 ) {
16 boolean noNative = true;
0 Description: Fixes the compatibility with Java 9 (sun.reflect.FieldAccessor is no longer accessible)
1 Author: Emmanuel Bourg <ebourg@pache.org>
2 Forwarded: no
3 --- a/src/java/org/lwjgl/MemoryUtilSun.java
4 +++ b/src/java/org/lwjgl/MemoryUtilSun.java
5 @@ -37,7 +37,6 @@
6 import java.nio.Buffer;
7
8 import sun.misc.Unsafe;
9 -import sun.reflect.FieldAccessor;
10
11 /**
12 * MemoryUtil.Accessor implementations that depend on sun.misc.
13 @@ -103,33 +102,4 @@
14
15 }
16
17 - /** Implementation using reflection on ByteBuffer, FieldAccessor is used directly. */
18 - private static class AccessorReflectFast implements MemoryUtil.Accessor {
19 -
20 - private final FieldAccessor addressAccessor;
21 -
22 - AccessorReflectFast() {
23 - Field address;
24 - try {
25 - address = MemoryUtil.getAddressField();
26 - } catch (NoSuchFieldException e) {
27 - throw new UnsupportedOperationException(e);
28 - }
29 - address.setAccessible(true);
30 -
31 - try {
32 - Method m = Field.class.getDeclaredMethod("acquireFieldAccessor", boolean.class);
33 - m.setAccessible(true);
34 - addressAccessor = (FieldAccessor)m.invoke(address, true);
35 - } catch (Exception e) {
36 - throw new UnsupportedOperationException(e);
37 - }
38 - }
39 -
40 - public long getAddress(final Buffer buffer) {
41 - return addressAccessor.getLong(buffer);
42 - }
43 -
44 - }
45 -
46 -}
47 \ No newline at end of file
48 +}
0 Description: Generate the native headers with 'javac -h' instead of javah (removed from Java 10)
1 Author: Emmanuel Bourg <ebourg@apache.org>
2 Forwarded: no
3 --- a/build.xml
4 +++ b/build.xml
5 @@ -297,6 +297,7 @@
6
7 <!-- Generates the native headers from source files -->
8 <target name="headers" description="invokes javah on java classes" depends="compile">
9 +<!--
10 <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux">
11 <class name="org.lwjgl.LinuxSysImplementation" />
12 <class name="org.lwjgl.opengl.LinuxEvent" />
13 @@ -373,6 +374,7 @@
14 <class name="org.lwjgl.opengles.GLContext"/>
15 <class name="org.lwjgl.opengles.CallbackUtil"/>
16 </javah>
17 +-->
18 </target>
19
20 <target name="touch-version">
21 @@ -403,21 +405,21 @@
22 </tokenfilter>
23 </filterchain>
24 </loadfile>
25 - <loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
26 + <loadfile srcfile="${lwjgl.src.native}/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
27 <filterchain>
28 <tokenfilter>
29 <containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/>
30 </tokenfilter>
31 </filterchain>
32 </loadfile>
33 - <loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
34 + <loadfile srcfile="${lwjgl.src.native}/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
35 <filterchain>
36 <tokenfilter>
37 <containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/>
38 </tokenfilter>
39 </filterchain>
40 </loadfile>
41 - <loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
42 + <loadfile srcfile="${lwjgl.src.native}/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
43 <filterchain>
44 <tokenfilter>
45 <containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
46 @@ -464,7 +466,7 @@
47
48 <!-- Compiles the Java source code -->
49 <target name="compile" description="Compiles the java source code" depends="-initialize">
50 - <javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core">
51 + <javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core" nativeHeaderDir="${lwjgl.src.native}">
52 <!--<compilerarg value="-Xlint:unchecked"/>-->
53 <src path="${lwjgl.src}/java/"/>
54 <src path="${lwjgl.src}/generated/"/>
55 --- a/src/java/org/lwjgl/LinuxSysImplementation.java
56 +++ b/src/java/org/lwjgl/LinuxSysImplementation.java
57 @@ -43,6 +43,7 @@
58 * $Id$
59 */
60 final class LinuxSysImplementation extends J2SESysImplementation {
61 + @java.lang.annotation.Native
62 private static final int JNI_VERSION = 19;
63
64 static {
65 --- a/platform_build/linux_ant/build.xml
66 +++ b/platform_build/linux_ant/build.xml
67 @@ -143,6 +143,7 @@
68 <arg value="-I${java.home}/../include/solaris"/>
69 <arg value="-I${native}/common"/>
70 <arg value="-I${native}/common/opengl"/>
71 + <arg value="-I${native}"/>
72 <arg value="-I${native}/linux"/>
73 <arg value="-I${native}/linux/opengl"/>
74 <mapper type="glob" from="*.c" to="*.o"/>
75 --- a/src/java/org/lwjgl/input/Cursor.java
76 +++ b/src/java/org/lwjgl/input/Cursor.java
77 @@ -51,12 +51,15 @@
78
79 public class Cursor {
80 /** 1 bit transparency for native cursor */
81 + @java.lang.annotation.Native
82 public static final int CURSOR_ONE_BIT_TRANSPARENCY = 1;
83
84 /** 8 bit alhpa native cursor */
85 + @java.lang.annotation.Native
86 public static final int CURSOR_8_BIT_ALPHA = 2;
87
88 /** animation native cursor */
89 + @java.lang.annotation.Native
90 public static final int CURSOR_ANIMATION = 4;
91
92 /** First element to display */
93 --- a/src/native/common/org_lwjgl_BufferUtils.c
94 +++ b/src/native/common/org_lwjgl_BufferUtils.c
95 @@ -1,4 +1,3 @@
96 -#include "org_lwjgl_BufferUtils.h"
97 #include "common_tools.h"
98
99 JNIEXPORT void JNICALL Java_org_lwjgl_BufferUtils_zeroBuffer0(JNIEnv *env, jclass clazz, jobject buffer, jlong offset, jlong size) {
100 --- a/src/native/common/org_lwjgl_opencl_CallbackUtil.c
101 +++ b/src/native/common/org_lwjgl_opencl_CallbackUtil.c
102 @@ -39,7 +39,6 @@
103 #include <jni.h>
104 #include "common_tools.h"
105 #include "extcl.h"
106 -#include "org_lwjgl_opencl_CallbackUtil.h"
107
108 static jmethodID contextCallbackJ;
109 static jmethodID memObjectDestructorCallbackJ;
110 --- a/src/java/org/lwjgl/MacOSXSysImplementation.java
111 +++ b/src/java/org/lwjgl/MacOSXSysImplementation.java
112 @@ -43,6 +43,7 @@
113 * $Id$
114 */
115 final class MacOSXSysImplementation extends J2SESysImplementation {
116 + @java.lang.annotation.Native
117 private static final int JNI_VERSION = 25;
118
119 static {
55 systemjinput.patch
66 build-failure.patch
77 no-asm-support.patch
8 java9-compatibility.patch
9 annotation-processor-workaround.patch
10 javah.patch
00 #!/usr/bin/make -f
1
2 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
3 export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-$(DEB_HOST_ARCH)
4 export PATH:=$(JAVA_HOME)/bin:$(PATH)
51
62 # NOTE: jutils is explicitly included here (without a depends in our control
73 # file) because jinput.jar lacks jutils in its own "Class-Path" (bug #626002)