commit-bot@chromium.org | 0d317d3 | 2014-04-16 22:10:48 +0000 | [diff] [blame] | 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 | |
commit-bot@chromium.org | 3df4e95 | 2014-05-05 13:30:06 +0000 | [diff] [blame] | 7 | # install_dependencies.sh will install system-specific Skia |
| 8 | # dependencies using your system's package manager. If your system is |
| 9 | # not supported, add logic here to support it. |
| 10 | |
commit-bot@chromium.org | 3056bdd | 2014-05-20 15:07:53 +0000 | [diff] [blame] | 11 | set -e |
| 12 | |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 13 | # Return 0 iff all package name arguments are installed. |
| 14 | dpkg_all_installed() { |
| 15 | for arg; do |
| 16 | if !(dpkg-query -W -f'${Status}' "$arg" 2>/dev/null | \ |
| 17 | grep -q "ok installed"); then |
| 18 | return 1 |
| 19 | fi |
| 20 | done |
| 21 | return 0 |
| 22 | } |
| 23 | |
commit-bot@chromium.org | 0d317d3 | 2014-04-16 22:10:48 +0000 | [diff] [blame] | 24 | if command -v lsb_release > /dev/null ; then |
| 25 | case $(lsb_release -i -s) in |
| 26 | Ubuntu) |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 27 | PACKAGES=$(cat<<-EOF |
| 28 | build-essential |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 29 | freeglut3-dev |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 30 | libfontconfig-dev |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 31 | libfreetype6-dev |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 32 | libgif-dev |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 33 | libglu1-mesa-dev |
| 34 | libosmesa6-dev |
| 35 | libpng12-dev |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 36 | libqt4-dev |
| 37 | EOF |
| 38 | ) |
| 39 | if [ $(lsb_release -r -s) = '14.04' ] ; then |
| 40 | PACKAGES="${PACKAGES} ninja-build" |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 41 | fi |
| 42 | if ! dpkg_all_installed $PACKAGES; then |
| 43 | sudo apt-get install $PACKAGES |
| 44 | fi |
| 45 | exit |
| 46 | ;; |
commit-bot@chromium.org | 0d317d3 | 2014-04-16 22:10:48 +0000 | [diff] [blame] | 47 | esac |
| 48 | fi |
| 49 | |
| 50 | echo 'unknown system' |
| 51 | exit 1 |