summaryrefslogtreecommitdiff
path: root/recipes/openjpeg.recipe
blob: adf53a0286f7f77d36161e6592c08c33e7f3b884 (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
import shutil

from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    version = '2.1.0'
    name = 'openjpeg'
    licenses = [License.BSD]
    stype = SourceType.TARBALL
    btype = BuildType.CMAKE
    url = 'http://downloads.sourceforge.net/project/openjpeg.mirror/2.1.0/openjpeg-2.1.0.tar.gz'
    configure_options = ' -DBUILD_CODEC:bool=off -DBUILD_PKGCONFIG_FILES:bool=on '
    patches = ['openjpeg/0001-Build-shared-and-static-library.patch',
               'openjpeg/0002-Set-INSTALL_NAME_DIR.patch']

    files_libs = ['libopenjp2']
    files_devel = ['include/openjpeg-2.1/openjpeg.h',
                   'include/openjpeg-2.1/opj_stdint.h',
                   'include/openjpeg-2.1/opj_config.h',
                   'lib/pkgconfig/libopenjp2.pc']

    def install(self):
        super(recipe.Recipe, self).install()
        shutil.move(
                os.path.join(self.config.prefix, 'lib', 'libopenjp2_static.a'),
                os.path.join(self.config.prefix, 'lib', 'libopenjp2.a'))

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