install_umoria.ksh 903 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/ksh
  2. # https://github.com/dungeons-of-moria/umoria/issues/69
  3. doas pkg_add autoconf-2.71 gcc-11.2.0p9 g++-11.2.0p9 gmake
  4. application=umoria
  5. repository=https://github.com/dungeons-of-moria/umoria.git
  6. export compile=
  7. mkdir -p ~/src
  8. cd ~/src || return
  9. if [ ! -d $application ]; then
  10. git clone $repository
  11. cd $application || return
  12. export compile=true
  13. else
  14. cd $application || return
  15. #git pull
  16. pwd
  17. git fetch
  18. LOCAL=$(git rev-parse HEAD)
  19. REMOTE=$(git rev-parse @{u})
  20. if [ ! $LOCAL = $REMOTE ]; then
  21. pwd
  22. echo "Need to pull"
  23. git pull
  24. export compile=true
  25. fi
  26. fi
  27. if [ "$compile" = "true" ]; then
  28. cd ~/src/$application || return
  29. git stash && git stash clear
  30. mkdir -p build && cd build
  31. sed -ie 's/CMAKE_CXX_COMPILER g++/CMAKE_CXX_COMPILER eg++/g' ../CMakeLists.txt
  32. sed -ie 's/ __MORPHOS__/ __MORPHOS__ || __OpenBSD__/g' ../src/headers.h
  33. cmake ..
  34. gmake
  35. fi