Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- ui: Add Bulgarian translation (Thank you, @salif!)
- webext: Try to read app ID from associated desktop entry (Thank you, @michaelbeaumont!)
- ui: Basic recovery from failed attempts to use devices (e.g. flaky bluetooth)
- build: Make daemon, credentialsd-ui, demo client and web extension optional

# 0.3.1 [2026-09-05]

Expand Down
3 changes: 1 addition & 2 deletions credentialsd-common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Not efficient, since the UI and daemon projects will build it separately, but leaving it this way for now.

common_lib_name = 'credentialsd-common'
cargo = find_program('cargo', required: true)

cargo_options = [
'--manifest-path', meson.project_source_root() / meson.current_source_dir() / 'Cargo.toml',
Expand All @@ -15,4 +14,4 @@ if get_option('cargo_offline') == true
cargo_options += ['--offline']
endif

subdir('src')
subdir('src')
4 changes: 1 addition & 3 deletions credentialsd-ui/data/resources/ui/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
blueprint_compiler = find_program('blueprint-compiler', version: '>= 0.20.4')

blueprint_templates = custom_target(
'blueprints',
input: files('window.blp'),
Expand All @@ -11,4 +9,4 @@ blueprint_templates = custom_target(
'--output', '@OUTPUT@',
'@INPUT@',
],
)
)
19 changes: 5 additions & 14 deletions credentialsd-ui/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,19 @@ gui_build_dir = meson.current_build_dir()
gui_source_dir = meson.current_source_dir()
base_id = 'xyz.iinuwa.credentialsd.CredentialsUi'

dependency('dbus-1', version: '>= 1.6')
dependency('glib-2.0', version: '>= 2.66')
dependency('gio-2.0', version: '>= 2.66')
dependency('gtk4', version: '>= 4.6.2')
glib_dep = dependency('glib-2.0', version: '>= 2.66', required: true)
gio_dep = dependency('gio-2.0', version: '>= 2.66', required: true)
gtk_dep = dependency('gtk4', version: '>= 4.6.2', required: true)

glib_compile_resources = find_program('glib-compile-resources', required: true)
glib_compile_schemas = find_program('glib-compile-schemas', required: true)
# Usually provided by gettext package
msgfmt = find_program('msgfmt', required: false)
xmllint = find_program('xmllint', required: false)
glib_compile_schemas = find_program('glib-compile-schemas', required: true)

appstreamcli = find_program('appstreamcli', required: false)

cargo = find_program('cargo', required: true)

version = meson.project_version()

prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
localedir = prefix / get_option('localedir')

datadir = prefix / get_option('datadir')
pkgdatadir = datadir / gui_executable_name
iconsdir = datadir / 'icons'

Expand Down Expand Up @@ -83,4 +74,4 @@ gnome.post_install(
gtk_update_icon_cache: true,
glib_compile_schemas: true,
update_desktop_database: false,
)
)
16 changes: 6 additions & 10 deletions credentialsd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ backend_executable_name = 'credentialsd'
backend_build_dir = meson.current_build_dir()
base_id = 'xyz.iinuwa.credentialsd.Credentialsd'

dependency('dbus-1', version: '>= 1.6')
dependency('glib-2.0', version: '>= 2.66')
dependency('gio-2.0', version: '>= 2.66')
dependency('gtk4', version: '>= 4.6.2')
dependency('ssl', 'openssl', version: '>= 3.0')
dependency('udev', version: '>= 249')

cargo = find_program('cargo', required: true)

version = meson.project_version()

nfc_dep = dependency('libnfc', version: '>=1.8.0', required: true)
pcsclite_dep = dependency('libpcsclite', version: '>=2.0.3', required: true)
ssl_dep = dependency('ssl', 'openssl', version: '>= 3.0', required: true)
udev_dep = dependency('udev', version: '>= 249', required: true)

if get_option('profile') == 'development'
profile = 'Devel'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
Expand Down Expand Up @@ -56,4 +52,4 @@ if get_option('cargo_offline') == true
endif

