summaryrefslogtreecommitdiff
path: root/recipes/gdk-pixbuf.recipe
blob: 5c6706c361fc02b024359d7b5f92a5262a312c0a (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
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.utils import shell
from cerbero.tools.libtool import LibtoolLibrary

class Recipe(recipe.Recipe):
    name = 'gdk-pixbuf'
    version = '2.38.0'
    licenses = [License.LGPLv2Plus]
    stype = SourceType.TARBALL
    btype = BuildType.MESON
    url = 'gnome://'
    tarball_checksum = 'dd50973c7757bcde15de6bcd3a6d462a445efd552604ae6435a0532fbbadae47'
    meson_options = {'docs' : 'false',
                     'man' : 'false',
                     'installed_tests' : 'false',
                     'builtin_loaders' : 'all',
                     'gio_sniffing' : 'false',
                     'x11' : 'false'}
    deps = ['libjpeg-turbo', 'glib', 'libpng', 'tiff', 'zlib' ]

    patches = ['gdk-pixbuf/0001-meson-add-option-for-disabling-GIO-sniffing.patch',
               'gdk-pixbuf/0001-meson-Don-t-generate-the-loader-cache-when-cross-com.patch',
               'gdk-pixbuf/0001-meson-don-t-build-tests-or-the-thumbnailer-if-cross-.patch',
               'gdk-pixbuf/0001-build-add-enum-generation-header-to-sources-of-built.patch']

    files_libs = ['libgdk_pixbuf-2.0']
    files_bins = ['gdk-pixbuf-query-loaders', 'gdk-pixbuf-csource']
    files_devel = ['lib/pkgconfig/gdk-pixbuf-2.0.pc', 'include/gdk-pixbuf-2.0']
    files_lang = ['gdk-pixbuf']
    files_typelibs = ['GdkPixbuf-2.0']

    def prepare(self):
        if self.config.target_platform == Platform.WINDOWS:
            self.meson_options['native_windows_loaders'] = 'false'
        if self.config.prefix_is_executable():
            self.files_misc = ['lib/gdk-pixbuf-2.0/2.10.0/loaders.cache']
        else:
            self.meson_options['tests'] = 'false'

    def post_install (self):
        if self.config.platform == Platform.WINDOWS and\
                self.config.target_platform == Platform.WINDOWS:
            cache = os.path.join(self.config.prefix, 'lib', 'gdk-pixbuf-2.0',
                '2.10.0', 'loaders.cache')
            shell.replace(cache, {self.config.prefix: '../'})

        lib = LibtoolLibrary('gdk_pixbuf-2.0', None, None, None, self.config.libdir,
                self.config.target_platform, deps=['gobject-2.0', 'gio-2.0', 'tiff', 'jpeg', 'png16'])
        lib.save()
        super().post_install()