Skip to content
Merged
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
49 changes: 27 additions & 22 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,28 +199,33 @@ There are a few Meson options to control the build that may be useful for packag

> meson configure
# ...
Project options Default Value Possible Values Description
----------------- ------------- --------------- -----------
cargo_home The directory to
store files
downloaded by
Cargo
cargo_offline false [true, false] Whether to
perform an
offline build
with Cargo.
Defaults to false
to download
crates from
registries.
profile default [default, The build profile
development] for Credential
Manager. One of
"default" or
"development".
```

> TODO: rename `default` profile to `release` to reduce confusion.
Project options Default Value Possible Values Description
----------------- ------------- --------------- -----------
cargo_home The directory to store files downloaded by
Cargo
cargo_locked false [True, False] Whether Cargo.lock will be used without
modification. Defaults to false to
automatically resolve dependencies.
cargo_offline false [True, False] Whether to perform an offline build with
Cargo. Defaults to false to download crates
from registries.
feature_daemon auto [enabled, disabled, Whether to build the credentialsd daemon

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reading the docs, I don't think it's clear what exactly "auto" means here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I should explain it more inline. It essentially means it will build if it finds the necessary dependencies, and skip the build if not. Setting to enabled will fail the build on missing dependencies.

But this is a big: I meant to make this enabled by default. Only demo_client should be auto. I'll add a fixup on that.

auto]
feature_demo_client auto [enabled, disabled, Whether to build the demo client
auto]
feature_gui enabled [enabled, disabled, Whether to build the credentialsd-ui GUI
auto]
feature_web_extension enabled [enabled, disabled, Whether to build the web extension
auto]
profile release [release, development] The build profile for the targets. The
`development` profile also allows disabling
some security checks for easier development.
```

See [Meson documentation on feature options][meson-features-doc] for more information on the values
for the `feature_*` options.

[meson-features-doc]: https://mesonbuild.com/Build-options.html#features

# Running Tests

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- 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
- build: Rename `default` profile to `release`.

# 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
Loading