Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
chromebook_arm_gles.create Namespace Reference

Functions

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

Variables

str ENV_VAR = 'CHROMEBOOK_ARM_GLES_LIB_PATH'
 

Detailed Description

Create the asset.

Function Documentation

◆ create_asset()

chromebook_arm_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,'libmali*')))
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

◆ getenv()

chromebook_arm_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
void print(void *str)
Definition bridge.cpp:126

◆ main()

chromebook_arm_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
Definition main.py:1

Variable Documentation

◆ ENV_VAR

str chromebook_arm_gles.create.ENV_VAR = 'CHROMEBOOK_ARM_GLES_LIB_PATH'

Definition at line 21 of file create.py.