|File: [local] / projects / libgdx-openbsd / README-OpenBSD.md (download)
Revision 1.3, Thu Mar 14 03:43:35 2019 UTC (14 months, 1 week ago) by thfr
Changes since 1.2: +13 -5 lines
remove memcpy wrapper from gdx-controllers-desktop JNI, adjust README-OpenBSD: use maven instead of intellij, mention Windows and Linux versions of Slay the Spire work, provid example for using jar(1) - thanks solene@ for the README-OpenBSD changes!
This repo is a fork of libgdx with modifications to allow running libgdx
games on OpenBSD. Current limitations are that setup involves many steps and is
difficult, and that only some of the backend code is adapted (lwjgl, but not
lwjgl3, etc). In its current form, this can be used to run Slay the Spire.
The ultimate purpose of this repo is to contribute to making the upstream
libgdx framework usable on OpenBSD. **Ultimately, this repo will hopefully
become obsolete once upstream accomodates OpenBSD.**
Besides upstreaming OpenBSD-specifics, native shared object (.so) libraries
might best be converted to an OpenBSD port.
Files Changed from libgdx 1.9.9 or Added
Example: Running Slay the Spire on OpenBSD
This is based on my testing on OpenBSD 6.4-current with jdk-184.108.40.206v0.
Also Slay the Spire, release version 1.0 (needs to be obtained via Steam on
another operating system). Windows or Linux downloads have been reported to
1. Copy the files of Slay the Spire to your OpenBSD installation.
2. Locate desktop-1.0.jar and extract it to a separate directory:
$ mkdir unjar
$ cd unjar
$ jar xvf path/to/desktop-1.0.jar
3. Replace libopenal64.so and liblwjgl64.so with the corresponding libraries
from the packages, for example:
$ cp /usr/local/lib/libopenal.so.3.1 libopenal64.so
4. Obtain the libgdx-openbsd code:
$ cvs -d email@example.com:/cvs checkout -P projects/libgdx-openbsd
5. Build native (JNI) libs of the libgdx project:
$ cd gdx/jni && ant -f build-openbsd64.xml && cd -
$ cd extensions/gdx-freetype/jni && ant -f build-openbsd64.xml && cd -
$ cd extensions/gdx-controllers/gdx-controllers-desktop/jni && \
ant -f build-openbsd64.xml && cd -
6. Copy these libs to the Slay the Spire directory, replacing existing files.
After building with ant(1), the libs are located in the libs/openbsd64
subdirectory (e.g. gdx/libs/openbsd64).
7. Open the libgdx-openbsd directory in intellij(1). This will import the Maven
8. Go into the following subdirectories and run
$ mvn package
in each of them, thereby creating the required class files:
9. Locate the class trees in all these modules (in target/classes subdir) and
put all of them together, for example with:
$ rsync -avh gdx/target/classes/* /tmp/
$ rsync -avh backends/gdx-backend-lwjgl/target/classes/* /tmp/
etc. (gdx-jnigen may not be needed anymore in this step.)
10.Remove the original com/badlogic subdir in Slay the Spire and replace it
with the one that you just built (in /tmp/com/badlogic following the
$ rm -rf com/badlogic
$ cp -R /tmp/com/badlogic com/
11.The main java class and the arguments for the Java VM are documented in the
config.json that comes with the game. Based on that, start the game with the
$ java -Xmx1G -Dsun.java2d.dpiaware=true com.megacrit.cardcrawl.desktop.DesktopLauncher
* For some reason sometimes the java runtime fails to load libopenal64.so when
starting the game. This is usually resolved by simply starting the game again
with the same command.
Goals for the Future:
* fix gamecontroller support
* lwjgl3 backend (required for MewnBase)
* try it with more libgdx games (e.g. Halfway)
Thomas Frohwein <firstname.lastname@example.org>