Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -x
- if [[ ! -d "lwjgl" ]] ;
- then
- if [[ ! -f "lwjgl.zip" ]] ;
- then
- wget https://github.com/LWJGL/lwjgl3/releases/download/3.3.1/lwjgl.zip
- fi
- mkdir lwjgl
- unzip -d lwjgl lwjgl.zip
- fi
- if [[ ! -d "libgdx" ]] ;
- then
- git clone https://github.com/libgdx/libgdx.git
- fi
- if [[ ! -f "libgdx/build/natives.zip" ]] ;
- then
- cd libgdx || exit
- ./gradlew fetchNatives # Or build?
- cd ..
- fi
- DICE_CLASS_PATH=()
- DICE_CLASS_PATH+=("./libgdx/gdx/libs/gdx-natives.jar")
- DICE_CLASS_PATH+=("./libgdx/extensions/gdx-bullet/libs/gdx-bullet-natives.jar")
- DICE_CLASS_PATH+=("./lwjgl/lwjgl/lwjgl-natives-linux.jar")
- DICE_CLASS_PATH+=("./lwjgl/lwjgl-glfw/lwjgl-glfw-natives-linux.jar")
- DICE_CLASS_PATH+=("./lwjgl/lwjgl-openal/lwjgl-openal-natives-linux.jar")
- DICE_CLASS_PATH+=("./lwjgl/lwjgl-jemalloc/lwjgl-jemalloc-natives-linux.jar")
- if [[ ! -d "dice-game" ]] ;
- then
- mkdir -p dice-game/libs
- fi
- for filepath in "${DICE_CLASS_PATH[@]}" ; do
- filename="$(basename "$filepath")"
- if [[ ! -f "./dice-game/libs/$filename" ]] ;
- then
- cp "$filepath" ./dice-game/libs/
- fi
- done
- touch ./dice-game/COPY_dice-mac.zip_HERE
- if [[ ! -f "dice-game/run.sh" ]] ;
- then
- cat << EOF > ./dice-game/run.sh
- #/usr/bin/env bash
- unzip -nj dice-mac.zip SliceAndDice.app/Contents/Resources/dice.jar
- DICE_CLASS_PATH=(\${PWD}/libs/*)
- DICE_CLASS_PATH+=("dice.jar")
- old_IFS="\${IFS}"
- IFS=':'
- java -Dorg.lwjgl.util.Debug=true -Xmx1g -classpath "\${DICE_CLASS_PATH[*]}" com.tann.dice.desktop.DicetopLauncher
- IFS="\${old_IFS}"
- EOF
- fi
- chmod +x ./dice-game/run.sh
- echo "Copy the dice-mac.zip file ti ${PWD}/dice-game"
- echo "and execute run.sh from the dice-game directory."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement