make jack start again if no realtime scheduling is available
[jackpanel.git] / wscript
blob581711a9b321c193c3f1b833613581764c7709e2
1 #!/usr/bin/env python
2 import os
3 import Options
4 import autowaf
6 VERSION = "0.1.1"
7 VERSION_MAJOR_MINOR = ".".join(VERSION.split(".")[0:2])
8 APPNAME = "jackpanel"
9 APPNAME_APPLET = "jackpanel-applet"
11 srcdir = '.'
12 blddir = 'build'
14 def set_options(opt):
15 autowaf.set_options(opt)
16 opt.tool_options('compiler_cc')
18 def configure(conf):
19 autowaf.configure(conf)
20 conf.check_tool('compiler_cc cc')
21 conf.check_tool('vala')
23 min_vala_version = (0, 7, 9)
24 if conf.env['VALAC_VERSION'] < min_vala_version:
25 conf.fatal('Your vala compiler version ' + str(conf.env['VALAC_VERSION']) +
26 ' is too old. The project requires at least version %d.%d.%d' % min_vala_version );
28 autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.116.1', mandatory=True)
29 autowaf.check_pkg(conf, 'libpanelapplet-2.0', uselib_store='PANEL_APPLET', atleast_version='2.20.3', mandatory=False)
30 autowaf.check_pkg(conf, 'libgnomeui-2.0', uselib_store='LIBGNOMEUI',atleast_version='2.22.1', mandatory=False)
31 autowaf.check_pkg(conf, 'cairo', uselib_store='CAIRO', atleast_version='1.6.0', mandatory=True)
32 autowaf.check_pkg(conf, 'gconf-2.0', uselib_store='GCONF', atleast_version='2.22.0', mandatory=True)
33 autowaf.check_pkg(conf, 'prolooks1', uselib_store='PROLOOKS1', atleast_version='1.2.0', mandatory=True)
34 autowaf.check_pkg(conf, 'hal', uselib_store='HAL', atleast_version='0.5.11', mandatory=True)
35 autowaf.check_pkg(conf, 'dbus-1', uselib_store='DBUS', atleast_version='1.1.20', mandatory=True)
36 autowaf.check_pkg(conf, 'dbus-glib-1', uselib_store='DBUS_GLIB', atleast_version='0.74', mandatory=True)
37 autowaf.check_pkg(conf, 'libnotify', uselib_store='NOTIFY', atleast_version='0.4.4', mandatory=True)
39 conf.env['CCFLAGS'] = '-I./default'
41 conf.define('PACKAGE', APPNAME)
42 conf.define('PACKAGE_NAME', APPNAME)
43 conf.define('PACKAGE_STRING', APPNAME + '-' + VERSION)
44 conf.define('PACKAGE_VERSION', APPNAME + '-' + VERSION)
46 conf.define('VERSION', VERSION)
47 conf.define('VERSION_MAJOR_MINOR', VERSION_MAJOR_MINOR)
48 conf.define('APPNAME', APPNAME)
49 conf.define('APPNAME_APPLET', APPNAME_APPLET)
51 autowaf.print_summary(conf)
52 opts = Options.options
53 autowaf.display_header('Jackpanel Configuration')
54 autowaf.display_msg(conf, 'Options:', str(opts))
55 autowaf.display_msg(conf, 'Build GNOME panel applet', bool(conf.env['HAVE_PANEL_APPLET']))
57 def build(bld):
58 bld.add_subdirs('jackpanel')
60 # 'Desktop' file (menu entry, icon, etc)
61 obj = bld.new_task_gen('subst')
62 obj.source = 'jackpanel.desktop.in'
63 obj.target = 'jackpanel.desktop'
64 obj.dict = {
65 'BINDIR' : os.path.normpath(bld.env['BINDIR']),
66 'APP_INSTALL_NAME' : APPNAME,
67 'APP_HUMAN_NAME' : APPNAME,
69 obj.install_path = '${DATADIR}applications'
71 # Panel Applet .server file
72 if bld.env['HAVE_PANEL_APPLET'] and bld.env['HAVE_LIBGNOMEUI']:
73 obj = bld.new_task_gen('subst')
74 obj.source = 'JackpanelApplet.server.in'
75 obj.target = 'JackpanelApplet.server'
76 obj.dict = {
77 'BINDIR' : os.path.normpath(bld.env['BINDIR']),
78 'LIBDIR' : os.path.normpath(bld.env['LIBDIR']),
79 'APP_INSTALL_NAME' : APPNAME_APPLET,
80 'APP_HUMAN_NAME' : "Jackpanel Applet",
82 obj.install_path = '${LIBDIR}bonobo/servers'
84 # icon cache is updated using:
85 # gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
86 icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48']
87 for s in icon_sizes:
88 bld.install_as(
89 os.path.normpath(bld.env['DATADIR'] + '/icons/hicolor/' + s + '/apps/'
90 + APPNAME + '.png'),
91 'icons/' + s + '/jackpanel.png')
93 bld.install_as(os.path.normpath(bld.env['DATADIR'] + '/pixmaps/' + APPNAME + '.xpm'),
94 'icons/16x16/jackpanel.xpm')
96 def shutdown():
97 autowaf.shutdown()