# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'harfbuzz' version = '5.3.1' stype = SourceType.TARBALL btype = BuildType.MESON url = 'https://github.com/%(name)s/%(name)s/releases/download/%(version)s/%(name)s-%(version)s.tar.xz' tarball_checksum = '4a6ce097b75a8121facc4ba83b5b083bfec657f45b003cd5a3424f2ae6b4434d' licenses = [{License.BSD_like: ['COPYING']}] deps = ['fontconfig', 'cairo', 'glib'] meson_options = {'icu': 'disabled', 'glib': 'enabled', 'cairo': 'enabled', # Is this needed? Is it only used for cmd line utils? 'gobject': 'disabled', 'icu_builtin': 'false', 'introspection': 'disabled', 'tests': 'disabled'} patches = [] files_bins = ['hb-ot-shape-closure', 'hb-view', 'hb-shape'] files_libs = ['libharfbuzz'] files_devel = ['include/harfbuzz/*.h', '%(libdir)s/pkgconfig/harfbuzz.pc'] def prepare(self): # Disable werror from pragmas. Currently fails building on macOS 12.3 # and should actually be controlled by the build system. self.append_env('CFLAGS', '-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR') if self.config.target_platform == Platform.DARWIN: self.meson_options['coretext'] = 'enabled' def post_install(self): # Meson does not generate la files LibtoolLibrary('harfbuzz', None, None, None, self.config.libdir, self.config.target_platform, deps=['glib-2.0', 'freetype', 'fontconfig']).save() LibtoolLibrary('harfbuzz-subset', None, None, None, self.config.libdir, self.config.target_platform, deps=['harfbuzz']).save() super().post_install()