OLD | NEW |
| (Empty) |
1 #!/bin/sh | |
2 | |
3 # Copyright 2015 Google Inc. | |
4 # | |
5 # Use of this source code is governed by a BSD-style license that can be | |
6 # found in the LICENSE file. | |
7 | |
8 # This script will update Skia's dependenciess as necessary and run | |
9 # gyp if needed. | |
10 | |
11 # Depends on: Posix-compliant shell, Python, and Git. | |
12 # | |
13 # Example usage: | |
14 # | |
15 # git clone https://skia.googlesource.com/skia | |
16 # cd skia | |
17 # bin/deps-and-gyp | |
18 # ninja -C out/Debug && out/Debug/dm | |
19 # | |
20 # Once changes are made to DEPS or gyp/ or the source, call: | |
21 # | |
22 # bin/deps-and-gyp | |
23 | |
24 if [ "$SKIA_OUT" ]; then | |
25 mkdir -p "$SKIA_OUT" || exit | |
26 # get non-relative path of $SKIA_OUT before changing directory. | |
27 SKIA_OUT="$(cd "$SKIA_OUT"; pwd)" | |
28 fi | |
29 | |
30 cd "$(dirname "$0")/.." | |
31 | |
32 if ! [ -f DEPS ]; then | |
33 echo DEPS file missing >&2 | |
34 exit 1 | |
35 fi | |
36 | |
37 GIT_SYNC_DEPS_QUIET=1 python tools/git-sync-deps || exit | |
38 | |
39 catifexists() { if [ -f "$1" ]; then cat "$1"; fi; } | |
40 | |
41 gyp_hasher() { | |
42 { | |
43 echo "$CC" | |
44 echo "$CXX" | |
45 echo "$GYP_GENERATORS" | |
46 echo "$GYP_DEFINES" | |
47 find gyp -type f -print -exec git hash-object {} \; | |
48 find bench gm tests -name '*.c*' | LANG= sort | |
49 } | git hash-object --stdin | |
50 } | |
51 | |
52 : ${SKIA_OUT:=out} | |
53 GYP_HASH=$(gyp_hasher) | |
54 HASH_PATH="${SKIA_OUT}/gyp_hash" | |
55 if [ "$GYP_HASH" != "$(catifexists "$HASH_PATH")" ]; then | |
56 python ./gyp_skia || exit | |
57 echo "$GYP_HASH" > "$HASH_PATH" | |
58 fi | |
OLD | NEW |