meson.build 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. src = files([
  2. 'gflow.vala',
  3. 'gflow-aggregator.vala',
  4. 'gflow-dock.vala',
  5. 'gflow-node.vala',
  6. 'gflow-simple-node.vala',
  7. 'gflow-simple-sink.vala',
  8. 'gflow-simple-source.vala',
  9. 'gflow-sink.vala',
  10. 'gflow-source.vala',
  11. ])
  12. gflow_api = '1.0'
  13. gflow = library('gflow-' + gflow_api,
  14. src,
  15. dependencies: [glib, gobject],
  16. vala_gir: 'GFlow-' + gflow_api + '.gir',
  17. install: get_option('enable_gflow')
  18. )
  19. gflow_inc = include_directories('.')
  20. # necessary to be able to pass it to g-ir-compiler in other libs
  21. gflow_girdir = meson.current_build_dir()
  22. # TODO: figure out how specify gir as input
  23. custom_target('gflow-typelib',
  24. command: [g_ir_compiler, '--output', '@OUTPUT@', meson.current_build_dir() + '/GFlow-' + gflow_api + '.gir',
  25. '--shared-library', get_option('prefix') + '/' + get_option('libdir') + '/libgflow-'+ gflow_api +'.so'],
  26. output: 'GFlow-' + gflow_api + '.typelib',
  27. depends: gflow,
  28. install: get_option('enable_gflow'),
  29. install_dir: get_option('libdir') + '/girepository-1.0')
  30. girfilename = meson.current_build_dir() + '/' + 'GFlow-' + gflow_api + '.gir'
  31. run_command('touch', girfilename)
  32. if get_option('enable_gflow')
  33. install_data(sources: girfilename,
  34. install_dir: get_option('datadir') + '/gir-1.0')
  35. endif
  36. vapifilename = meson.current_build_dir() + '/' + 'gflow-' + gflow_api + '.vapi'
  37. run_command('touch', vapifilename)
  38. if get_option('enable_gflow')
  39. install_data(sources: vapifilename,
  40. install_dir: get_option('datadir') + '/vala/vapi')
  41. endif
  42. headerfilename = meson.current_build_dir () + '/gflow-' + gflow_api + '.h'
  43. run_command('touch', headerfilename)
  44. if get_option('enable_gflow')
  45. install_headers(headerfilename,
  46. subdir: 'gflow-' + gflow_api)
  47. endif
  48. if get_option('enable_gflow')
  49. install_data(sources: [meson.current_source_dir() + '/gflow-' + gflow_api + '.deps'],
  50. install_dir: get_option('datadir') + '/vala/vapi')
  51. endif
  52. if get_option('enable_gflow')
  53. pkgconfig.generate(gflow,
  54. subdirs: 'gflow-' + gflow_api,
  55. version: gflow_api,
  56. name: 'gflow',
  57. filebase: 'gflow-' + gflow_api,
  58. requires: ['glib-2.0', 'gobject-2.0'],
  59. description: 'Flow Node Library')
  60. endif
  61. if get_option('enable_valadoc')
  62. valadoc = find_program('valadoc')
  63. gflow_docs = custom_target('gflow_apidocs',
  64. input: src,
  65. install: get_option('enable_gflow'),
  66. # FIXME: Installing to tmp, so the target will be built
  67. # the problem is we cannot access a subfolder of the
  68. # buildtarget via the output parameter.
  69. # Find a nicer solution
  70. install_dir: '/tmp',
  71. command: [valadoc, '-o', 'libgflow/gflow-' + gflow_api, '--doclet', 'devhelp', '@INPUT@', '--force'],
  72. output: 'gflow-' + gflow_api)
  73. if get_option('enable_gflow')
  74. install_subdir(meson.current_build_dir() + '/gflow-' + gflow_api + '/gflow-' + gflow_api,
  75. install_dir: get_option('datadir') + '/devhelp/books',
  76. )
  77. endif
  78. endif