Chromium Code Reviews| Index: client/deps/piglit/piglit.py |
| diff --git a/client/deps/piglit/piglit.py b/client/deps/piglit/piglit.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..66db8b904587e155fc2bf9dfede6fa2f4e304d6d |
| --- /dev/null |
| +++ b/client/deps/piglit/piglit.py |
| @@ -0,0 +1,44 @@ |
| +#!/usr/bin/python |
| + |
| +# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import os, shutil, re |
|
DaleCurtis
2011/04/08 16:58:18
alphabetize imports.
ilja
2011/04/08 21:42:24
Done.
ilja
2011/04/08 21:42:24
Done.
|
| +from autotest_lib.client.bin import utils |
| + |
| +version = 3 |
| + |
| +def setup(topdir): |
| + sysroot = os.environ['SYSROOT'] |
| + # IHF: piglit only builds on x86 right (Tegra2 only supporting GLES) |
|
DaleCurtis
2011/04/08 16:58:18
# TODO(ihf): ...
ilja
2011/04/08 21:42:24
Done.
|
| + print ('INFO: piglit sysroot = ' + sysroot) |
|
DaleCurtis
2011/04/08 16:58:18
use logging not print.
|
| + tarball = 'piglit.tar.gz' |
| + srcdir = os.path.join(topdir, 'src') |
| + tarball_path = os.path.join(srcdir, tarball) |
| + dst_path = os.path.join(topdir, 'piglit') |
| + # in-source build, clean/overwrite destination |
| + shutil.rmtree(dst_path, ignore_errors=True) |
| + if re.search('x86', sysroot.lower()): |
| + utils.extract_tarball_to_dir(tarball_path, dst_path) |
| + # patch in a single config file for now |
| + shutil.copyfile(os.path.join(srcdir, 'cros-driver.tests'), |
| + os.path.join(dst_path, 'tests/cros-driver.tests')) |
| + os.chdir(dst_path) |
| + # we have to tell cmake where to find glut |
| + cmd = 'cmake -DCMAKE_FIND_ROOT_PATH=' + sysroot |
| + cmd = cmd + ' -DGLUT_INCLUDE_DIR=' + sysroot + '/usr/include' |
| + cmd = cmd + ' -DGLUT_glut_LIBRARY=' + sysroot + '/usr/lib/libglut.so' |
| + utils.run(cmd) |
| + utils.make('-j %d' % utils.count_cpus()) |
| + os.chdir(topdir) |
| + else: |
| + print 'WARNING: Skipping piglit build. piglit needs OpenGL (x86 boards)' |
|
DaleCurtis
2011/04/08 16:58:18
Logging.
ilja
2011/04/08 21:42:24
Done.
|
| + dst_path = os.path.join(topdir, 'piglit') |
| + # still create an empty directory |
| + if not os.path.exists(dst_path): |
| + os.makedirs(dst_path) |
| + |
| +pwd = os.getcwd() |
| +utils.update_version(pwd + '/src', True, version, setup, pwd) |
| + |