# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python from cerbero.enums import DistroVersion from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'webrtc-audio-processing' version = '1.3' licenses = [{License.BSD_like: ['COPYING']}] btype = BuildType.MESON stype = SourceType.TARBALL url = 'https://freedesktop.org/software/pulseaudio/%(name)s/%(name)s-%(version)s.tar.gz' tarball_checksum = '95552fc17faa0202133707bbb3727e8c2cf64d4266fe31bfdb2298d769c1db75' # webrtc-audio-processing links to abseil statically meson_subprojects = ['abseil-cpp'] files_libs = [ 'libwebrtc-audio-coding-1', 'libwebrtc-audio-processing-1', ] files_devel = [ 'include/webrtc-audio-processing-1', '%(libdir)s/pkgconfig/webrtc-audio-coding-1.pc', '%(libdir)s/pkgconfig/webrtc-audio-processing-1.pc', ] def prepare(self): if self.config.target_platform == Platform.ANDROID: # TODO add --enable-neon=runtime, there is a conflict with cerbero # that defines -mfpu=vfp... plus webrtc-audio-processing build # system is doing it wrong, as it should add -mfpu=neon only for # the files that contains neon intrinsic. android_api = DistroVersion.get_android_api_version(self.config.target_distro_version) if android_api < 24: # -D_FILE_OFFSET_BITS=64 is broken with Android API < 24 for C++ # stdio, and enabling Android API 24 breaks the gst-examples build, # so disable this for now. self.append_env('CXXFLAGS', '-U_FILE_OFFSET_BITS') if self.config.target_platform == Platform.WINDOWS: # Does not export symbols correctly for DLLs, so just link statically self.library_type = LibraryType.STATIC def post_install(self): dependency_libs = [] if self.config.target_platform == Platform.ANDROID: dependency_libs += ['-llog'] libac = LibtoolLibrary('webrtc-audio-coding-1', None, None, None, self.config.libdir, self.config.target_platform, deps=dependency_libs) libac.save() libap = LibtoolLibrary('webrtc-audio-processing-1', None, None, None, self.config.libdir, self.config.target_platform, deps=dependency_libs) libap.save() super().post_install()