subdir('src')
subdir('tests')
subdir('tests')
2 changes: 1 addition & 1 deletion credentialsd/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ test(
'--nocapture',
],
protocol: 'exitcode',
)
)
45 changes: 27 additions & 18 deletions dbus/meson.build
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
dbus_config = configuration_data()
dbus_service_dir = datadir / 'dbus-1' / 'services'
dbus_config.set('DAEMON_EXECUTABLE', bindir / backend_executable_name)
dbus_config.set(
'UI_EXECUTABLE',
bindir / gui_executable_name,
)
configure_file(
input: 'xyz.iinuwa.credentialsd.Credentials.service.in',
install_dir: dbus_service_dir,
output: 'xyz.iinuwa.credentialsd.Credentials.service',
configuration: dbus_config,
)
configure_file(
input: 'xyz.iinuwa.credentialsd.UiControl.service.in',
install_dir: dbus_service_dir,
output: 'xyz.iinuwa.credentialsd.UiControl.service',
configuration: dbus_config,
)

if daemon_feat.allowed()
dbus_daemon_config = configuration_data()
dbus_daemon_config.set('DAEMON_EXECUTABLE', bindir / backend_executable_name)

configure_file(
input: 'xyz.iinuwa.credentialsd.Credentials.service.in',
install_dir: dbus_service_dir,
output: 'xyz.iinuwa.credentialsd.Credentials.service',
configuration: dbus_daemon_config,
)
endif

if gui_feat.allowed()
dbus_ui_config = configuration_data()
dbus_ui_config.set(
'UI_EXECUTABLE',
bindir / gui_executable_name,
)

configure_file(
input: 'xyz.iinuwa.credentialsd.UiControl.service.in',
install_dir: dbus_service_dir,
output: 'xyz.iinuwa.credentialsd.UiControl.service',
configuration: dbus_ui_config,
)
endif
14 changes: 4 additions & 10 deletions demo_client/meson.build
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
dependency('dbus-1', version: '>= 1.6')
dependency('glib-2.0', version: '>= 2.66')
dependency('gio-2.0', version: '>= 2.66')
dependency('gtk4', version: '>= 4.6.2')

glib_compile_resources = find_program('glib-compile-resources', required: true)

