install_devilutionx.ksh 735 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/ksh
  2. doas pkg_add cmake sdl2 libsodium libpng bzip2 gmake
  3. application=devilutionX
  4. repository=https://github.com/diasurgical/devilutionX.git
  5. export compile=
  6. mkdir -p ~/src
  7. cd ~/src || return
  8. if [ ! -d $application ]; then
  9. git clone $repository
  10. cd $application || return
  11. export compile=true
  12. else
  13. cd $application || return
  14. #git pull
  15. pwd
  16. git fetch
  17. LOCAL=$(git rev-parse HEAD)
  18. REMOTE=$(git rev-parse @{u})
  19. if [ ! $LOCAL = $REMOTE ]; then
  20. pwd
  21. echo "Need to pull"
  22. git pull
  23. export compile=true
  24. fi
  25. fi
  26. if [ "$compile" = "true" ]; then
  27. cd ~/src/$application || return
  28. cmake -S. -Bbuild -DCMAKE_MAKE_PROGRAM=gmake -DCMAKE_BUILD_TYPE=Release
  29. cmake --build build -j $(sysctl -n hw.ncpuonline)
  30. fi