Flutter Engine
The Flutter Engine
Functions | Variables
chromebook_x86_64_gles.create Namespace Reference

Functions

def getenv (key)
 
def create_asset (target_dir, gl_path)
 
def main ()
 

Variables

string ENV_VAR = 'CHROMEBOOK_X86_64_GLES_LIB_PATH'
 

Function Documentation

◆ create_asset()

def chromebook_x86_64_gles.create.create_asset (   target_dir,
  gl_path 
)
Create the asset.

Definition at line 33 of file create.py.

33def create_asset(target_dir, gl_path):
34 """Create the asset."""
35
36 cmd = [
37 'sudo','apt-get','install',
38 'libgles2-mesa-dev',
39 'libegl1-mesa-dev'
40 ]
41 subprocess.check_call(cmd)
42
43
44 lib_dir = os.path.join(target_dir, 'lib')
45 os.mkdir(lib_dir)
46
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*')))
50 for f in to_copy:
51 shutil.copy(f, lib_dir)
52
53 include_dir = os.path.join(target_dir, 'include')
54 os.mkdir(include_dir)
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'))
59
60
def create_asset(chrome_src_path, browser_executable, target_dir, upload_to_partner_bucket, dm_path)
Definition: create.py:68

◆ getenv()

def chromebook_x86_64_gles.create.getenv (   key)

Definition at line 24 of file create.py.

24def getenv(key):
25 val = os.environ.get(key)
26 if not val:
27 print(('Environment variable %s not set; you should run this via '
28 'create_and_upload.py.' % key), file=sys.stderr)
29 sys.exit(1)
30 return val
31
32
def print(*args, **kwargs)
Definition: run_tests.py:49
def getenv(key)
Definition: create.py:47

◆ main()

def chromebook_x86_64_gles.create.main ( )

Definition at line 61 of file create.py.

61def main():
62 if 'linux' not in sys.platform:
63 print('This script only runs on Linux.', file=sys.stderr)
64 sys.exit(1)
65 parser = argparse.ArgumentParser()
66 parser.add_argument('--target_dir', '-t', required=True)
67 args = parser.parse_args()
68
69 # Obtain lib_path from create_and_upload via an environment variable, since
70 # this script is called via `sk` and not directly.
71 lib_path = getenv(ENV_VAR)
72
73 create_asset(args.target_dir, lib_path)
74
75

Variable Documentation

◆ ENV_VAR

string chromebook_x86_64_gles.create.ENV_VAR = 'CHROMEBOOK_X86_64_GLES_LIB_PATH'

Definition at line 21 of file create.py.