meson.build 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. sources = files(
  2. 'SpryModule.vala',
  3. 'Auth.vala',
  4. 'Authentication/UserEntity.vala',
  5. 'Authentication/UserPermissionEntity.vala',
  6. 'Authentication/UserProjection.vala',
  7. 'Authentication/UserService.vala',
  8. 'Authentication/Migrations/M0001_Initial.vala',
  9. 'Actions/UserManagementAction.vala',
  10. 'Actions/UserActionPrivate.vala',
  11. 'Actions/ProfileValidation.vala',
  12. 'Actions/LoginAction.vala',
  13. 'Actions/RegisterAction.vala',
  14. 'Actions/LogoutAction.vala',
  15. 'Actions/ChangePasswordAction.vala',
  16. 'Actions/SetUserEnabledAction.vala',
  17. 'Actions/GrantPermissionAction.vala',
  18. 'Actions/RevokePermissionAction.vala',
  19. 'Actions/AlterUserAction.vala',
  20. 'Actions/DeleteUserAction.vala',
  21. )
  22. library_version = meson.project_version()
  23. libspry = shared_library('spry-@0@'.format(library_version),
  24. sources,
  25. 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],
  26. install: true,
  27. vala_gir: 'spry-@0@.gir'.format(library_version),
  28. install_dir: [true, true, true, true]
  29. )
  30. pkg = import('pkgconfig')
  31. pkg.generate(libspry,
  32. version : library_version,
  33. name : 'spry-@0@'.format(library_version),
  34. requires : [statum_dep])
  35. g_ir_compiler = find_program('g-ir-compiler')
  36. # NOTE: Spry intentionally ships no typelib. Its migration classes derive
  37. # from InvercargillSql.Migrations.Migration, and valac's GIR writer emits
  38. # that parent as "invercargill_sql.Migration" (dropping the intermediate
  39. # Migrations namespace segment) while the defining GIR names it
  40. # "invercargill_sql.MigrationsMigration" — g-ir-compiler cannot resolve
  41. # the type and the typelib build fails. The GIR itself is still shipped
  42. # (parents are resolvable through it for consumers that walk the chain).
  43. # Revisit when valac fixes cross-namespace parent naming in generated GIR.
  44. # Ship the .deps file alongside the vapi so consumers can build with
  45. # plain `valac --pkg spry-0.2` without manually resolving the vapi
  46. # chain (GLib stack and the Invercargill/Inversion/Statum stack).
  47. # Every entry resolves in share/vala/vapi.
  48. vapi_install_dir = get_option('datadir') / 'vala' / 'vapi'
  49. install_data(
  50. '../vapi/spry-@0@.deps'.format(library_version),
  51. install_dir: vapi_install_dir,
  52. rename: 'spry-@0@.deps'.format(library_version),
  53. )
  54. spry_dep = declare_dependency(
  55. link_with: libspry,
  56. include_directories: include_directories('.'),
  57. dependencies: [glib_dep, gobject_dep, gio_dep, invercargill_dep, invercargill_json_dep, json_glib_dep, inversion_dep, statum_dep]
  58. )