install_dependencies.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. # Copyright 2014 Google Inc.
  3. #
  4. # Use of this source code is governed by a BSD-style license that can be
  5. # found in the LICENSE file.
  6. # install_dependencies.sh will install system-specific Skia
  7. # dependencies using your system's package manager. If your system is
  8. # not supported, add logic here to support it.
  9. set -e
  10. # Return 0 iff all package name arguments are installed.
  11. dpkg_all_installed() {
  12. for arg; do
  13. if !(dpkg-query -W -f'${Status}' "$arg" 2>/dev/null | \
  14. grep -q "ok installed"); then
  15. return 1
  16. fi
  17. done
  18. return 0
  19. }
  20. if command -v lsb_release > /dev/null ; then
  21. case $(lsb_release -i -s) in
  22. Ubuntu|Debian)
  23. PACKAGES=$(cat<<-EOF
  24. build-essential
  25. freeglut3-dev
  26. libfontconfig-dev
  27. libfreetype6-dev
  28. libgif-dev
  29. libgl1-mesa-dev
  30. libglu1-mesa-dev
  31. libharfbuzz-dev
  32. libicu-dev
  33. libjpeg-dev
  34. libpng-dev
  35. libwebp-dev
  36. EOF
  37. )
  38. if [ $(lsb_release -r -s) = '14.04' ] ; then
  39. PACKAGES="${PACKAGES} ninja-build"
  40. fi
  41. if ! dpkg_all_installed $PACKAGES; then
  42. sudo apt-get install $PACKAGES
  43. fi
  44. exit
  45. ;;
  46. esac
  47. fi
  48. echo 'unknown system'
  49. exit 1