1#!/usr/bin/env python 2# 3# Copyright 2022 Google LLC 4# 5# Use of this source code is governed by a BSD-style license that can be 6# found in the LICENSE file. 7 8 9"""Create the mesa driver.""" 10 11 12import argparse 13import subprocess 14 15MESA_VERSION = '22.1.3' 16 17def create_asset(target_dir): 18 """Create the asset.""" 19 cmd = [ 20 'docker', 'build', '-t', 'mesa-driver-builder:latest', 21 './mesa_intel_driver_linux_22/mesa-driver-builder', 22 ] 23 print('Building container', cmd) 24 subprocess.check_output(cmd) 25 26 cmd = [ 27 'docker', 'run', '--volume', '%s:/OUT' % target_dir, 28 '--env', 'MESA_VERSION=%s' % MESA_VERSION, 29 'mesa-driver-builder' 30 ] 31 print('Running container', cmd) 32 subprocess.check_output(cmd) 33 34 35def main(): 36 parser = argparse.ArgumentParser() 37 parser.add_argument('--target_dir', '-t', required=True) 38 args = parser.parse_args() 39 create_asset(args.target_dir) 40 41 42if __name__ == '__main__': 43 main() 44