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

VERSION='0.5.0'

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

def configure(conf):
    conf.check_tool('compiler_cxx')
    conf.check(header_name='boost/shared_ptr.hpp')
    conf.check_cfg(package='gtkmm-2.4', args='--cflags --libs', uselib_store='GTKMM')
    conf.check_cfg(package='gthread-2.0', args='--cflags --libs', uselib_store='GTHREAD')
    conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='XMLPP')
    conf.check_cfg(package='alsa', args='--cflags --libs', uselib_store='ALSA')
    conf.check_cfg(package='jack', args='--cflags --libs', uselib_store='JACK')
    conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE')
    conf.check_cfg(package='vorbisfile', args='--cflags --libs', uselib_store='VORBISFILE')
    conf.check_cfg(package='samplerate', args='--cflags --libs', uselib_store='SAMPLERATE')

def build(bld):
    t = bld.new_task_gen(
        features     = 'cxx cprogram',
        source       = ['app.cc', 'main.cc', 'pref.cc', 'editcue.cc',
        'audio.cc', 'editstop.cc', 'editmidi.cc', 'editwave.cc', 'editfade.cc',
        'editgroup.cc', 'renumber.cc', 'utils.cc', 'file.cc', 'patch.cc'],
        target       = 'showq',
        includes     = '.',
        uselib       = 'GTKMM GTHREAD XMLPP ALSA JACK SNDFILE VORBISFILE SAMPLERATE',
        cxxflags      = ['-O2', '-Wall', '-DVERSIONSTRING=\"0.5.0\"',
        '-DGETTEXT_PACKAGE=\"showq\"',
        '-DPROGRAMNAME_LOCALEDIR=\"${PREFIX}/share/locale/\"']
    )
