Skip to content

Commit

Permalink
Cherry pick the changes from octeep to make recent versions of Minecraft
Browse files Browse the repository at this point in the history
work on OpenBSD
  • Loading branch information
kmosiejczuk committed Jan 21, 2021
1 parent 4606f2a commit 01a8cff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 45 deletions.
45 changes: 1 addition & 44 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1105,50 +1105,7 @@

<!-- Bundle javadoc -->
<!-- This is slow, use -Djavadoc.skip=true for fast local builds -->
<mkdir dir="${release}/${module}/javadoc" unless:set="javadoc.skip"/>
<javadoc
destdir="${release}/${module}/javadoc"
source="9"
windowtitle="LWJGL ${build.version} - @{title}"
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
useexternalfile="true"
nohelp="true"
notree="true"
public="true"
failonerror="true"
unless:set="javadoc.skip"
>
<doctitle><![CDATA[<h1>LWJGL - @{title}</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright LWJGL. All Rights Reserved. <a href="https://www.lwjgl.org/license">License terms</a>.</i>]]></bottom>

<classpath>
<pathelement path="${module.classpath}"/>
<pathelement path="${lib}/java/jsr305.jar"/>
</classpath>

<fileset dir="${module.lwjgl}/@{name}/src/main/java/org/lwjgl" includes="**" if:set="hasMain.javadoc"/>
<fileset dir="${module.lwjgl}/@{name}/src/generated/java" includes="**"/>

<arg value="-XDignore.symbol.file"/> <!-- Suppresses internal API (e.g. Unsafe) usage warnings -->

<arg line="-Xdoclint:html,reference,syntax"/>
<arg line="-Xmaxerrs 1000 -Xmaxwarns 1000"/>
<arg line="-notimestamp"/>
<arg value="-html5" if:set="jdk9"/>
<arg line="-J-Dfile.encoding=UTF8 -J-Dline.separator=&#10;"/>
<arg line="--add-exports jdk.javadoc/com.sun.tools.doclets=ALL-UNNAMED" if:set="jdk9"/>
</javadoc>
<get-quiet name="favicon" url="https://www.lwjgl.org/favicon.ico" dest="${release}/${module}/javadoc" unless:set="javadoc.skip"/>

<java classname="org.lwjgl.system.JavadocPostProcess" failonerror="true" unless:set="javadoc.skip">
<classpath path="${bin.generator}"/>

<arg value="${release}/${module}/javadoc"/>
</java>
<zip destfile="${release}/${module}/${module}-javadoc.jar" basedir="${release}/${module}/javadoc" includes="**" level="9" unless:set="javadoc.skip"/>
<delete dir="${release}/${module}/javadoc" unless:set="javadoc.skip"/>
<!-- Javadoc has been removed because it is slow and useless -->

<!-- Bundle source -->
<quiet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public static SharedLibrary apiCreateLibrary(String name) {
return new LinuxLibrary(name);
case MACOSX:
return MacOSXLibrary.create(name);
case OPENBSD:
return new OpenBSDLibrary(name);
default:
throw new IllegalStateException();
}
Expand Down
3 changes: 2 additions & 1 deletion modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static void create() {
String libName;
switch (Platform.get()) {
case LINUX:
case OPENBSD:
case MACOSX:
libName = "openal";
break;
Expand Down Expand Up @@ -228,4 +229,4 @@ public static ALCCapabilities createCapabilities(long device) {
return new ALCCapabilities(functionProvider, device, supportedExtensions);
}

}
}
5 changes: 5 additions & 0 deletions modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.lwjgl.system.*;
import org.lwjgl.system.macosx.*;
import org.lwjgl.system.windows.*;
import org.lwjgl.system.openbsd.*;

import javax.annotation.*;
import java.nio.*;
Expand Down Expand Up @@ -107,6 +108,9 @@ public static void create() {
case WINDOWS:
GL = Library.loadNative(GL.class, "org.lwjgl.opengl", Configuration.OPENGL_LIBRARY_NAME, "opengl32");
break;
case OPENBSD:
GL = Library.loadNative(GL.class, "org.lwjgl.opengl", Configuration.OPENGL_LIBRARY_NAME, "libGL.so.17.1", "libGL.so");
break;
default:
throw new IllegalStateException();
}
Expand Down Expand Up @@ -158,6 +162,7 @@ long getExtensionAddress(long name) {
}
};
break;
case OPENBSD:
case LINUX:
functionProvider = new SharedLibraryGL(OPENGL) {
private final long glXGetProcAddress;
Expand Down

0 comments on commit 01a8cff

Please sign in to comment.