meson.build 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. install_data(sources: [meson.current_source_dir() + '/gflow-' + gflow_api + '.deps'],
  49. install_dir: get_option('datadir') + '/vala/vapi')
  50. pkgconfig.generate(gflow,
  51. subdirs: 'gflow-' + gflow_api,
  52. version: gflow_api,
  53. name: 'gflow',
  54. filebase: 'gflow-' + gflow_api,
  55. requires: ['glib-2.0', 'gobject-2.0'],
  56. description: 'Flow Node Library')
  57. if get_option('enable_valadoc')
  58. valadoc = find_program('valadoc')
  59. gflow_docs = custom_target('gflow_apidocs',
  60. input: src,
  61. install: true,
  62. # FIXME: Installing to tmp, so the target will be built
  63. # the problem is we cannot access a subfolder of the
  64. # buildtarget via the output parameter.
  65. # Find a nicer solution
  66. install_dir: '/tmp',
  67. command: [valadoc, '-o', 'libgflow/gflow-' + gflow_api, '--doclet', 'devhelp', '@INPUT@', '--force'],
  68. output: 'gflow-' + gflow_api)
  69. install_subdir(meson.current_build_dir() + '/gflow-' + gflow_api + '/gflow-' + gflow_api,
  70. install_dir: get_option('datadir') + '/devhelp/books',
  71. )
  72. endif