# -*- python -*-
# encoding: utf-8


def configure(conf):
    conf.env.append_value('MODULES_AVAILABLE', 'gtop')
    if 'gtop' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
        if conf.pkg_check_modules('GTOP', 'libgtop-2.0 >= 2.13.0 pygobject-2.0 ',
                                  mandatory=False):
            conf.env.append_value('MODULES_TO_BUILD', 'gtop')


def build(bld):
    
    if 'gtop' in bld.env['MODULES_TO_BUILD']:
        pyext = bld.create_pyext()
        pyext.source = 'gtop.c'
        pyext.target = 'gtop'
        pyext.uselib = 'GTOP'
        pyext.install_path = '${PYTHONDIR}/gtk-2.0'

