install_freedoom-git.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 build-essential cmake libpillowfight-dev
  11. echo "INFO: Requires deutex as build dependency"
  12. #echo "INFO: Requires deutex as build dependency, installing..."
  13. #./install_deutex.ksh
  14. #echo "INFO: Requires deutex as build dependency, installing... DONE"
  15. application=freedoom
  16. repository=https://github.com/freedoom/freedoom.git
  17. export compile=
  18. mkdir -p ~/src
  19. cd ~/src || return
  20. if [ ! -d $application ]; then
  21. git clone $repository
  22. cd $application || return
  23. export compile=true
  24. else
  25. cd $application || return
  26. #git pull
  27. pwd
  28. git fetch
  29. LOCAL=$(git rev-parse HEAD)
  30. REMOTE=$(git rev-parse @{u})
  31. if [ ! $LOCAL = $REMOTE ]; then
  32. pwd
  33. echo "Need to pull"
  34. git pull
  35. export compile=true
  36. fi
  37. fi
  38. if [ "$compile" = "true" ]; then
  39. cd ~/src/$application || return
  40. make -j4 DEUTEX=$HOME/src/deutex/src/deutex
  41. mkdir -p $HOME/games/doom/wads/iwads/
  42. mv ./wads/freedm.wad $HOME/games/doom/wads/iwads/freedm-git.wad
  43. mv ./wads/freedoom1.wad $HOME/games/doom/wads/iwads/freedoom1-git.wad
  44. mv ./wads/freedoom2.wad $HOME/games/doom/wads/iwads/freedoom2-git.wad
  45. fi