blob: 9d1a45fa157441f5169b359ca3bc82af45a85820 [file] [log] [blame]
commit-bot@chromium.org0d317d32014-04-16 22:10:48 +00001#!/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.org3df4e952014-05-05 13:30:06 +00007# 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.org3056bdd2014-05-20 15:07:53 +000011set -e
12
halcanary5190a482015-04-28 13:06:54 -070013# Return 0 iff all package name arguments are installed.
14dpkg_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.org0d317d32014-04-16 22:10:48 +000024if command -v lsb_release > /dev/null ; then
25 case $(lsb_release -i -s) in
26 Ubuntu)
halcanary5190a482015-04-28 13:06:54 -070027 PACKAGES=$(cat<<-EOF
28 build-essential
tikutad9ee5972016-09-02 05:21:40 -070029 freeglut3-dev
halcanary5190a482015-04-28 13:06:54 -070030 libfontconfig-dev
tikutad9ee5972016-09-02 05:21:40 -070031 libfreetype6-dev
halcanary5190a482015-04-28 13:06:54 -070032 libgif-dev
tikutad9ee5972016-09-02 05:21:40 -070033 libglu1-mesa-dev
tikutad9ee5972016-09-02 05:21:40 -070034 libpng12-dev
halcanary5190a482015-04-28 13:06:54 -070035 libqt4-dev
36 EOF
37 )
38 if [ $(lsb_release -r -s) = '14.04' ] ; then
39 PACKAGES="${PACKAGES} ninja-build"
tikutad9ee5972016-09-02 05:21:40 -070040 fi
41 if ! dpkg_all_installed $PACKAGES; then
42 sudo apt-get install $PACKAGES
43 fi
44 exit
45 ;;
commit-bot@chromium.org0d317d32014-04-16 22:10:48 +000046 esac
47fi
48
49echo 'unknown system'
50exit 1