install_yquake2-xatrix.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/ksh
  2. doas pkg_add gmake sdl2 openal curl
  3. if [ ! -d ~/src/yquake2/release ]; then
  4. ./install_yquake2.sh
  5. fi
  6. application=yquake2-xatrix
  7. repository=https://github.com/yquake2/xatrix.git
  8. export compile=
  9. mkdir -p ~/src
  10. cd ~/src || return
  11. if [ ! -d $application ]; then
  12. git clone $repository $application
  13. cd $application || return
  14. export compile=true
  15. else
  16. cd $application || return
  17. #git pull
  18. pwd
  19. git fetch
  20. LOCAL=$(git rev-parse HEAD)
  21. REMOTE=$(git rev-parse @{u})
  22. if [ ! $LOCAL = $REMOTE ]; then
  23. pwd
  24. echo "Need to pull"
  25. git pull
  26. export compile=true
  27. fi
  28. fi
  29. if [ "$compile" = "true" ]; then
  30. cd ~/src/$application || return
  31. gmake -j4
  32. if [ -d ~/src/yquake2/release ]; then
  33. mkdir -p ~/src/yquake2/release/xatrix/maps/
  34. cp ~/src/$application/release/game.so ~/src/yquake2/release/xatrix/
  35. #TODO ent files move
  36. cp ~/src/$application/stuff/mapfixes/*.ent ~/src/yquake2/release/xatrix/maps/
  37. else
  38. printf "INFO: Run scripts/openbsd/games/install_yquake2.sh script \n"
  39. printf " and move ./release/game.so file to ~/src/yquake2/release/xatrix/\n"
  40. printf " and move ./stuff/mapfixes/*.ent files to ~/src/yquake2/release/xatrix/maps\n"
  41. fi
  42. fi