~stianse/playraw/0.1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python


VERSION='0.1.0'
VERSION_MAJOR_MINOR =  ".".join(VERSION.split(".")[0:2])
APPNAME='PlayRaw'
AUTHORS='Stian Selnes <stian.selnes@gmail.com>'

srcdir = '.'
blddir = '_build_'

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


def configure(conf):
    conf.check_tool('compiler_cc config_c vala gnu_dirs')

    conf.check_cfg(package='glib-2.0',
                   uselib_store='GLIB',
                   atleast_version='2.10.0',
                   args="--cflags --libs")

    conf.check_cfg(package='gobject-2.0',
                   uselib_store='GOBJECT',
                   atleast_version='2.10.0',
                   args="--cflags --libs")

    conf.check_cfg(package='gtk+-2.0',
                   uselib_store='GTK',
                   atleast_version='2.12.0',
                   args="--cflags --libs")

    conf.check_cfg(package='gdk-x11-2.0',
                   uselib_store='GDK',
                   atleast_version='2.12.0',
                   args="--cflags --libs")

    conf.check_cfg(package='gdk-pixbuf-2.0',
                   uselib_store='GDK_PIXBUF',
                   atleast_version='2.12.0',
                   args="--cflags --libs")

    conf.check_cfg(package='gstreamer-0.10',
                   uselib_store='GSTREAMER',
                   atleast_version='0.10.17',
                   args="--cflags --libs")

    conf.check_cfg(package='gstreamer-base-0.10',
                   uselib_store='GSTREAMER_BASE',
                   atleast_version='0.10.17',
                   args="--cflags --libs")

    conf.check_cfg(package='gstreamer-plugins-base-0.10',
                   uselib_store='GSTREAMER_PLUGINS_BASE',
                   atleast_version='0.10.17',
                   args="--cflags --libs")

    conf.check_cfg(package='gstreamer-video-0.10',
                   uselib_store='GSTREAMER_VIDEO',
                   atleast_version='0.10.17',
                   args="--cflags --libs")

    conf.check_cfg(package='gstreamer-interfaces-0.10',
                   uselib_store='GSTREAMER_INTERFACES',
                   atleast_version='0.10.17',
                   args="--cflags --libs")

    import os

    conf.define('AUTHORS', AUTHORS)
    conf.define('PACKAGE', APPNAME)
    conf.define('PACKAGE_NAME', APPNAME)
    conf.define('PACKAGE_STRING', APPNAME + '-' + VERSION)
    conf.define('PACKAGE_VERSION', VERSION)
    conf.define('PACKAGE_VERSION_MAJOR_MINOR', VERSION_MAJOR_MINOR)
    conf.define('PACKAGE_DATADIR', os.path.join(conf.env['DATADIR'], APPNAME.lower()))

    conf.write_config_header('config.h')
    conf.env.append_value('CCFLAGS', '-DHAVE_CONFIG_H')

def build(bld):
    bld.add_subdirs('gst data src')


def shutdown():
    import UnitTest
    unittest = UnitTest.unit_test()
    unittest.want_to_see_test_output = True
    unittest.run()
    unittest.print_results()