12from __future__
import print_function
21ENV_VAR =
'CHROMEBOOK_X86_64_GLES_LIB_PATH'
25 val = os.environ.get(key)
27 print((
'Environment variable %s not set; you should run this via '
28 'create_and_upload.py.' % key), file=sys.stderr)
34 """Create the asset."""
37 'sudo',
'apt-get',
'install',
41 subprocess.check_call(cmd)
44 lib_dir = os.path.join(target_dir,
'lib')
47 to_copy = glob.glob(os.path.join(gl_path,
'libGL*'))
48 to_copy.extend(glob.glob(os.path.join(gl_path,
'libEGL*')))
49 to_copy.extend(glob.glob(os.path.join(gl_path,
'libdrm*')))
51 shutil.copy(f, lib_dir)
53 include_dir = os.path.join(target_dir,
'include')
55 shutil.copytree(
'/usr/include/EGL', os.path.join(include_dir,
'EGL'))
56 shutil.copytree(
'/usr/include/KHR', os.path.join(include_dir,
'KHR'))
57 shutil.copytree(
'/usr/include/GLES2', os.path.join(include_dir,
'GLES2'))
58 shutil.copytree(
'/usr/include/GLES3', os.path.join(include_dir,
'GLES3'))
62 if 'linux' not in sys.platform:
63 print(
'This script only runs on Linux.', file=sys.stderr)
65 parser = argparse.ArgumentParser()
66 parser.add_argument(
'--target_dir',
'-t', required=
True)
67 args = parser.parse_args()
76if __name__ ==
'__main__':
def create_asset(target_dir, gl_path)
def print(*args, **kwargs)