jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.3KB

  1. #! /usr/bin/python3
  2. # encoding: utf-8
  3. import os.path
  4. from waflib import Logs, Options
  5. def options(opt):
  6. opt.add_option(
  7. '--enable-pkg-config-dbus-service-dir',
  8. action='store_true',
  9. default=False,
  10. help='force D-Bus service install dir to be one returned by pkg-config',
  11. )
  12. def configure(conf):
  13. conf.env['BUILD_JACKDBUS'] = False
  14. conf.define('JACK_VERSION', conf.env['JACK_VERSION'])
  15. if not conf.check_cfg(package='dbus-1 >= 1.0.0', args='--cflags --libs', mandatory=False):
  16. print(
  17. Logs.colors.RED + 'ERROR !! jackdbus will not be built because libdbus-dev is missing' + Logs.colors.NORMAL
  18. )
  19. return
  20. dbus_dir = conf.check_cfg(package='dbus-1', args='--variable=session_bus_services_dir')
  21. if not dbus_dir:
  22. print(
  23. Logs.colors.RED + 'ERROR !! jackdbus will not be built because service dir is unknown' + Logs.colors.NORMAL
  24. )
  25. return
  26. dbus_dir = dbus_dir.strip()
  27. conf.env['DBUS_SERVICES_DIR_REAL'] = dbus_dir
  28. if Options.options.enable_pkg_config_dbus_service_dir:
  29. conf.env['DBUS_SERVICES_DIR'] = dbus_dir
  30. else:
  31. conf.env['DBUS_SERVICES_DIR'] = os.path.normpath(conf.env['PREFIX'] + '/share/dbus-1/services')
  32. if not conf.check_cfg(package='expat', args='--cflags --libs', mandatory=False):
  33. print(Logs.colors.RED + 'ERROR !! jackdbus will not be built because of expat is missing' + Logs.colors.NORMAL)
  34. return
  35. conf.env['BUILD_JACKDBUS'] = True
  36. def build(bld):
  37. obj = bld(features=['c', 'cprogram'], idx=17)
  38. if bld.env['IS_LINUX']:
  39. sysdeps_dbus_include = ['../linux', '../posix']
  40. if bld.env['IS_FREEBSD']:
  41. sysdeps_dbus_include = ['../freebsd', '../posix']
  42. if bld.env['IS_MACOSX']:
  43. sysdeps_dbus_include = ['../macosx', '../posix']
  44. obj.includes = sysdeps_dbus_include + ['.', '../', '../common', '../common/jack']
  45. obj.defines = ['HAVE_CONFIG_H', 'SERVER_SIDE']
  46. obj.source = [
  47. 'jackdbus.c',
  48. 'controller.c',
  49. 'params.c',
  50. 'controller_iface_configure.c',
  51. 'controller_iface_control.c',
  52. 'controller_iface_introspectable.c',
  53. 'controller_iface_patchbay.c',
  54. 'controller_iface_session_manager.c',
  55. 'controller_iface_transport.c',
  56. 'xml.c',
  57. 'xml_expat.c',
  58. 'xml_write_raw.c',
  59. 'sigsegv.c',
  60. 'reserve.c',
  61. ]
  62. obj.use = ['serverlib']
  63. if bld.env['IS_LINUX']:
  64. obj.source += [
  65. '../linux/uptime.c',
  66. ]
  67. obj.use += ['PTHREAD', 'DL', 'RT', 'DBUS-1', 'EXPAT', 'STDC++']
  68. if bld.env['IS_FREEBSD']:
  69. obj.source += [
  70. '../linux/uptime.c',
  71. ]
  72. obj.use += ['PTHREAD', 'EXECINFO', 'LIBSYSINFO', 'DBUS-1', 'EXPAT']
  73. if bld.env['IS_MACOSX']:
  74. obj.source += [
  75. '../macosx/uptime.c',
  76. ]
  77. obj.use += ['PTHREAD', 'DL', 'DBUS-1', 'EXPAT']
  78. obj.target = 'jackdbus'
  79. # process org.jackaudio.service.in -> org.jackaudio.service
  80. obj = bld(
  81. features='subst',
  82. source='org.jackaudio.service.in',
  83. target='org.jackaudio.service',
  84. install_path='${DBUS_SERVICES_DIR}/',
  85. BINDIR=bld.env['PREFIX'] + '/bin')
  86. if not bld.env['IS_WINDOWS']:
  87. bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755)