# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'openh264' version = '2.3.0' url = 'https://github.com/cisco/%(name)s/archive/v%(version)s.tar.gz' tarball_checksum = '99b0695272bee73a3b3a5fcb1afef462c11a142d1dc35a2c61fef5a4b7d60bc0' tarball_dirname = 'openh264-%(version)s' # FIXME: can we specify a full fallback url? On our mirror the file is openh264-2.3.0.tar.gz # because the filename v2.3.0.tar.gz is already taken by an openjpeg tarball. stype = SourceType.TARBALL btype = BuildType.MESON meson_options = {'tests': 'disabled'} licenses = [{License.BSD: ['LICENSE']}] files_libs = ['libopenh264'] files_devel = ['include/wels', '%(libdir)s/pkgconfig/openh264.pc'] patches = ['openh264/0001-meson-add-option-to-disable-asm-optimisations.patch'] async def configure(self): if self.config.target_platform == Platform.ANDROID and \ self.config.target_arch == Architecture.X86: # Fails to link with lld citing relocation errors self.meson_options['asm'] = 'disabled' await super().configure() def post_install(self): # XXX: Don't forget to keep this in sync with the library version! dependency_libs=[] if self.config.target_platform == Platform.IOS: dependency_libs += ['-lc++'] elif self.config.target_platform == Platform.DARWIN: dependency_libs += ['-lc++'] elif self.config.target_platform == Platform.ANDROID: dependency_libs += ['-lm'] elif self.config.target_platform in [Platform.WINDOWS, Platform.LINUX]: dependency_libs += ['-lstdc++', '-lm'] else: raise NotImplementedError libtool_la = LibtoolLibrary('openh264', 0, None, None, self.config.libdir, self.config.target_platform, deps=dependency_libs) libtool_la.save() super().post_install()