Debian Codegraph @

tools/install_dependencies.sh

raw
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
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
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
14 set -e
15
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
27 if command -v lsb_release > /dev/null ; then
28 case $(lsb_release -i -s) in
29 Ubuntu|Debian)
30 PACKAGES=$(cat<<-EOF
31 build-essential
32 freeglut3-dev
33 libfontconfig-dev
34 libfreetype6-dev
35 libgl1-mesa-dev
36 libglu1-mesa-dev
37 libharfbuzz-dev
38 libicu-dev
39 libjpeg-dev
40 libpng-dev
41 libwebp-dev
42 libx11-xcb-dev
43 libxcb-xkb-dev
44 EOF
45 )
46 if [ $(lsb_release -r -s) = '14.04' ] ; then
47 PACKAGES="${PACKAGES} ninja-build"
48 fi
49 if ! dpkg_all_installed $PACKAGES; then
50 sudo apt-get $1 install $PACKAGES
51 fi
52 exit
53 ;;
54 esac
55 fi
56
57 echo 'unknown system'
58 exit 1