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.

94 lines
3.5KB

  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. #
  4. # Copyright (C) 2015, 2018 Karl Linden <karl.j.linden@gmail.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #
  19. import os.path
  20. import re # subst_func
  21. from waflib import Logs, Options
  22. def options(opt):
  23. 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')
  24. def configure(conf):
  25. conf.env['BUILD_JACKDBUS'] = False
  26. if not conf.check_cfg(package='dbus-1', atleast_version='1.0.0', args='--cflags --libs', mandatory=False):
  27. print(Logs.colors.RED + 'ERROR !! jackdbus will not be built because libdbus-dev is missing' + Logs.colors.NORMAL)
  28. return
  29. dbus_dir = conf.check_cfg(package='dbus-1', args='--variable=session_bus_services_dir')
  30. if not dbus_dir:
  31. print(Logs.colors.RED + 'ERROR !! jackdbus will not be built because service dir is unknown' + Logs.colors.NORMAL)
  32. return
  33. dbus_dir = dbus_dir.strip()
  34. conf.env['DBUS_SERVICES_DIR_REAL'] = dbus_dir
  35. if Options.options.enable_pkg_config_dbus_service_dir:
  36. conf.env['DBUS_SERVICES_DIR'] = dbus_dir
  37. else:
  38. conf.env['DBUS_SERVICES_DIR'] = os.path.normpath(conf.env['PREFIX'] + '/share/dbus-1/services')
  39. if not conf.check_cfg(package='expat', args='--cflags --libs', mandatory=False):
  40. print(Logs.colors.RED + 'ERROR !! jackdbus will not be built because of expat is missing' + Logs.colors.NORMAL)
  41. return
  42. conf.env['BUILD_JACKDBUS'] = True
  43. def build(bld):
  44. obj = bld(features = ['c', 'cprogram'], idx=17)
  45. if bld.env['IS_LINUX']:
  46. sysdeps_dbus_include = ['../linux', '../posix']
  47. if bld.env['IS_MACOSX']:
  48. 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',
  67. ]
  68. obj.use = ['serverlib']
  69. if bld.env['IS_LINUX']:
  70. obj.use += ['PTHREAD', 'DL', 'RT', 'DBUS-1', 'EXPAT', 'STDC++']
  71. if bld.env['IS_MACOSX']:
  72. obj.use += ['PTHREAD', 'DL', 'DBUS-1', 'EXPAT']
  73. obj.target = 'jackdbus'
  74. # process org.jackaudio.service.in -> org.jackaudio.service
  75. obj = bld(
  76. features = 'subst',
  77. source = 'org.jackaudio.service.in',
  78. target = 'org.jackaudio.service',
  79. install_path = '${DBUS_SERVICES_DIR}/',
  80. BINDIR = bld.env['PREFIX'] + '/bin')