2014-04-16 22:10:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2014 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2014-05-05 13:30:06 +00:00
|
|
|
# install_dependencies.sh will install system-specific Skia
|
|
|
|
# dependencies using your system's package manager. If your system is
|
|
|
|
# not supported, add logic here to support it.
|
|
|
|
|
2014-05-20 15:07:53 +00:00
|
|
|
set -e
|
|
|
|
|
2015-04-28 20:06:54 +00:00
|
|
|
# Return 0 iff all package name arguments are installed.
|
|
|
|
dpkg_all_installed() {
|
|
|
|
for arg; do
|
|
|
|
if !(dpkg-query -W -f'${Status}' "$arg" 2>/dev/null | \
|
|
|
|
grep -q "ok installed"); then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2014-04-16 22:10:48 +00:00
|
|
|
if command -v lsb_release > /dev/null ; then
|
|
|
|
case $(lsb_release -i -s) in
|
2018-02-09 02:52:18 +00:00
|
|
|
Ubuntu|Debian)
|
2015-04-28 20:06:54 +00:00
|
|
|
PACKAGES=$(cat<<-EOF
|
|
|
|
build-essential
|
2016-09-02 12:21:40 +00:00
|
|
|
freeglut3-dev
|
2015-04-28 20:06:54 +00:00
|
|
|
libfontconfig-dev
|
2016-09-02 12:21:40 +00:00
|
|
|
libfreetype6-dev
|
2015-04-28 20:06:54 +00:00
|
|
|
libgif-dev
|
2018-02-09 02:52:18 +00:00
|
|
|
libgl1-mesa-dev
|
2016-09-02 12:21:40 +00:00
|
|
|
libglu1-mesa-dev
|
2019-05-03 23:16:35 +00:00
|
|
|
libharfbuzz-dev
|
2019-05-03 21:26:12 +00:00
|
|
|
libicu-dev
|
|
|
|
libjpeg-dev
|
2018-02-09 02:52:18 +00:00
|
|
|
libpng-dev
|
2019-05-03 21:26:12 +00:00
|
|
|
libwebp-dev
|
2015-04-28 20:06:54 +00:00
|
|
|
EOF
|
|
|
|
)
|
|
|
|
if [ $(lsb_release -r -s) = '14.04' ] ; then
|
|
|
|
PACKAGES="${PACKAGES} ninja-build"
|
2016-09-02 12:21:40 +00:00
|
|
|
fi
|
|
|
|
if ! dpkg_all_installed $PACKAGES; then
|
|
|
|
sudo apt-get install $PACKAGES
|
|
|
|
fi
|
|
|
|
exit
|
|
|
|
;;
|
2014-04-16 22:10:48 +00:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo 'unknown system'
|
|
|
|
exit 1
|