| Index: third_party/psutil/build.py
|
| diff --git a/third_party/psutil/build.py b/third_party/psutil/build.py
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..c838d0e50e12f2e9253d43bf5bdbe92c14158176
|
| --- /dev/null
|
| +++ b/third_party/psutil/build.py
|
| @@ -0,0 +1,34 @@
|
| +#!/usr/bin/env python
|
| +# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +"""Simple helper script for building psutil via GYP."""
|
| +
|
| +import os
|
| +import shutil
|
| +import subprocess
|
| +import sys
|
| +import tempfile
|
| +
|
| +
|
| +def Main():
|
| + if len(sys.argv) <= 1:
|
| + print >> sys.stderr, 'Usage: build.py <output dir>'
|
| + sys.exit(1)
|
| +
|
| + # GYP may specify the output path as a relative path. Since we need cwd to be
|
| + # the source directory, we must convert the output path to an absolute path.
|
| + abs_out_path = os.path.abspath(sys.argv[1])
|
| + temp_path = tempfile.mkdtemp()
|
| + try:
|
| + sys.exit(subprocess.call(
|
| + ['python', 'setup.py', 'build', '--build-lib', abs_out_path,
|
| + '--build-temp', temp_path],
|
| + cwd=os.path.dirname(os.path.abspath(__file__))))
|
| + finally:
|
| + shutil.rmtree(temp_path)
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + Main()
|
|
|