install_dhewm3-sdk_d3le.sh 739 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/ksh
  2. doas pkg_add cmake gmake ninja curl sdl2 openal
  3. application=dhewm3-sdk
  4. repository=https://github.com/dhewm/dhewm3-sdk.git
  5. export compile=
  6. mkdir -p ~/src
  7. cd ~/src || return
  8. if [ ! -d $application ]; then
  9. git clone -b d3le $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. mkdir -p build
  29. cd build
  30. cmake ../
  31. gmake -j4
  32. doas mkdir -p /usr/local/lib/dhewm3/
  33. doas cp -v d3le.so /usr/local/lib/dhewm3/
  34. fi