# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python from cerbero.utils import shell from cerbero.utils import messages as m from cerbero.tools.libtool import LibtoolLibrary import os import shutil class Recipe(recipe.Recipe): name = 'libvpx' version = 'v1.13.1' stype = SourceType.TARBALL url = 'https://github.com/webmproject/libvpx/archive/%(version)s.tar.gz' tarball_dirname = 'libvpx-' + version[1:] tarball_checksum = '00dae80465567272abd077f59355f95ac91d7809a2d3006f9ace2637dd429d14' licenses = [{License.BSD: ['LICENSE'], License.Misc: ['PATENTS']}] btype = BuildType.MESON library_type = LibraryType.STATIC meson_options = { 'size_limit': '16384x16384', 'unit_tests': 'disabled', 'postproc': 'enabled', 'multi_res_encoding': 'enabled', 'temporal_denoising': 'enabled', 'vp9_temporal_denoising': 'enabled', 'vp9_postproc': 'enabled', 'vp9_highbitdepth': 'enabled', 'tools': 'disabled', 'examples': 'disabled', 'docs': 'disabled', } patches = [ 'libvpx/0001-Fix-implicit-argument-conversion-on-UWP.patch', 'libvpx/0002-vp9_diamond_search_sad_neon-use-DECLARE_ALIGNED.patch', 'libvpx/0003-Add-Meson-build.patch', ] files_libs = ['libvpx'] files_devel = ['include/vpx', '%(libdir)s/pkgconfig/vpx.pc'] def prepare(self): if self.config.target_platform in [Platform.DARWIN, Platform.IOS]: # make sure the linker uses the correct stdlib when building with # 10.13 which makes the usage of libstdc++ a hard error. self.append_env('LDFLAGS', '-stdlib=libc++') if self.config.target_platform == Platform.DARWIN: self.library_type = LibraryType.SHARED elif self.config.target_platform == Platform.IOS: self.library_type = LibraryType.STATIC elif self.config.target_platform == Platform.WINDOWS: self.library_type = LibraryType.STATIC elif self.config.target_platform == Platform.ANDROID: self.library_type = LibraryType.STATIC # See https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/71 self.meson_options['cpu_features_path'] = os.path.join(self.config.toolchain_prefix, 'sources', 'android', 'cpufeatures') def post_install(self): # Meson does not generate la files LibtoolLibrary('vpx', None, None, None, self.config.libdir, self.config.target_platform, static_only=self.library_type == LibraryType.STATIC).save() super().post_install()