summaryrefslogtreecommitdiff
path: root/recipes/openjpeg.recipe
blob: f597ab938f20c8f9616119317f7487ea9b01feda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 # -*- 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.3.1'
    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/v%(version)s.tar.gz'
    tarball_checksum = '63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9'
    configure_options = ' -DBUILD_CODEC:bool=off -DBUILD_PKGCONFIG_FILES:bool=on '

    files_libs = ['libopenjp2']
    files_devel = ['include/openjpeg-2.3/openjpeg.h',
                   'include/openjpeg-2.3/opj_stdint.h',
                   'include/openjpeg-2.3/opj_config.h',
                   '%(libdir)s/pkgconfig/libopenjp2.pc']
    library_type = LibraryType.BOTH

    def prepare(self):
        # This project uses OPENJPEG_INSTALL_LIB_DIR instead of CMAKE_INSTALL_LIBDIR
        self.configure_tpl = self.configure_tpl.replace('CMAKE_INSTALL_LIBDIR', 'OPENJPEG_INSTALL_LIB_DIR')
        if self.config.target_platform in [Platform.WINDOWS]:
            self.library_type = LibraryType.SHARED

    def post_install(self):
        deps = ['-lm']
        libtool_la = LibtoolLibrary('openjp2', 2, 1, None, self.config.libdir,
                self.config.target_platform, deps)
        libtool_la.save()
        super().post_install()