diff options
-rw-r--r-- | site/user/quick/linux.md | 36 | ||||
-rw-r--r-- | site/user/quick/macos.md | 32 | ||||
-rwxr-xr-x | tools/install_dependencies.sh | 38 |
3 files changed, 94 insertions, 12 deletions
diff --git a/site/user/quick/linux.md b/site/user/quick/linux.md index ef4f95b667..7a172a5d95 100644 --- a/site/user/quick/linux.md +++ b/site/user/quick/linux.md @@ -1,6 +1,42 @@ Linux ===== +Quickstart +---------- + +1. Install depot tools. + + <!--?prettify lang=sh?--> + + git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' + export PATH="${PWD}/depot_tools:${PATH}" + +2. Get Skia. + + <!--?prettify lang=sh?--> + + git clone 'https://skia.googlesource.com/skia' + cd skia + +3. Install Dependencies (may require sudo). + + <!--?prettify lang=sh?--> + + tools/install_dependencies.sh + +4. Build. + + <!--?prettify lang=sh?--> + + bin/sync-and-gyp && ninja -C out/Debug + +5. Run DM (the Skia test app) and SampleApp. + + <!--?prettify lang=sh?--> + + out/Debug/dm + out/Debug/SampleApp + Prerequisites ------------- diff --git a/site/user/quick/macos.md b/site/user/quick/macos.md index ed74551d8b..c9d09a3bf1 100644 --- a/site/user/quick/macos.md +++ b/site/user/quick/macos.md @@ -1,6 +1,38 @@ Mac OS X ======== +Quickstart +---------- + +1. Install [XCode](http://developer.apple.com/xcode/). + +2. Install depot tools. + + <!--?prettify lang=sh?--> + + git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' + export PATH="${PWD}/depot_tools:${PATH}" + +3. Get Skia. + + <!--?prettify lang=sh?--> + + git clone 'https://skia.googlesource.com/skia' + cd skia + +4. Build. + + <!--?prettify lang=sh?--> + + bin/sync-and-gyp && ninja -C out/Debug + +5. Run DM (the Skia test app) and SampleApp. + + <!--?prettify lang=sh?--> + + out/Debug/dm + open out/Debug/SampleApp.app + Prerequisites ------------- diff --git a/tools/install_dependencies.sh b/tools/install_dependencies.sh index ae98884d1e..037b8940bd 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 |