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 | |
Joe Gregorio | 7d63f91 | 2020-12-29 10:15:15 -0500 | [diff] [blame] | 11 | # Pass in --yes as the first argument to force apt-get to skip Y/n prompts while |
| 12 | # being backward compatible with the old behavior. |
| 13 | |
commit-bot@chromium.org | 3056bdd | 2014-05-20 15:07:53 +0000 | [diff] [blame] | 14 | set -e |
| 15 | |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 16 | # Return 0 iff all package name arguments are installed. |
| 17 | dpkg_all_installed() { |
| 18 | for arg; do |
| 19 | if !(dpkg-query -W -f'${Status}' "$arg" 2>/dev/null | \ |
| 20 | grep -q "ok installed"); then |
| 21 | return 1 |
| 22 | fi |
| 23 | done |
| 24 | return 0 |
| 25 | } |
| 26 | |
commit-bot@chromium.org | 0d317d3 | 2014-04-16 22:10:48 +0000 | [diff] [blame] | 27 | if command -v lsb_release > /dev/null ; then |
| 28 | case $(lsb_release -i -s) in |
Yuqian Li | bc8bb02 | 2018-02-09 10:52:18 +0800 | [diff] [blame] | 29 | Ubuntu|Debian) |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 30 | PACKAGES=$(cat<<-EOF |
| 31 | build-essential |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 32 | freeglut3-dev |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 33 | libfontconfig-dev |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 34 | libfreetype6-dev |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 35 | libgif-dev |
Yuqian Li | bc8bb02 | 2018-02-09 10:52:18 +0800 | [diff] [blame] | 36 | libgl1-mesa-dev |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 37 | libglu1-mesa-dev |
Ben Wagner | feae867 | 2019-05-03 19:16:35 -0400 | [diff] [blame] | 38 | libharfbuzz-dev |
Ben Wagner | 8ac78aa | 2019-05-03 17:26:12 -0400 | [diff] [blame] | 39 | libicu-dev |
| 40 | libjpeg-dev |
Yuqian Li | bc8bb02 | 2018-02-09 10:52:18 +0800 | [diff] [blame] | 41 | libpng-dev |
Ben Wagner | 8ac78aa | 2019-05-03 17:26:12 -0400 | [diff] [blame] | 42 | libwebp-dev |
halcanary | 5190a48 | 2015-04-28 13:06:54 -0700 | [diff] [blame] | 43 | EOF |
| 44 | ) |
| 45 | if [ $(lsb_release -r -s) = '14.04' ] ; then |
| 46 | PACKAGES="${PACKAGES} ninja-build" |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 47 | fi |
| 48 | if ! dpkg_all_installed $PACKAGES; then |
Joe Gregorio | 7d63f91 | 2020-12-29 10:15:15 -0500 | [diff] [blame] | 49 | sudo apt-get $1 install $PACKAGES |
tikuta | d9ee597 | 2016-09-02 05:21:40 -0700 | [diff] [blame] | 50 | fi |
| 51 | exit |
| 52 | ;; |
commit-bot@chromium.org | 0d317d3 | 2014-04-16 22:10:48 +0000 | [diff] [blame] | 53 | esac |
| 54 | fi |
| 55 | |
| 56 | echo 'unknown system' |
| 57 | exit 1 |