Advertisement
Guest User

Untitled

a guest
Dec 4th, 2022
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.70 KB | Gaming | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. set -x
  4.  
  5. if [[ ! -d "lwjgl" ]] ;
  6. then
  7.   if [[ ! -f "lwjgl.zip" ]] ;
  8.   then
  9.     wget https://github.com/LWJGL/lwjgl3/releases/download/3.3.1/lwjgl.zip
  10.   fi
  11.   mkdir lwjgl
  12.   unzip -d lwjgl lwjgl.zip
  13. fi
  14.  
  15. if [[ ! -d "libgdx" ]] ;
  16. then
  17.   git clone https://github.com/libgdx/libgdx.git
  18. fi
  19.  
  20. if [[ ! -f "libgdx/build/natives.zip" ]] ;
  21. then
  22.   cd libgdx || exit
  23.   ./gradlew fetchNatives # Or build?
  24.   cd ..
  25. fi
  26.  
  27. DICE_CLASS_PATH=()
  28.  
  29. DICE_CLASS_PATH+=("./libgdx/gdx/libs/gdx-natives.jar")
  30. DICE_CLASS_PATH+=("./libgdx/extensions/gdx-bullet/libs/gdx-bullet-natives.jar")
  31.  
  32. DICE_CLASS_PATH+=("./lwjgl/lwjgl/lwjgl-natives-linux.jar")
  33. DICE_CLASS_PATH+=("./lwjgl/lwjgl-glfw/lwjgl-glfw-natives-linux.jar")
  34. DICE_CLASS_PATH+=("./lwjgl/lwjgl-openal/lwjgl-openal-natives-linux.jar")
  35. DICE_CLASS_PATH+=("./lwjgl/lwjgl-jemalloc/lwjgl-jemalloc-natives-linux.jar")
  36.  
  37. if [[ ! -d "dice-game" ]] ;
  38. then
  39.   mkdir -p dice-game/libs
  40. fi
  41.  
  42. for filepath in "${DICE_CLASS_PATH[@]}" ; do
  43.   filename="$(basename "$filepath")"
  44.   if [[ ! -f "./dice-game/libs/$filename" ]] ;
  45.   then
  46.     cp "$filepath" ./dice-game/libs/
  47.   fi
  48. done
  49.  
  50. touch ./dice-game/COPY_dice-mac.zip_HERE
  51.  
  52. if [[ ! -f "dice-game/run.sh" ]] ;
  53. then
  54. cat << EOF > ./dice-game/run.sh
  55. #/usr/bin/env bash
  56.  
  57. unzip -nj dice-mac.zip SliceAndDice.app/Contents/Resources/dice.jar
  58.  
  59. DICE_CLASS_PATH=(\${PWD}/libs/*)
  60. DICE_CLASS_PATH+=("dice.jar")
  61.  
  62. old_IFS="\${IFS}"
  63. IFS=':'
  64. java -Dorg.lwjgl.util.Debug=true -Xmx1g -classpath "\${DICE_CLASS_PATH[*]}" com.tann.dice.desktop.DicetopLauncher
  65. IFS="\${old_IFS}"
  66. EOF
  67. fi
  68.  
  69. chmod +x ./dice-game/run.sh
  70.  
  71. echo "Copy the dice-mac.zip file ti ${PWD}/dice-game"
  72. echo "and execute run.sh from the dice-game directory."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement