2015-03-27 19:11:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# This script will update Skia's dependenciess as necessary and run
|
|
|
|
# gyp if needed.
|
|
|
|
|
2015-11-03 20:07:47 +00:00
|
|
|
# Depends on: Posix-compliant shell, Python, and Git.
|
|
|
|
#
|
|
|
|
# Example usage:
|
2015-03-27 19:11:49 +00:00
|
|
|
#
|
|
|
|
# git clone https://skia.googlesource.com/skia
|
|
|
|
# cd skia
|
2015-11-03 20:07:47 +00:00
|
|
|
# bin/sync-and-gyp
|
|
|
|
# ninja -C out/Debug && out/Debug/dm
|
2015-03-27 19:11:49 +00:00
|
|
|
#
|
2015-11-03 20:07:47 +00:00
|
|
|
# Once changes are made to DEPS or gyp/ or the source, call:
|
2015-03-27 19:11:49 +00:00
|
|
|
#
|
2015-11-03 20:07:47 +00:00
|
|
|
# bin/sync-and-gyp
|
2015-03-27 19:11:49 +00:00
|
|
|
|
2015-11-03 20:07:47 +00:00
|
|
|
if [ "$SKIA_OUT" ]; then
|
|
|
|
mkdir -p "$SKIA_OUT" || exit
|
|
|
|
# get non-relative path of $SKIA_OUT before changing directory.
|
|
|
|
SKIA_OUT="$(cd "$SKIA_OUT"; pwd)"
|
2015-03-27 19:11:49 +00:00
|
|
|
fi
|
|
|
|
|
2015-11-03 20:07:47 +00:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2015-03-27 19:11:49 +00:00
|
|
|
if ! [ -f DEPS ]; then
|
|
|
|
echo DEPS file missing >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-11-03 20:07:47 +00:00
|
|
|
GIT_SYNC_DEPS_QUIET=1 python tools/git-sync-deps || exit
|
2015-03-27 19:11:49 +00:00
|
|
|
|
2015-09-12 00:49:00 +00:00
|
|
|
catifexists() { if [ -f "$1" ]; then cat "$1"; fi; }
|
2015-03-27 19:11:49 +00:00
|
|
|
|
2015-09-12 00:49:00 +00:00
|
|
|
gyp_hasher() {
|
2015-03-27 19:11:49 +00:00
|
|
|
{
|
2015-05-26 15:01:19 +00:00
|
|
|
echo "$CC"
|
|
|
|
echo "$CXX"
|
2015-03-27 19:11:49 +00:00
|
|
|
echo "$GYP_GENERATORS"
|
|
|
|
echo "$GYP_DEFINES"
|
|
|
|
find gyp -type f -print -exec git hash-object {} \;
|
2015-05-26 15:01:19 +00:00
|
|
|
find bench gm tests -name '*.c*' | LANG= sort
|
2015-03-27 19:11:49 +00:00
|
|
|
} | git hash-object --stdin
|
|
|
|
}
|
|
|
|
|
|
|
|
: ${SKIA_OUT:=out}
|
|
|
|
GYP_HASH=$(gyp_hasher)
|
|
|
|
HASH_PATH="${SKIA_OUT}/gyp_hash"
|
|
|
|
if [ "$GYP_HASH" != "$(catifexists "$HASH_PATH")" ]; then
|
2015-04-24 21:33:06 +00:00
|
|
|
python ./gyp_skia || exit
|
2015-03-27 19:11:49 +00:00
|
|
|
echo "$GYP_HASH" > "$HASH_PATH"
|
|
|
|
fi
|