#! /usr/bin/env python
# encoding: utf-8

VERSION = '0.0.1'
APPNAME = 'editkit'

srcdir = '.'
blddir = 'build'

def set_options(opt):
	opt.tool_options('compiler_cc')

def configure(conf):
	conf.check_tool('compiler_cc cc vala')
	conf.check_cfg(package='glib-2.0', uselib_store='GLIB', atleast_version='2.12.0', mandatory=1, args='--cflags --libs')
	conf.check_cfg(package='gtk+-2.0', uselib_store='GTK', atleast_version='2.12.0', mandatory=1, args='--cflags --libs')
	conf.check_cfg(package='webkit-1.0', uselib_store='WEBKIT', mandatory=1, args='--cflags --libs')	

def build(bld):
	obj = bld.new_task_gen(
		features = 'cc cprogram',
		packages = 'gtk+-2.0 webkit-1.0',
		source='editkit.vala',
		target = 'editkit',
		uselib = 'GTK GLIB WEBKIT',
		threading=True,
		)

def run(ctx):
    '''run editkit from build directory'''
    import os, subprocess
    subprocess.call(os.path.join(blddir,'default/editkit'))

