easyblock = 'ConfigureMake'

name = 'Gdk-Pixbuf'
version = '2.36.12'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://developer.gnome.org/gdk-pixbuf/stable/'
description = """
 The Gdk Pixbuf is a toolkit for image loading and pixel buffer manipulation.
 It is used by GTK+ 2 and GTK+ 3 to load and manipulate images. In the past it
 was distributed as part of GTK+ 2 but it was split off into a separate package
 in preparation for the change to GTK+ 3.
"""

toolchain = {'name': 'foss', 'version': '2018b'}

source_urls = [FTPGNOME_SOURCE]
sources = [SOURCELOWER_TAR_XZ]
patches = ['Gdk-Pixbuf-2.36.10-disable-gio-sniffing.patch']
checksums = [
    'fff85cf48223ab60e3c3c8318e2087131b590fd6f1737e42cb3759a3b427a334',  # gdk-pixbuf-2.36.12.tar.xz
    '840231db69ccc2a1335c4f29c305cdd0ba570254e779c2a274611aaff968878e',  # Gdk-Pixbuf-2.36.10-disable-gio-sniffing.patch
]

builddependencies = [
    ('GObject-Introspection', '1.54.1', versionsuffix)
]
dependencies = [
    ('Python', '3.6.6'),
    ('GLib', '2.54.3'),
    ('libjpeg-turbo', '2.0.0'),
    ('libpng', '1.6.34'),
    ('LibTIFF', '4.0.9'),
]

configopts = "--disable-maintainer-mode --enable-debug=no --enable-introspection=yes "
configopts += "--disable-Bsymbolic --without-gdiplus --enable-shared --enable-static"

sanity_check_paths = {
    'files': ['lib/libgdk_pixbuf-%(version_major)s.0.a', 'lib/libgdk_pixbuf-%%(version_major)s.0.%s' % SHLIB_EXT],
    'dirs': ['bin', 'include/gdk-pixbuf-%(version_major)s.0', 'lib/gdk-pixbuf-%(version_major)s.0', 'share'],
}

modextrapaths = {
    'XDG_DATA_DIRS': 'share',
}

moduleclass = 'vis'
