install.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. echo "This script will install Free Oberon."
  3. echo "Free Oberon dependencies are:"
  4. echo " * Allegro5 - for the module Graph and the graphical IDE"
  5. echo " * Git - to download Ofront+"
  6. echo " * GCC - for Ofront+ to compile the generated C-code"
  7. echo
  8. echo "You can find the information on how to install the dependencies in the"
  9. echo "README.md file."
  10. echo
  11. echo "On OS Debian / Ubuntu / Linux Mint and so on:"
  12. echo " sudo apt-get update"
  13. echo " sudo apt-get install -y git gcc libc-dev liballegro5-dev"
  14. echo "or:"
  15. echo " su"
  16. echo " apt-get update"
  17. echo " apt-get install -y git gcc libc-dev liballegro5-dev"
  18. echo
  19. echo "On OS Fedora:"
  20. echo " sudo dnf install -y git gcc glibc-devel allegro5-devel allegro5-addon-image allegro5-addon-audio allegro5-addon-acodec allegro5-addon-dialog allegro5-devel allegro5-addon-image-devel allegro5-addon-audio-devel allegro5-addon-acodec-devel allegro5-addon-dialog-devel argro5-addon-dialog-devel"
  21. echo
  22. echo "On Arch Linux:"
  23. echo " sudo pacman -Sy git gcc pkgconf glibc allegro"
  24. echo
  25. echo "On openSUSE:"
  26. echo " sudo zypper install -y git gcc glibc-devel liballegro5_2-devel liballegro_audio5_2-devel liballegro_image5_2-devel liballegro_primitives5_2-devel liballegro_dialog5_2-devel liballegro_acodec5_2-devel liballegro_acodec5_2-devel liballegro_font5_2-devel"
  27. echo
  28. read -p "Are the dependencies installed? [y/n] " -n 1 -r
  29. echo
  30. if [[ $REPLY =~ ^[Yy]$ ]]; then
  31. echo "======================="
  32. echo "Downloading Ofront+ if not exists..."
  33. # Only run git command if dot-git subdirectory exists
  34. [ -d ".git" ] && git submodule update --init
  35. echo "======================="
  36. echo "Building Ofront+..."
  37. cd Data/bin/OfrontPlus/Target/Linux_amd64/Bin
  38. ./build
  39. cd ../../../../../..
  40. echo "======================="
  41. echo "Building Free Oberon..."
  42. cd src
  43. ./make.sh
  44. cd ..
  45. echo "======================="
  46. if [ -f "./FreeOberon" ]; then
  47. echo "Free Oberon is installed. You can now run: ./FreeOberon"
  48. echo "Add the following line to ~/.bashrc to use the command 'fob':"
  49. echo "export PATH=$PWD:\$PATH"
  50. else
  51. echo "An error occurred while setting up Free Oberon."
  52. echo "Please check your dependencies."
  53. fi
  54. fi