easyblock = 'ConfigureMake'

name = 'PyGObject'
version = '2.28.6'
versionsuffix = '-Python-%(pyver)s'

homepage = 'http://www.pygtk.org/'
description = """Python Bindings for GLib/GObject/GIO/GTK+"""

toolchain = {'name': 'system', 'version': ''}

source_urls = [FTPGNOME_SOURCE]
sources = [SOURCELOWER_TAR_XZ]

patches = ['PyGObject-%(version)s_enum-types.patch']

pyver = '2.7.13'
pyshortver = '.'.join(pyver.split('.')[:2])

glibver = '2.52.0'
dependencies = [
    ('Python', '2.7.13'),
    ('GLib', glibver),
    ('GObject-Introspection', '1.47.1'),
    ('cairo', '1.14.12'),
]

configopts = "--disable-introspection"

modextrapaths = {
    'PYTHONPATH': [
        'lib/python%(pyshortver)s/site-packages',
        'lib/python%(pyshortver)s/site-packages/gtk-2.0',
        'lib64/python%(pyshortver)s/site-packages',
        'lib64/python%(pyshortver)s/site-packages/gtk-2.0',
    ],
}

sanity_check_paths = {
    'files': [
        'include/pygtk-%(version_major)s.0/pyglib.h',
        'include/pygtk-%(version_major)s.0/pygobject.h',
        'lib/libpyglib-%(version_major)s.0-python.so'],
    'dirs': [
        'bin',
        'lib/python%(pyshortver)s/site-packages/'],
}

sanity_check_commands = [
    ('python', "-c 'import gobject'"),
    ('python', "-c 'import glib'"),
    ('python', "-c 'import gio'"),
]

moduleclass = 'vis'
