install_dsda-doom.sh 992 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 pacman -Sy --noconfirm --needed cmake imagemagick
  11. $su pacman -Sy --noconfirm --needed sdl2
  12. $su pacman -Sy --noconfirm --needed fluidsynth glu libmad sdl2_image sdl2_mixer sdl2_net dumb portmidi
  13. application=dsda-doom
  14. repository=https://github.com/kraflab/dsda-doom.git
  15. export compile=
  16. mkdir -p ~/src
  17. cd ~/src || return
  18. if [ ! -d $application ]; then
  19. git clone $repository
  20. cd $application || return
  21. export compile=true
  22. else
  23. cd $application || return
  24. #git pull
  25. pwd
  26. git fetch
  27. LOCAL=$(git rev-parse HEAD)
  28. REMOTE=$(git rev-parse @{u})
  29. if [ ! $LOCAL = $REMOTE ]; then
  30. pwd
  31. echo "Need to pull"
  32. git pull
  33. export compile=true
  34. fi
  35. fi
  36. if [ "$compile" = "true" ]; then
  37. cd ~/src/$application || return
  38. cd prboom2 || return
  39. mkdir -p build && cd build
  40. cmake .. -DCMAKE_BUILD_TYPE=Release
  41. make
  42. fi