meson.build 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. project('clanker-saddle', ['c', 'vala'],
  2. version: '0.1',
  3. )
  4. glib_dep = dependency('glib-2.0')
  5. gobject_dep = dependency('gobject-2.0')
  6. gio_dep = dependency('gio-2.0')
  7. json_glib_dep = dependency('json-glib-1.0')
  8. soup_dep = dependency('libsoup-3.0')
  9. libxml_dep = dependency('libxml-2.0')
  10. sqlite_dep = dependency('sqlite3')
  11. invercargill_dep = dependency('invercargill-1')
  12. invercargill_json_dep = dependency('invercargill-json')
  13. invercargill_sql_dep = dependency('invercargill-sql')
  14. invercargill_sql_inversion_dep = dependency('invercargill-sql-inversion')
  15. inversion_dep = dependency('inversion-0.1')
  16. astralis_dep = dependency('astralis-0.1')
  17. statum_dep = dependency('statum-0.1')
  18. spry_dep = dependency('spry-0.2')
  19. # Web Push crypto primitives (P-256 ECDH/ECDSA + AES-128-GCM for VAPID
  20. # and RFC 8291 payload encryption — plan 11 task E). Found via the C
  21. # compiler (no Vala vapi exists for libcrypto; the shim is C-only).
  22. libcrypto_dep = meson.get_compiler('c').find_library('crypto')
  23. # Statum build tools — statum-mkpstm compiles pages, statum-mkres embeds
  24. # resources. Resolved from PATH at setup time.
  25. statum_mkpstm = find_program('statum-mkpstm')
  26. statum_mkres = find_program('statum-mkres')
  27. # =============================================================================
  28. # Statum pages (statum-mkpstm): HTML → StatumPage subclass. Every page
  29. # composes the shared layout (main.html), which the tool discovers next to
  30. # the pages.
  31. # =============================================================================
  32. template_deps = files(
  33. 'src/pages/main.html',
  34. # Partials (plan 16 R3, arch 16): inlined into pages at compile
  35. # time via <pstm-fragment>; discovered next to the pages.
  36. 'src/pages/goal_branches.html',
  37. 'src/pages/goal_compare.html',
  38. 'src/pages/progress_feed.html',
  39. 'src/pages/block_answer.html',
  40. 'src/pages/block_reply.html',
  41. )
  42. # spry:pages-begin
  43. home_page = custom_target('home-page',
  44. input: 'src/pages/home.html',
  45. output: 'HomePage.vala',
  46. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'HomePage', '--ns', 'ClankerSaddle', '@INPUT@'],
  47. depend_files: template_deps
  48. )
  49. login_page = custom_target('login-page',
  50. input: 'src/pages/login.html',
  51. output: 'LoginPage.vala',
  52. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'LoginPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  53. depend_files: template_deps
  54. )
  55. projects_page = custom_target('projects-page',
  56. input: 'src/pages/projects.html',
  57. output: 'ProjectsPage.vala',
  58. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'ProjectsPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  59. depend_files: template_deps
  60. )
  61. project_detail_page = custom_target('project-detail-page',
  62. input: 'src/pages/project_detail.html',
  63. output: 'ProjectDetailPage.vala',
  64. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'ProjectDetailPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  65. depend_files: template_deps
  66. )
  67. tasks_page = custom_target('tasks-page',
  68. input: 'src/pages/tasks.html',
  69. output: 'TasksPage.vala',
  70. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'TasksPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  71. depend_files: template_deps
  72. )
  73. task_detail_page = custom_target('task-detail-page',
  74. input: 'src/pages/task_detail.html',
  75. output: 'TaskDetailPage.vala',
  76. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'TaskDetailPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  77. depend_files: template_deps
  78. )
  79. task_log_page = custom_target('task-log-page',
  80. input: 'src/pages/task_log.html',
  81. output: 'TaskLogPage.vala',
  82. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'TaskLogPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  83. depend_files: template_deps
  84. )
  85. goals_page = custom_target('goals-page',
  86. input: 'src/pages/goals.html',
  87. output: 'GoalsPage.vala',
  88. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'GoalsPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  89. depend_files: template_deps
  90. )
  91. goal_detail_page = custom_target('goal-detail-page',
  92. input: 'src/pages/goal_detail.html',
  93. output: 'GoalDetailPage.vala',
  94. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'GoalDetailPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  95. depend_files: template_deps
  96. )
  97. saddles_page = custom_target('saddles-page',
  98. input: 'src/pages/saddles.html',
  99. output: 'SaddlesPage.vala',
  100. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'SaddlesPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  101. depend_files: template_deps
  102. )
  103. rules_page = custom_target('rules-page',
  104. input: 'src/pages/rules.html',
  105. output: 'RulesPage.vala',
  106. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'RulesPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  107. depend_files: template_deps
  108. )
  109. users_page = custom_target('users-page',
  110. input: 'src/pages/users.html',
  111. output: 'UsersPage.vala',
  112. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'UsersPage', '--ns', 'ClankerSaddle', '@INPUT@'],
  113. depend_files: template_deps
  114. )
  115. profile_page = custom_target('profile-page',
  116. input: 'src/pages/profile.html',
  117. output: 'ProfilePage.vala',
  118. command: [statum_mkpstm, '-o', '@OUTPUT@', '-n', 'ProfilePage', '--ns', 'ClankerSaddle', '@INPUT@'],
  119. depend_files: template_deps
  120. )
  121. # spry:pages-end
  122. # =============================================================================
  123. # Embedded resources (statum-mkres): the stylesheet precompressed at build
  124. # time and served from /_statum/resource/app.css.
  125. # =============================================================================
  126. app_css = custom_target('app-css',
  127. input: 'src/pages/app.css',
  128. output: 'AppCss.vala',
  129. command: [statum_mkres, '-o', '@OUTPUT@', '-n', 'app.css', '--class-name', 'AppCss',
  130. '--ns', 'ClankerSaddle', '-c', 'text/css', '@INPUT@'],
  131. )
  132. favicon_png = custom_target('favicon-png',
  133. input: 'src/clanker-saddle.png',
  134. output: 'FaviconResource.vala',
  135. command: [statum_mkres, '-o', '@OUTPUT@', '-n', 'clanker-saddle.png',
  136. '--class-name', 'FaviconResource', '--ns', 'ClankerSaddle',
  137. '-c', 'image/png', '@INPUT@'],
  138. )
  139. emblem_png = custom_target('emblem-png',
  140. input: 'src/clanker-saddle-emblem.png',
  141. output: 'EmblemResource.vala',
  142. command: [statum_mkres, '-o', '@OUTPUT@', '-n', 'clanker-saddle-emblem.png',
  143. '--class-name', 'EmblemResource', '--ns', 'ClankerSaddle',
  144. '-c', 'image/png', '@INPUT@'],
  145. )
  146. # =============================================================================
  147. # Sources
  148. # =============================================================================
  149. app_sources = files(
  150. # spry:sources-begin
  151. 'src/main.vala',
  152. 'src/Json.vala',
  153. 'src/Format.vala',
  154. 'src/Data/Entities.vala',
  155. 'src/Data/Migrations/M0001_Initial.vala',
  156. 'src/Services/ProjectService.vala',
  157. 'src/Services/TaskService.vala',
  158. 'src/Services/GoalService.vala',
  159. 'src/Services/SaddleService.vala',
  160. 'src/Services/EventService.vala',
  161. 'src/Services/LifecycleService.vala',
  162. 'src/Services/SaddlePollState.vala',
  163. 'src/Services/AllocationService.vala',
  164. 'src/Services/StatePulse.vala',
  165. 'src/Services/Dispatcher.vala',
  166. 'src/Services/RuleService.vala',
  167. 'src/Services/CapabilityService.vala',
  168. 'src/Services/TimelineService.vala',
  169. 'src/Services/PushService.vala',
  170. 'src/Api/SaddleApi.vala',
  171. 'src/Api/EventLogApi.vala',
  172. 'src/Api/PushApi.vala',
  173. 'src/actions/Forms.vala',
  174. 'src/actions/LoginAction.vala',
  175. 'src/actions/ProjectActions.vala',
  176. 'src/actions/TaskActions.vala',
  177. 'src/actions/GoalActions.vala',
  178. 'src/actions/DashboardActions.vala',
  179. 'src/actions/SaddleActions.vala',
  180. 'src/actions/RuleActions.vala',
  181. 'src/actions/CapabilityActions.vala',
  182. 'src/actions/UserActions.vala',
  183. 'src/actions/ProfileActions.vala',
  184. 'src/actions/PushActions.vala',
  185. 'src/entrypoints/HomeEntrypoint.vala',
  186. 'src/entrypoints/LoginEntrypoint.vala',
  187. 'src/entrypoints/ProjectsEntrypoint.vala',
  188. 'src/entrypoints/TasksEntrypoint.vala',
  189. 'src/entrypoints/TaskDetailEntrypoint.vala',
  190. 'src/entrypoints/TaskLogEntrypoint.vala',
  191. 'src/entrypoints/GoalDetailEntrypoint.vala',
  192. 'src/entrypoints/SaddlesEntrypoint.vala',
  193. 'src/entrypoints/RulesEntrypoint.vala',
  194. 'src/entrypoints/UsersEntrypoint.vala',
  195. 'src/entrypoints/ProfileEntrypoint.vala',
  196. # spry:sources-end
  197. )
  198. # Web Push crypto shim (plan 11 task E): C over OpenSSL's libcrypto —
  199. # P-256 keygen/ECDH/ECDSA + AES-128-GCM behind web-push-crypto.vapi.
  200. push_crypto = files('src/Push/web-push-crypto.c')
  201. app_generated = [
  202. # spry:generated-begin
  203. home_page,
  204. login_page,
  205. projects_page,
  206. project_detail_page,
  207. tasks_page,
  208. task_detail_page,
  209. task_log_page,
  210. goals_page,
  211. goal_detail_page,
  212. saddles_page,
  213. rules_page,
  214. users_page,
  215. profile_page,
  216. # spry:generated-end
  217. ]
  218. clanker_saddle_exe = executable('clanker-saddle',
  219. app_sources + app_generated + [app_css, favicon_png, emblem_png, push_crypto],
  220. include_directories: include_directories('src/Push'),
  221. vala_args: ['--vapidir=' + join_paths(meson.current_source_dir(), 'vapi')],
  222. dependencies: [
  223. spry_dep,
  224. statum_dep,
  225. astralis_dep,
  226. inversion_dep,
  227. invercargill_sql_inversion_dep,
  228. invercargill_sql_dep,
  229. invercargill_json_dep,
  230. invercargill_dep,
  231. sqlite_dep,
  232. libxml_dep,
  233. soup_dep,
  234. json_glib_dep,
  235. gio_dep,
  236. gobject_dep,
  237. glib_dep,
  238. libcrypto_dep,
  239. ],
  240. install: true
  241. )
  242. # =============================================================================
  243. # Tests: the web-stack suite is a package (plan 16 R5, arch 18) —
  244. # test/web_stack_test.py is the entry shim meson invokes; the shared
  245. # machinery (fake saddle daemon, wire helpers, fixtures, the parallel
  246. # runner) lives in test/harness.py and one module per scenario bundle
  247. # in test/bundles/. Each bundle runs as its own shard process (own app,
  248. # daemons and SQLite scratch) and the runner aggregates the verdicts
  249. # into this single test's result.
  250. # =============================================================================
  251. python_test = import('python').find_installation('python3')
  252. test('web-stack', python_test,
  253. args: [files('test/web_stack_test.py'), clanker_saddle_exe],
  254. timeout: 900,
  255. )