Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: tools/install_dependencies.sh

Issue 1112663002: doc: add quickstart to linux and macos (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-28 (Tuesday) 16:01:10 EDT Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « site/user/quick/macos.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/install_dependencies.sh
diff --git a/tools/install_dependencies.sh b/tools/install_dependencies.sh
index ae98884d1e98f38c281d9718747199b9d1ecfe21..037b8940bd0609f2c5fcff8f4c5c6eeabb8ba087 100755
--- a/tools/install_dependencies.sh
+++ b/tools/install_dependencies.sh
@@ -10,21 +10,35 @@
set -e
+# 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
+}
+
if command -v lsb_release > /dev/null ; then
case $(lsb_release -i -s) in
Ubuntu)
- sudo apt-get install \
- build-essential \
- libfreetype6-dev \
- libfontconfig-dev \
- libpng12-dev \
- libgif-dev \
- libqt4-dev \
- clang
- if [ $(lsb_release -r -s) = '14.04' ] ; then
- sudo apt-get install \
- ninja-build
- fi
+ PACKAGES=$(cat<<-EOF
+ build-essential
+ libfreetype6-dev
+ libfontconfig-dev
+ libpng12-dev
+ libgif-dev
+ libqt4-dev
+ EOF
+ )
+ if [ $(lsb_release -r -s) = '14.04' ] ; then
+ PACKAGES="${PACKAGES} ninja-build"
+ fi
+ if ! dpkg_all_installed $PACKAGES; then
+ sudo apt-get install $PACKAGES
+ fi
exit
;;
esac
« no previous file with comments | « site/user/quick/macos.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698