demo_blueprints = custom_target(
'demo-blueprints',
input: files('window.blp'),
output: 'ui',
command: [
find_program('blueprint-compiler', required: false),
blueprint_compiler,
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
Expand Down Expand Up @@ -46,8 +39,9 @@ gui_sources = files(
custom_target(
'demo-gui',
input: [gui_sources],
build_by_default: false,
# build if explicitly enabled, otherwise, the target must be selected
build_by_default: demo_client_feat.enabled(),
output: '.',
depends: [demo_resources],
command: ['cp', '@INPUT@', '@OUTPUT@'],
)
)
10 changes: 6 additions & 4 deletions doc/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
install_data(
'xyz.iinuwa.credentialsd.Credentials.xml',
install_dir: datadir / 'credentialsd',
)
if daemon_feat.allowed()
install_data(
'xyz.iinuwa.credentialsd.Credentials.xml',
install_dir: datadir / 'credentialsd',
)
endif
71 changes: 56 additions & 15 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'credentialsd',
'rust',
version: '0.2.0',
version: '0.3.1',
meson_version: '>= 1.5.0',
license: 'LGPL-3.0-only',
)
Expand All @@ -10,6 +10,7 @@ version = meson.project_version()

prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
libdir = prefix / get_option('libdir')
localedir = prefix / get_option('localedir')

Expand All @@ -27,24 +28,64 @@ meson.add_dist_script(
+ version,
meson.project_source_root(),
)
# Features
daemon_feat = get_option('feature_daemon')
demo_client_feat = get_option('feature_demo_client')
gui_feat = get_option('feature_gui')
webext_feat = get_option('feature_web_extension')

# Dependencies
if daemon_feat.allowed() or gui_feat.allowed()
dbus_dep = dependency('dbus-1', version: '>= 1.6', required: true)
endif

# Programs
if daemon_feat.allowed() or gui_feat.allowed()
cargo = find_program('cargo', required: true)
endif

if gui_feat.allowed() or demo_client_feat.allowed()
glib_compile_resources = find_program('glib-compile-resources', required: true)
endif

if gui_feat.allowed() or demo_client_feat.allowed()
blueprint_compiler = find_program('blueprint-compiler', version: '>= 0.20.4', required: true)
endif

# Libs and executables
subdir('credentialsd-common')
subdir('credentialsd')
subdir('credentialsd-ui')
if daemon_feat.allowed() or gui_feat.allowed()
subdir('credentialsd-common')
endif

if daemon_feat.allowed()
subdir('credentialsd')
endif

if gui_feat.allowed()
subdir('credentialsd-ui')
endif

# Data files
subdir('doc')
subdir('dbus')
subdir('portal')
subdir('systemd')
subdir('webext')
if daemon_feat.allowed()
subdir('doc')
endif

if daemon_feat.allowed() or gui_feat.allowed()
subdir('dbus')
endif

subdir('demo_client')
if gui_feat.allowed()
subdir('portal')
endif

# Don't run blueprint-compiler tests
if daemon_feat.allowed() or gui_feat.allowed()
subdir('systemd')
endif

# add_test_setup('skip_subproject_tests',
# is_default: true,
# exclude_suites: ['blueprint-compiler']
# )
if webext_feat.allowed()
subdir('webext')
endif

if demo_client_feat.allowed()
subdir('demo_client')
endif
33 changes: 32 additions & 1 deletion meson.options
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Compile options

option(
'profile',
type: 'combo',
Expand All @@ -21,4 +23,33 @@ option(
type: 'boolean',
value: false,
description: 'Whether to perform an offline build with Cargo. Defaults to false to download crates from registries.',
)
)

# Features
option(
'feature_daemon',
type: 'feature',
value: 'auto',
description: 'Whether to build the credentialsd daemon'
)

option(
'feature_demo_client',
type: 'feature',
value: 'auto',
description: 'Whether to build the demo client'
)

option(
'feature_gui',
type: 'feature',
value: 'enabled',
description: 'Whether to build the credentialsd-ui GUI'
)

option(
'feature_web_extension',
type: 'feature',
value: 'enabled',
description: 'Whether to build the web extension'
)
45 changes: 27 additions & 18 deletions systemd/meson.build
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
systemd_config = configuration_data()
# HACK: Not using libdir option, since on some distros (Fedora), libdir is `lib64`, but systemd is always in `lib`
# If you know of a better way to do this, let me know
systemd_user_service_dir = prefix / 'lib' / 'systemd' / 'user'
systemd_config.set('DAEMON_EXECUTABLE', bindir / backend_executable_name)
systemd_config.set(
'UI_EXECUTABLE',
bindir / gui_executable_name,
)
configure_file(
input: 'xyz.iinuwa.credentialsd.Credentials.service.in',
install_dir: systemd_user_service_dir,
output: 'xyz.iinuwa.credentialsd.Credentials.service',
configuration: systemd_config,
)
configure_file(
input: 'xyz.iinuwa.credentialsd.UiControl.service.in',
install_dir: systemd_user_service_dir,
output: 'xyz.iinuwa.credentialsd.UiControl.service',
configuration: systemd_config,
)

if daemon_feat.allowed()
systemd_daemon_config = configuration_data()
systemd_daemon_config.set('DAEMON_EXECUTABLE', bindir / backend_executable_name)

configure_file(
input: 'xyz.iinuwa.credentialsd.Credentials.service.in',
install_dir: systemd_user_service_dir,
output: 'xyz.iinuwa.credentialsd.Credentials.service',
configuration: systemd_daemon_config,
)
endif

if gui_feat.allowed()
systemd_ui_config = configuration_data()
systemd_ui_config.set(
'UI_EXECUTABLE',
bindir / gui_executable_name,
)

configure_file(
input: 'xyz.iinuwa.credentialsd.UiControl.service.in',
install_dir: systemd_user_service_dir,
output: 'xyz.iinuwa.credentialsd.UiControl.service',
configuration: systemd_ui_config,
)
endif