meson.build 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Embed the Spry CSS framework (css/spry.css + css/themes/spry-theme-*.css)
  2. # into the library as precompressed ConstantStatumResource classes, served by
  3. # default at /_statum/resource/spry.css and /_statum/resource/spry-theme-*.css
  4. # (registered by SpryModule, like Statum's own client scripts).
  5. statum_mkres = find_program('statum-mkres')
  6. themes = {
  7. 'airy': 'Airy',
  8. 'dwarf': 'Dwarf',
  9. 'formal': 'Formal',
  10. 'glassy': 'Glassy',
  11. 'h2o': 'H2o',
  12. 'living-sky': 'LivingSky',
  13. 'modern': 'Modern',
  14. }
  15. spry_css = custom_target('spry-css',
  16. input: files('../css/spry.css'),
  17. output: 'SpryCss.vala',
  18. command: [statum_mkres,
  19. '-o', '@OUTPUT@',
  20. '-n', 'spry.css',
  21. '--class-name', 'SpryCss',
  22. '--ns', 'Spry.Resources',
  23. '-c', 'text/css',
  24. '@INPUT@']
  25. )
  26. theme_resources = []
  27. foreach slug, suffix : themes
  28. theme_resources += custom_target('spry-theme-@0@'.format(slug),
  29. input: files('../css/themes/spry-theme-@0@.css'.format(slug)),
  30. output: 'SpryTheme@0@.vala'.format(suffix),
  31. command: [statum_mkres,
  32. '-o', '@OUTPUT@',
  33. '-n', 'spry-theme-@0@.css'.format(slug),
  34. '--class-name', 'SpryTheme@0@'.format(suffix),
  35. '--ns', 'Spry.Resources',
  36. '-c', 'text/css',
  37. '@INPUT@']
  38. )
  39. endforeach
  40. sources = files(
  41. 'SpryModule.vala',
  42. 'Auth.vala',
  43. 'Authentication/UserEntity.vala',
  44. 'Authentication/UserPermissionEntity.vala',
  45. 'Authentication/UserProjection.vala',
  46. 'Authentication/UserService.vala',
  47. 'Authentication/Migrations/M0001_Initial.vala',
  48. 'Actions/UserManagementAction.vala',
  49. 'Actions/UserActionPrivate.vala',
  50. 'Actions/ProfileValidation.vala',
  51. 'Actions/LoginAction.vala',
  52. 'Actions/RegisterAction.vala',
  53. 'Actions/LogoutAction.vala',
  54. 'Actions/ChangePasswordAction.vala',
  55. 'Actions/SetUserEnabledAction.vala',
  56. 'Actions/GrantPermissionAction.vala',
  57. 'Actions/RevokePermissionAction.vala',
  58. 'Actions/AlterUserAction.vala',
  59. 'Actions/DeleteUserAction.vala',
  60. )
  61. library_version = meson.project_version()
  62. libspry = shared_library('spry-@0@'.format(library_version),
  63. sources, spry_css, theme_resources,
  64. dependencies: [glib_dep, gobject_dep, gio_dep, invercargill_dep, invercargill_json_dep, json_glib_dep, inversion_dep, astralis_dep, libxml_dep, sodium_deps, invercargill_sql_dep, sqlite_dep, invercargill_sql_inversion_dep, statum_dep],
  65. install: true,
  66. vala_gir: 'spry-@0@.gir'.format(library_version),
  67. install_dir: [true, true, true, true]
  68. )
  69. pkg = import('pkgconfig')
  70. pkg.generate(libspry,
  71. version : library_version,
  72. name : 'spry-@0@'.format(library_version),
  73. requires : [statum_dep])
  74. spry_dep = declare_dependency(
  75. link_with: libspry,
  76. include_directories: include_directories('.'),
  77. dependencies: [glib_dep, gobject_dep, gio_dep, invercargill_dep, invercargill_json_dep, json_glib_dep, inversion_dep, statum_dep]
  78. )