nocal account connect microsoft runs the PKCE browser flow, reads /me, upserts the deterministic account row, and persists tokens to Secret Service as the final connected-state gate. Account IDs are hashed from the remote subject so reconnect is idempotent, and a secret-store failure leaves the same coherent state as a disconnect. Ships a placeholder client ID with NOCAL_MICROSOFT_CLIENT_ID override until a real Entra registration exists.
119 lines
4.7 KiB
Meson
119 lines
4.7 KiB
Meson
project(
|
|
'nocal',
|
|
'cpp',
|
|
version: '0.1.0',
|
|
meson_version: '>=1.1.0',
|
|
default_options: [
|
|
'cpp_std=c++20',
|
|
'warning_level=3',
|
|
'werror=false',
|
|
'buildtype=debugoptimized',
|
|
],
|
|
)
|
|
|
|
inc = include_directories('include')
|
|
sqlite = dependency('sqlite3')
|
|
libcrypto = dependency('libcrypto')
|
|
libcurl = dependency('libcurl')
|
|
libsecret = dependency('libsecret-1')
|
|
nlohmann_json = dependency('nlohmann_json')
|
|
threads = dependency('threads')
|
|
shell = find_program('sh')
|
|
nocal_sources = files(
|
|
'src/domain/calendar_transfer.cpp',
|
|
'src/domain/date.cpp',
|
|
'src/domain/event_query.cpp',
|
|
'src/domain/month_layout.cpp',
|
|
'src/storage/ics_store.cpp',
|
|
'src/storage/sync_cache.cpp',
|
|
'src/sync/curl_http.cpp',
|
|
'src/sync/desktop_oauth.cpp',
|
|
'src/sync/microsoft_account.cpp',
|
|
'src/sync/microsoft_graph.cpp',
|
|
'src/sync/oauth.cpp',
|
|
'src/sync/oauth_tokens.cpp',
|
|
'src/sync/secret_store.cpp',
|
|
'src/sync/token_broker.cpp',
|
|
'src/tui/Screen.cpp',
|
|
'src/tui/EventEditor.cpp',
|
|
'src/tui/Terminal.cpp',
|
|
'src/tui/TuiApp.cpp',
|
|
)
|
|
nocal_lib = static_library('nocal-core', nocal_sources, include_directories: inc,
|
|
dependencies: [sqlite, libcrypto, libcurl, libsecret, nlohmann_json])
|
|
nocal_dep = declare_dependency(include_directories: inc, link_with: nocal_lib,
|
|
dependencies: [sqlite, libcrypto, libcurl, libsecret, nlohmann_json])
|
|
|
|
nocal_executable = executable('nocal', 'src/main.cpp',
|
|
dependencies: nocal_dep, install: true)
|
|
|
|
util = meson.get_compiler('cpp').find_library('util', required: false)
|
|
pty_smoke = executable('tui-pty-smoke', 'tests/tui_pty_smoke.cpp',
|
|
dependencies: util)
|
|
test('tui-pty-smoke', pty_smoke, args: [nocal_executable], timeout: 60)
|
|
|
|
domain_tests = executable('domain-tests', 'tests/domain_tests.cpp',
|
|
dependencies: nocal_dep)
|
|
test('domain', domain_tests)
|
|
calendar_transfer_tests = executable('calendar-transfer-tests',
|
|
'tests/calendar_transfer_tests.cpp', dependencies: nocal_dep)
|
|
test('calendar-transfer', calendar_transfer_tests)
|
|
ics_tests = executable('ics-tests', 'tests/ics_tests.cpp',
|
|
dependencies: nocal_dep)
|
|
test('ics-storage', ics_tests)
|
|
sync_cache_tests = executable('sync-cache-tests', 'tests/sync_cache_tests.cpp',
|
|
dependencies: [nocal_dep, threads])
|
|
test('sync-cache', sync_cache_tests)
|
|
oauth_tests = executable('oauth-tests', 'tests/oauth_tests.cpp',
|
|
dependencies: nocal_dep)
|
|
test('oauth', oauth_tests)
|
|
oauth_security_tests = executable('oauth-security-tests',
|
|
'tests/oauth_security_tests.cpp', dependencies: nocal_dep)
|
|
test('oauth-security', oauth_security_tests)
|
|
curl_http_tests = executable('curl-http-tests', 'tests/curl_http_tests.cpp',
|
|
dependencies: [nocal_dep, threads])
|
|
test('curl-http', curl_http_tests)
|
|
desktop_oauth_tests = executable('desktop-oauth-tests',
|
|
'tests/desktop_oauth_tests.cpp', dependencies: [nocal_dep, threads])
|
|
test('desktop-oauth', desktop_oauth_tests)
|
|
oauth_token_tests = executable('oauth-token-tests',
|
|
'tests/oauth_token_tests.cpp', dependencies: nocal_dep)
|
|
test('oauth-tokens', oauth_token_tests)
|
|
token_broker_tests = executable('token-broker-tests',
|
|
'tests/token_broker_tests.cpp', dependencies: nocal_dep)
|
|
test('token-broker', token_broker_tests)
|
|
microsoft_account_tests = executable('microsoft-account-tests',
|
|
'tests/microsoft_account_tests.cpp', dependencies: nocal_dep)
|
|
test('microsoft-account', microsoft_account_tests)
|
|
secret_store_tests = executable('secret-store-tests',
|
|
'tests/secret_store_tests.cpp', dependencies: nocal_dep)
|
|
test('secret-store', shell,
|
|
args: [files('tests/run_secret_store_test.sh'), secret_store_tests])
|
|
microsoft_graph_tests = executable('microsoft-graph-tests',
|
|
'tests/microsoft_graph_tests.cpp', dependencies: nocal_dep)
|
|
test('microsoft-graph', microsoft_graph_tests)
|
|
microsoft_graph_security_tests = executable('microsoft-graph-security-tests',
|
|
'tests/microsoft_graph_security_tests.cpp', dependencies: nocal_dep)
|
|
test('microsoft-graph-security', microsoft_graph_security_tests)
|
|
tui_tests = executable('tui-tests', 'tests/tui_tests.cpp',
|
|
dependencies: nocal_dep)
|
|
test('tui', tui_tests)
|
|
tui_focus_tests = executable('tui-focus-tests', 'tests/tui_focus_tests.cpp',
|
|
dependencies: nocal_dep)
|
|
test('tui-focus', tui_focus_tests)
|
|
editor_tests = executable('editor-tests', 'tests/editor_tests.cpp',
|
|
dependencies: nocal_dep)
|
|
test('editor', editor_tests)
|
|
|
|
test('cli-recovery', shell,
|
|
args: [files('tests/cli_recovery_test.sh'), nocal_executable])
|
|
test('cli-transfer', shell,
|
|
args: [files('tests/cli_transfer_test.sh'), nocal_executable])
|
|
test('cli-week-start', shell,
|
|
args: [files('tests/cli_week_start_test.sh'), nocal_executable])
|
|
|
|
install_data('scripts/nocal-hyprland', install_dir: get_option('bindir'),
|
|
install_mode: 'rwxr-xr-x')
|
|
install_data('share/applications/dev.nomarchy.nocal.desktop',
|
|
install_dir: get_option('datadir') / 'applications')
|