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

Annotation of projects/libgdx-openbsd/README-OpenBSD.md, Revision 1.5

1.1       thfr        1: Purpose
                      2: =======
                      3:
                      4: This repo is a fork of libgdx with modifications to allow running libgdx
                      5: games on OpenBSD. Current limitations are that setup involves many steps and is
                      6: difficult, and that only some of the backend code is adapted (lwjgl, but not
                      7: lwjgl3, etc). In its current form, this can be used to run Slay the Spire.
                      8:
                      9: The ultimate purpose of this repo is to contribute to making the upstream
                     10: libgdx framework usable on OpenBSD. **Ultimately, this repo will hopefully
                     11: become obsolete once upstream accomodates OpenBSD.**
                     12:
                     13: Besides upstreaming OpenBSD-specifics, native shared object (.so) libraries
                     14: might best be converted to an OpenBSD port.
                     15:
                     16: Files Changed from libgdx 1.9.9 or Added
                     17: ========================================
                     18:
                     19: backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java
                     20: backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/audio/OpenALMusic.java
                     21: extensions/gdx-controllers/gdx-controllers-desktop/jni/build-openbsd64.xml
                     22: extensions/gdx-freetype/jni/build-openbsd64.xml
                     23: extensions/gdx-jnigen/src/com/badlogic/gdx/jnigen/JniGenSharedLibraryLoader.java
                     24: gdx/jni/build-openbsd64.xml
                     25: gdx/src/com/badlogic/gdx/scenes/scene2d/utils/UIUtils.java
                     26: gdx/src/com/badlogic/gdx/utils/SharedLibraryLoader.java
                     27: README.md
                     28: README-OpenBSD.md
                     29:
1.4       thfr       30: IDE files from IntelliJ have been removes (.idea directory, various .iml
                     31: files).
                     32:
                     33: The file DIFF_OPENBSD shows the changes compared to the upstream libGDX 1.9.9.
                     34:
1.1       thfr       35: Example: Running Slay the Spire on OpenBSD
                     36: ==========================================
                     37:
1.5     ! thfr       38: **NOTE**: solene@'s script at https://perso.pw/gaming/openbsd_slay_the_spire.sh
        !            39: does all of the following steps for you.
        !            40:
1.1       thfr       41: This is based on my testing on OpenBSD 6.4-current with jdk-1.8.0.202v0.
                     42:
                     43: Prerequisite Packages:
                     44: ----------------------
                     45:
                     46: * openal
                     47: * lwjgl
                     48: * jdk
1.3       thfr       49: * maven
1.2       thfr       50: * apache-ant
1.1       thfr       51: * rsync
                     52:
                     53: Also Slay the Spire, release version 1.0 (needs to be obtained via Steam on
1.3       thfr       54: another operating system). Windows or Linux downloads have been reported to
                     55: work.
1.1       thfr       56:
                     57: Step-by-Step:
                     58: -------------
                     59:
                     60: 1. Copy the files of Slay the Spire to your OpenBSD installation.
                     61:
1.3       thfr       62: 2. Locate desktop-1.0.jar and extract it to a separate directory:
                     63:
                     64:    $ mkdir unjar
                     65:    $ cd unjar
                     66:    $ jar xvf path/to/desktop-1.0.jar
1.1       thfr       67:
                     68: 3. Replace libopenal64.so and liblwjgl64.so with the corresponding libraries
                     69:    from the packages, for example:
                     70:
                     71:    $ cp /usr/local/lib/libopenal.so.3.1 libopenal64.so
                     72:
                     73: 4. Obtain the libgdx-openbsd code:
                     74:
                     75:    $ cvs -d anoncvs@anoncvs.thfr.info:/cvs checkout -P projects/libgdx-openbsd
                     76:
                     77: 5. Build native (JNI) libs of the libgdx project:
                     78:
                     79:    $ cd gdx/jni && ant -f build-openbsd64.xml && cd -
                     80:    $ cd extensions/gdx-freetype/jni && ant -f build-openbsd64.xml && cd -
                     81:    $ cd extensions/gdx-controllers/gdx-controllers-desktop/jni && \
                     82:      ant -f build-openbsd64.xml && cd -
                     83:
                     84: 6. Copy these libs to the Slay the Spire directory, replacing existing files.
                     85:    After building with ant(1), the libs are located in the libs/openbsd64
                     86:    subdirectory (e.g. gdx/libs/openbsd64).
                     87:
                     88: 7. Open the libgdx-openbsd directory in intellij(1). This will import the Maven
                     89:    project.
                     90:
1.3       thfr       91: 8. Go into the following subdirectories and run
                     92:
                     93:    $ mvn package
                     94:
                     95:    in each of them, thereby creating the required class files:
1.1       thfr       96:    - extensions/gdx-jnigen
                     97:    - gdx
                     98:    - backends/gdx-backend-lwjgl
                     99:    - extensions/gdx-freetype
                    100:    - extensions/gdx-controllers/gdx-controllers
                    101:    - extensions/gdx-controllers/gdx-controllers-desktop
                    102:
                    103: 9. Locate the class trees in all these modules (in target/classes subdir) and
                    104:    put all of them together, for example with:
                    105:
                    106:    $ rsync -avh gdx/target/classes/* /tmp/
                    107:    $ rsync -avh backends/gdx-backend-lwjgl/target/classes/* /tmp/
                    108:
                    109:    etc. (gdx-jnigen may not be needed anymore in this step.)
                    110:
                    111: 10.Remove the original com/badlogic subdir in Slay the Spire and replace it
                    112:    with the one that you just built (in /tmp/com/badlogic following the
                    113:    example code).
                    114:
                    115:    $ rm -rf com/badlogic
                    116:    $ cp -R /tmp/com/badlogic com/
                    117:
                    118: 11.The main java class and the arguments for the Java VM are documented in the
                    119:    config.json that comes with the game. Based on that, start the game with the
                    120:    following command:
                    121:
                    122:    $ java -Xmx1G -Dsun.java2d.dpiaware=true com.megacrit.cardcrawl.desktop.DesktopLauncher
                    123:
                    124: Notes:
                    125: ------
                    126:
                    127: * For some reason sometimes the java runtime fails to load libopenal64.so when
                    128:   starting the game. This is usually resolved by simply starting the game again
                    129:   with the same command.
                    130:
                    131: Goals for the Future:
                    132: =====================
                    133:
                    134: * fix gamecontroller support
                    135: * lwjgl3 backend (required for MewnBase)
                    136: * try it with more libgdx games (e.g. Halfway)
                    137: * ...
                    138:
                    139: Contact
                    140: =======
                    141:
                    142: Thomas Frohwein <thfr@openbsd.org>

Contact: <mail@mail.thfr.info>