[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.6

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:
1.6     ! thfr       60: 1. Copy the file desktop-*.jar from Slay the Spire to your OpenBSD installation.
1.1       thfr       61:
1.6     ! thfr       62: 2. Extract desktop-1.0.jar:
1.3       thfr       63:
1.6     ! thfr       64:    $ jar xvf desktop-*.jar
1.1       thfr       65:
                     66: 3. Replace libopenal64.so and liblwjgl64.so with the corresponding libraries
                     67:    from the packages, for example:
                     68:
                     69:    $ cp /usr/local/lib/libopenal.so.3.1 libopenal64.so
1.6     ! thfr       70:    $ cp /usr/local/share/lwjgl/liblwjgl64.so liblwjgl64.so
1.1       thfr       71:
                     72: 4. Obtain the libgdx-openbsd code:
                     73:
                     74:    $ cvs -d anoncvs@anoncvs.thfr.info:/cvs checkout -P projects/libgdx-openbsd
                     75:
                     76: 5. Build native (JNI) libs of the libgdx project:
                     77:
                     78:    $ cd gdx/jni && ant -f build-openbsd64.xml && cd -
                     79:    $ cd extensions/gdx-freetype/jni && ant -f build-openbsd64.xml && cd -
                     80:
                     81: 6. Copy these libs to the Slay the Spire directory, replacing existing files.
                     82:    After building with ant(1), the libs are located in the libs/openbsd64
                     83:    subdirectory (e.g. gdx/libs/openbsd64).
                     84:
1.6     ! thfr       85: 7. Go into the following subdirectories and run
1.3       thfr       86:
                     87:    $ mvn package
                     88:
                     89:    in each of them, thereby creating the required class files:
1.1       thfr       90:    - extensions/gdx-jnigen
                     91:    - gdx
                     92:    - backends/gdx-backend-lwjgl
                     93:    - extensions/gdx-freetype
                     94:    - extensions/gdx-controllers/gdx-controllers
                     95:    - extensions/gdx-controllers/gdx-controllers-desktop
                     96:
1.6     ! thfr       97: 8. Locate the class trees in all these modules (in target/classes subdir) and
1.1       thfr       98:    put all of them together, for example with:
                     99:
                    100:    $ rsync -avh gdx/target/classes/* /tmp/
                    101:    $ rsync -avh backends/gdx-backend-lwjgl/target/classes/* /tmp/
                    102:
                    103:    etc. (gdx-jnigen may not be needed anymore in this step.)
                    104:
1.6     ! thfr      105: 9. Remove the original com/badlogic subdir in Slay the Spire and replace it
1.1       thfr      106:    with the one that you just built (in /tmp/com/badlogic following the
                    107:    example code).
                    108:
                    109:    $ rm -rf com/badlogic
                    110:    $ cp -R /tmp/com/badlogic com/
                    111:
1.6     ! thfr      112: 10.The main java class and the arguments for the Java VM are documented in the
1.1       thfr      113:    config.json that comes with the game. Based on that, start the game with the
                    114:    following command:
                    115:
                    116:    $ java -Xmx1G -Dsun.java2d.dpiaware=true com.megacrit.cardcrawl.desktop.DesktopLauncher
                    117:
                    118: Notes:
                    119: ------
                    120:
                    121: * For some reason sometimes the java runtime fails to load libopenal64.so when
                    122:   starting the game. This is usually resolved by simply starting the game again
                    123:   with the same command.
                    124:
                    125: Goals for the Future:
                    126: =====================
                    127:
                    128: * fix gamecontroller support
                    129: * lwjgl3 backend (required for MewnBase)
                    130: * try it with more libgdx games (e.g. Halfway)
                    131: * ...
                    132:
                    133: Contact
                    134: =======
                    135:
                    136: Thomas Frohwein <thfr@openbsd.org>

Contact: <mail@mail.thfr.info>