meson.build 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Embed the Statum client scripts (js/statum.js and js/statum-worker.js) into the
  2. # library as precompressed ConstantStatumResource classes, served by default at
  3. # /_statum/resource/statum.js and /_statum/resource/statum-worker.js. Generated
  4. # at build time by the in-tree statum-mkres tool — no installed tool required.
  5. client_script = custom_target('statum-client-script',
  6. input: files('../js/statum.js'),
  7. output: 'ClientScript.vala',
  8. command: [statum_mkres,
  9. '-o', '@OUTPUT@',
  10. '-n', 'statum.js',
  11. '--class-name', 'ClientScript',
  12. '--ns', 'Statum',
  13. '-c', 'application/javascript',
  14. '@INPUT@']
  15. )
  16. client_worker = custom_target('statum-client-worker',
  17. input: files('../js/statum-worker.js'),
  18. output: 'ClientWorker.vala',
  19. command: [statum_mkres,
  20. '-o', '@OUTPUT@',
  21. '-n', 'statum-worker.js',
  22. '--class-name', 'ClientWorker',
  23. '--ns', 'Statum',
  24. '-c', 'application/javascript',
  25. '@INPUT@']
  26. )
  27. sources = files(
  28. 'Statum.vala',
  29. 'StatumResource.vala',
  30. 'HeldSlot.vala',
  31. 'HeldSlotResolver.vala',
  32. 'ChannelService.vala',
  33. 'StatumRequest.vala',
  34. 'StatumDirectives.vala',
  35. 'StatumHandlers.vala',
  36. 'StatumPage.vala',
  37. 'EntrypointRouteTable.vala',
  38. 'ChannelEndpoint.vala',
  39. 'ChannelGatewayEndpoint.vala',
  40. 'ConnectionTracker.vala',
  41. 'AuthorizationPolicy.vala',
  42. 'ChannelSubscriptionEndpoint.vala',
  43. 'SlotPostEndpoint.vala',
  44. 'EntrypointEndpoint.vala',
  45. 'ResourceEndpoint.vala',
  46. 'ActionRegistry.vala',
  47. 'ActionEndpoint.vala',
  48. 'DirectiveBuilder.vala',
  49. 'GObjectMapping.vala',
  50. 'TopicSystem.vala',
  51. 'Model/Scope.vala',
  52. 'Model/SlotDto.vala',
  53. 'Model/FrameDto.vala',
  54. 'Model/SnapshotDto.vala',
  55. 'Model/ActionDto.vala',
  56. 'Model/DirectiveDto.vala',
  57. 'Cryptography/SigningProvider.vala',
  58. 'Cryptography/EncryptionProvider.vala',
  59. 'StateService.vala',
  60. 'State.vala',
  61. 'Slot.vala'
  62. )
  63. # The API version rides every artifact name (libstatum-0.1.so,
  64. # statum-0.1.vapi, ...); the project version is the release version and
  65. # only reaches the pkg-config Version: field (usm checks it against the
  66. # manifest version).
  67. api_version = '0.1'
  68. release_version = meson.project_version()
  69. libstatum = shared_library('statum-@0@'.format(api_version),
  70. sources, client_script, client_worker,
  71. dependencies: [
  72. glib_dep,
  73. gobject_dep,
  74. gio_dep,
  75. gee_dep,
  76. invercargill_dep,
  77. invercargill_json_dep,
  78. json_glib_dep,
  79. libxml_dep,
  80. inversion_dep,
  81. astralis_dep,
  82. locksmith_dep,
  83. invercargill_sql_dep,
  84. sqlite_dep,
  85. invercargill_sql_inversion_dep,
  86. ],
  87. install: true,
  88. vala_gir: 'statum-@0@.gir'.format(api_version),
  89. install_dir: [true, true, true, true]
  90. )
  91. pkg = import('pkgconfig')
  92. pkg.generate(libstatum,
  93. version: release_version,
  94. name: 'statum-@0@'.format(api_version))
  95. statum_dep = declare_dependency(
  96. link_with: libstatum,
  97. include_directories: include_directories('.'),
  98. dependencies: [
  99. glib_dep,
  100. gobject_dep,
  101. gio_dep,
  102. gee_dep,
  103. invercargill_dep,
  104. invercargill_json_dep,
  105. json_glib_dep,
  106. libxml_dep,
  107. inversion_dep,
  108. astralis_dep,
  109. locksmith_dep,
  110. ]
  111. )