common.sh 975 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash -e
  2. # Linux build only
  3. install_linux_deps() {
  4. local pkgs=(
  5. cmake gettext postgresql
  6. libpng-dev libjpeg-dev libgl1-mesa-dev libsdl2-dev
  7. libsqlite3-dev libhiredis-dev libogg-dev libgmp-dev libvorbis-dev
  8. libopenal-dev libpq-dev libleveldb-dev libcurl4-openssl-dev libzstd-dev
  9. )
  10. sudo apt-get update
  11. sudo apt-get install -y --no-install-recommends "${pkgs[@]}" "$@"
  12. sudo systemctl start postgresql.service
  13. sudo -u postgres psql <<<"
  14. CREATE USER minetest WITH PASSWORD 'minetest';
  15. CREATE DATABASE minetest;
  16. "
  17. }
  18. # macOS build only
  19. install_macos_deps() {
  20. local pkgs=(
  21. cmake gettext freetype gmp jpeg-turbo jsoncpp leveldb
  22. libogg libpng libvorbis luajit zstd
  23. )
  24. export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
  25. export HOMEBREW_NO_INSTALL_CLEANUP=1
  26. # contrary to how it may look --auto-update makes brew do *less*
  27. brew update --auto-update
  28. brew install --display-times "${pkgs[@]}"
  29. brew unlink $(brew ls --formula)
  30. brew link "${pkgs[@]}"
  31. }