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

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:
                     38: This is based on my testing on OpenBSD 6.4-current with jdk-1.8.0.202v0.
                     39:
                     40: Prerequisite Packages:
                     41: ----------------------
                     42:
                     43: * openal
                     44: * lwjgl
                     45: * jdk
1.3       thfr       46: * maven
1.2       thfr       47: * apache-ant
1.1       thfr       48: * rsync
                     49:
                     50: Also Slay the Spire, release version 1.0 (needs to be obtained via Steam on
1.3       thfr       51: another operating system). Windows or Linux downloads have been reported to
                     52: work.
1.1       thfr       53:
                     54: Step-by-Step:
                     55: -------------
                     56:
                     57: 1. Copy the files of Slay the Spire to your OpenBSD installation.
                     58:
1.3       thfr       59: 2. Locate desktop-1.0.jar and extract it to a separate directory:
                     60:
                     61:    $ mkdir unjar
                     62:    $ cd unjar
                     63:    $ jar xvf path/to/desktop-1.0.jar
1.1       thfr       64:
                     65: 3. Replace libopenal64.so and liblwjgl64.so with the corresponding libraries
                     66:    from the packages, for example:
                     67:
                     68:    $ cp /usr/local/lib/libopenal.so.3.1 libopenal64.so
                     69:
                     70: 4. Obtain the libgdx-openbsd code:
                     71:
                     72:    $ cvs -d anoncvs@anoncvs.thfr.info:/cvs checkout -P projects/libgdx-openbsd
                     73:
                     74: 5. Build native (JNI) libs of the libgdx project:
                     75:
                     76:    $ cd gdx/jni && ant -f build-openbsd64.xml && cd -
                     77:    $ cd extensions/gdx-freetype/jni && ant -f build-openbsd64.xml && cd -
                     78:    $ cd extensions/gdx-controllers/gdx-controllers-desktop/jni && \
                     79:      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:
                     85: 7. Open the libgdx-openbsd directory in intellij(1). This will import the Maven
                     86:    project.
                     87:
1.3       thfr       88: 8. Go into the following subdirectories and run
                     89:
                     90:    $ mvn package
                     91:
                     92:    in each of them, thereby creating the required class files:
1.1       thfr       93:    - extensions/gdx-jnigen
                     94:    - gdx
                     95:    - backends/gdx-backend-lwjgl
                     96:    - extensions/gdx-freetype
                     97:    - extensions/gdx-controllers/gdx-controllers
                     98:    - extensions/gdx-controllers/gdx-controllers-desktop
                     99:
                    100: 9. Locate the class trees in all these modules (in target/classes subdir) and
                    101:    put all of them together, for example with:
                    102:
                    103:    $ rsync -avh gdx/target/classes/* /tmp/
                    104:    $ rsync -avh backends/gdx-backend-lwjgl/target/classes/* /tmp/
                    105:
                    106:    etc. (gdx-jnigen may not be needed anymore in this step.)
                    107:
                    108: 10.Remove the original com/badlogic subdir in Slay the Spire and replace it
                    109:    with the one that you just built (in /tmp/com/badlogic following the
                    110:    example code).
                    111:
                    112:    $ rm -rf com/badlogic
                    113:    $ cp -R /tmp/com/badlogic com/
                    114:
                    115: 11.The main java class and the arguments for the Java VM are documented in the
                    116:    config.json that comes with the game. Based on that, start the game with the
                    117:    following command:
                    118:
                    119:    $ java -Xmx1G -Dsun.java2d.dpiaware=true com.megacrit.cardcrawl.desktop.DesktopLauncher
                    120:
                    121: Notes:
                    122: ------
                    123:
                    124: * For some reason sometimes the java runtime fails to load libopenal64.so when
                    125:   starting the game. This is usually resolved by simply starting the game again
                    126:   with the same command.
                    127:
                    128: Goals for the Future:
                    129: =====================
                    130:
                    131: * fix gamecontroller support
                    132: * lwjgl3 backend (required for MewnBase)
                    133: * try it with more libgdx games (e.g. Halfway)
                    134: * ...
                    135:
                    136: Contact
                    137: =======
                    138:
                    139: Thomas Frohwein <thfr@openbsd.org>

Contact: <mail@mail.thfr.info>