[BACK]Return to README-OpenBSD.md CVS log [TXT][DIR] Up to [local] / projects / libgdx-openbsd

File: [local] / projects / libgdx-openbsd / README-OpenBSD.md (download)

Revision 1.5, Thu Mar 14 15:15:08 2019 UTC (14 months, 1 week ago) by thfr
Branch: MAIN
Changes since 1.4: +3 -0 lines

add link to openbsd_slay_the_spire.sh, thanks to solene@


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


IDE files from IntelliJ have been removes (.idea directory, various .iml

The file DIFF_OPENBSD shows the changes compared to the upstream libGDX 1.9.9.

Example: Running Slay the Spire on OpenBSD

**NOTE**: solene@'s script at https://perso.pw/gaming/openbsd_slay_the_spire.sh
does all of the following steps for you.

This is based on my testing on OpenBSD 6.4-current with jdk-

Prerequisite Packages:

* openal
* lwjgl
* jdk
* maven
* apache-ant
* rsync

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 anoncvs@anoncvs.thfr.info:/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:
   - extensions/gdx-jnigen
   - gdx
   - backends/gdx-backend-lwjgl
   - extensions/gdx-freetype
   - extensions/gdx-controllers/gdx-controllers
   - extensions/gdx-controllers/gdx-controllers-desktop

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
   example code).

   $ 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
   following command:

   $ 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 <thfr@openbsd.org>