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

def configure(conf):
    conf.env.append_value('MODULES_AVAILABLE', 'atril')
    if 'atril' in conf.env['ENABLE_MODULES'] or 'all' in conf.env['ENABLE_MODULES']:
        if conf.pkg_check_modules('ATRIL', 'atril-document-2.32 atril-view-2.32 pygobject-2.0 pygtk-2.0',
                                  mandatory=False):
            conf.env.append_value('MODULES_TO_BUILD', 'atril')



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

        bld.install_files('${DATADIR}/pygtk/2.0/defs', 'atril.defs')

