| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright 2015 Google Inc. | 3 # Copyright 2015 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 # This script will update Skia's dependencies as necessary and run | 8 # This script will update Skia's dependencies as necessary and run |
| 9 # gyp if needed. | 9 # gyp if needed. |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 "managed" : False, | 69 "managed" : False, |
| 70 "custom_deps" : { | 70 "custom_deps" : { |
| 71 }, | 71 }, |
| 72 "safesync_url": "", | 72 "safesync_url": "", |
| 73 }, | 73 }, |
| 74 ] | 74 ] |
| 75 cache_dir = None | 75 cache_dir = None |
| 76 ''' | 76 ''' |
| 77 if current_deps_hash != deps_hash: | 77 if current_deps_hash != deps_hash: |
| 78 # `gclient sync` is very slow, so skip whenever we can. | 78 # `gclient sync` is very slow, so skip whenever we can. |
| 79 try: |
| 80 subprocess.call(['gclient', '--version']) |
| 81 except: |
| 82 sys.stdout.write('gclient missing from $PATH, please install ' + |
| 83 'depot_tools\n https://skia.org/user/quick/desktop\n') |
| 84 exit(1) |
| 79 if not os.path.isfile('.gclient'): | 85 if not os.path.isfile('.gclient'): |
| 80 with open('.gclient', 'w') as o: | 86 with open('.gclient', 'w') as o: |
| 81 o.write(default_gclient_config) | 87 o.write(default_gclient_config) |
| 82 gclient_sync_command = ['gclient', 'sync'] + skia_opt_deps | 88 gclient_sync_command = ['gclient', 'sync'] + skia_opt_deps |
| 83 try: | 89 try: |
| 84 sys.stdout.write('%r\n' % gclient_sync_command) | 90 sys.stdout.write('%r\n' % gclient_sync_command) |
| 85 subprocess.check_call(gclient_sync_command) | 91 subprocess.check_call(gclient_sync_command) |
| 86 except: | 92 except: |
| 87 sys.stderr.write('\n`gclient sync` failed.\n') | 93 sys.stderr.write('\n`gclient sync` failed.\n') |
| 88 os.remove('.deps_sha1') # Unknown state. | 94 try: |
| 95 os.remove('.deps_sha1') # Unknown state. |
| 96 except: |
| 97 pass |
| 89 exit(1) | 98 exit(1) |
| 90 # Only write hash after a successful sync. | 99 # Only write hash after a successful sync. |
| 91 with open('.deps_sha1', 'w') as o: | 100 with open('.deps_sha1', 'w') as o: |
| 92 o.write(deps_hash) | 101 o.write(deps_hash) |
| 93 | 102 |
| 94 hasher = hashlib.sha1() | 103 hasher = hashlib.sha1() |
| 95 | 104 |
| 96 for var in ['AR', 'AR_host', 'AR_target', | 105 for var in ['AR', 'AR_host', 'AR_target', |
| 97 'CC', 'CC_host', 'CC_target', | 106 'CC', 'CC_host', 'CC_target', |
| 98 'CFLAGS', 'CFLAGS_host', | 107 'CFLAGS', 'CFLAGS_host', |
| (...skipping 26 matching lines...) Expand all Loading... |
| 125 return f.read() | 134 return f.read() |
| 126 return '' | 135 return '' |
| 127 | 136 |
| 128 if cat_if_exists(hash_path).strip() != gyp_hash: | 137 if cat_if_exists(hash_path).strip() != gyp_hash: |
| 129 env = os.environ.copy() | 138 env = os.environ.copy() |
| 130 if skia_out: | 139 if skia_out: |
| 131 env['SKIA_OUT'] = skia_out | 140 env['SKIA_OUT'] = skia_out |
| 132 subprocess.call(['python', './gyp_skia'], env=env) | 141 subprocess.call(['python', './gyp_skia'], env=env) |
| 133 with open(hash_path, 'w') as o: | 142 with open(hash_path, 'w') as o: |
| 134 o.write(gyp_hash) | 143 o.write(gyp_hash) |
| OLD | NEW |