# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python import shutil from cerbero.utils import shell class Recipe(recipe.Recipe): name = 'vulkan-android' version = '1.1.114.0' licenses = [License.Apachev2] stype = SourceType.CUSTOM btype = BuildType.CUSTOM def prepare(self): if self.config.target_platform != Platform.ANDROID: raise InvalidRecipeError(self, "Invalid platform") async def install(self): to_copy = [] v = DistroVersion.get_android_api_version(self.config.target_distro_version) if v < 24: # Hacky way of copying the earliest version (android-24) of # libvulkan.so so we can build the vulkan plugin with a newer # version than what may be built by the rest of cerbero. srcdir = os.path.join(self.config.sysroot, 'usr', 'lib', self.config.host, '24') destdir = self.config.libdir to_copy += [ (os.path.join(srcdir, 'libvulkan.so'), os.path.join(destdir, 'libvulkan.so'), False) ] for src, dest, is_dir in to_copy: if is_dir: shell.copy_dir(src, dest) else: if not os.path.exists(os.path.dirname(dest)): os.makedirs(os.path.dirname(dest)) shutil.copy(src, dest)