Use string ids in the alsa device list
[jackdbus.git] / dbus / wscript
blobb572c1e91b16c733109711864565e68fe1c25a8f
1 #! /usr/bin/env python
2 # encoding: utf-8
4 import os.path
5 import Options
6 import re # subst_func
7 import Logs
9 def options(opt):
10 opt.add_option('--enable-pkg-config-dbus-service-dir', action='store_true', default=False, help='force D-Bus service install dir to be one returned by pkg-config')
12 def configure(conf):
13 conf.env['BUILD_JACKDBUS'] = False
15 if not conf.check_cfg(package='dbus-1', atleast_version='1.0.0', args='--cflags --libs') or not conf.is_defined('HAVE_DBUS_1'):
16 print(Logs.colors.RED + 'WARNING !! jackdbus will not be built because libdbus-dev is missing' + Logs.colors.NORMAL)
17 return
19 dbus_dir = conf.check_cfg(package='dbus-1', args='--variable=session_bus_services_dir')
20 if not dbus_dir:
21 print(Logs.colors.RED + 'WARNING !! jackdbus will not be built because service dir is unknown' + Logs.colors.NORMAL)
22 return
24 dbus_dir = dbus_dir.strip()
25 conf.env['DBUS_SERVICES_DIR_REAL'] = dbus_dir
27 if Options.options.enable_pkg_config_dbus_service_dir:
28 conf.env['DBUS_SERVICES_DIR'] = dbus_dir
29 else:
30 conf.env['DBUS_SERVICES_DIR'] = os.path.normpath(conf.env['PREFIX'] + '/share/dbus-1/services')
32 conf.check(header_name='expat.h', define_name="HAVE_EXPAT")
34 if conf.is_defined('HAVE_EXPAT'):
35 conf.env['LIB_EXPAT'] = ['expat']
36 else:
37 print(Logs.colors.RED + 'WARNING !! jackdbus will not be built because of expat is missing' + Logs.colors.NORMAL)
38 return
40 conf.env['BUILD_JACKDBUS'] = True
42 def build(bld):
43 obj = bld(features = ['c', 'cprogram'], idx=17)
44 if bld.env['IS_LINUX']:
45 sysdeps_dbus_include = ['../linux', '../posix']
46 if bld.env['IS_MACOSX']:
47 sysdeps_dbus_include = ['../macosx', '../posix']
49 obj.includes = sysdeps_dbus_include + ['.', '../', '../common', '../common/jack']
50 obj.defines = ['HAVE_CONFIG_H','SERVER_SIDE']
51 obj.source = [
52 'jackdbus.c',
53 'controller.c',
54 'params.c',
55 'controller_iface_configure.c',
56 'controller_iface_control.c',
57 'controller_iface_introspectable.c',
58 'controller_iface_patchbay.c',
59 'controller_iface_session_manager.c',
60 'controller_iface_transport.c',
61 'xml.c',
62 'xml_expat.c',
63 #'xml_nop.c',
64 'xml_write_raw.c',
65 'sigsegv.c',
66 'reserve.c',
68 obj.use = ['serverlib']
69 if bld.env['IS_LINUX']:
70 obj.use += ['PTHREAD', 'DL', 'RT', 'DBUS-1', 'EXPAT']
71 if bld.env['IS_MACOSX']:
72 obj.use += ['PTHREAD', 'DL', 'DBUS-1', 'EXPAT']
73 obj.target = 'jackdbus'
75 # process org.jackaudio.service.in -> org.jackaudio.service
76 obj = bld(
77 features = 'subst',
78 source = 'org.jackaudio.service.in',
79 target = 'org.jackaudio.service',
80 install_path = '${DBUS_SERVICES_DIR}/',
81 BINDIR = bld.env['PREFIX'] + '/bin')