install_chocolate-descent.sh 975 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. #$su apt-get install -y gcc make libsdl2-dev libsdl2-net-dev libsdl2-mixer-dev libopenal-dev libfluidsynth-dev fluidsynth
  11. $su apt-get install -y gcc make libsdl2-dev libsdl2-net-dev libopenal-dev fluidsynth
  12. application=ChocolateDescent
  13. repository=https://github.com/InsanityBringer/ChocolateDescent.git
  14. export compile=
  15. mkdir -p ~/src
  16. cd ~/src || return
  17. if [ ! -d $application ]; then
  18. git clone $repository
  19. cd $application || return
  20. export compile=true
  21. else
  22. cd $application || return
  23. #git pull
  24. pwd
  25. git fetch
  26. LOCAL=$(git rev-parse HEAD)
  27. REMOTE=$(git rev-parse @{u})
  28. if [ ! $LOCAL = $REMOTE ]; then
  29. pwd
  30. echo "Need to pull"
  31. git pull
  32. export compile=true
  33. fi
  34. fi
  35. if [ "$compile" = "true" ]; then
  36. cd ~/src/$application || return
  37. make ChocolateDescent
  38. make ChocolateDescent2
  39. fi