# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python import shutil from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): version = '2.5.2' name = 'openjpeg' licenses = [{License.BSD: ['LICENSE']}] stype = SourceType.TARBALL btype = BuildType.CMAKE cmake_generator = 'ninja' can_msvc = True url = 'https://github.com/uclouvain/openjpeg/archive/refs/tags/v%(version)s.tar.gz' tarball_checksum = '90e3896fed910c376aaf79cdd98bdfdaf98c6472efd8e1debf0a854938cbda6a' configure_options = ' -DBUILD_CODEC:bool=off ' files_libs = ['libopenjp2'] files_devel = ['include/openjpeg-2.5/', '%(libdir)s/pkgconfig/libopenjp2.pc'] library_type = LibraryType.BOTH def prepare(self): if self.config.target_platform in [Platform.WINDOWS]: self.library_type = LibraryType.SHARED def post_install(self): deps = ['-lm'] # https://github.com/uclouvain/openjpeg/blob/v2.5.2/CMakeLists.txt#L56 libtool_la = LibtoolLibrary('openjp2', 7, None, None, self.config.libdir, self.config.target_platform, deps) libtool_la.save() super().post_install()