From 704018ec790a7f908022947fd04c206cda7d5436 Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Fri, 6 Nov 2026 06:59:42 -0600 Subject: [PATCH] build: Don't require libadwaita by default --- CHANGELOG.md | 4 ++ demo_client/meson.build | 94 ++++++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08bd8ac..071fdd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # [unreleased] +## Improvements + +- build: Don't require libadwaita by default + # 0.4.0 [2026-11-05] ## Improvements diff --git a/demo_client/meson.build b/demo_client/meson.build index dcef500..6331657 100644 --- a/demo_client/meson.build +++ b/demo_client/meson.build @@ -1,47 +1,53 @@ -demo_blueprints = custom_target( - 'demo-blueprints', - input: files('window.blp'), - output: 'ui', - command: [ - blueprint_compiler, - 'batch-compile', - '@OUTPUT@', - '@CURRENT_SOURCE_DIR@', - '@INPUT@', - ], -) +adwaita_dep = dependency('libadwaita-1', version: '>=1.9', required: demo_client_feat) -demo_resources = custom_target( - 'demo-resource', - input: files('resources.gresource.xml'), - depend_files: files('style.css'), - depfile: 'gresource.deps', - output: 'resources.gresource', - command: [ - glib_compile_resources, - '--target=@OUTPUT@', - '--dependency-file=@DEPFILE@', - '--sourcedir=@CURRENT_SOURCE_DIR@', - '--sourcedir', demo_blueprints[0], - '@INPUT@', - ], -) +if adwaita_dep.found() -gui_sources = files( - '../doc/xyz.iinuwa.credentialsd.Credentials.xml', - 'cbor.py', - 'gui.py', - 'main.py', - 'util.py', - 'webauthn.py', -) + demo_blueprints = custom_target( + 'demo-blueprints', + input: files('window.blp'), + output: 'ui', + command: [ + blueprint_compiler, + 'batch-compile', + '@OUTPUT@', + '@CURRENT_SOURCE_DIR@', + '@INPUT@', + ], + ) -custom_target( - 'demo-gui', - input: [gui_sources], - # 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@'], -) + demo_resources = custom_target( + 'demo-resource', + input: files('resources.gresource.xml'), + depend_files: files('style.css'), + depfile: 'gresource.deps', + output: 'resources.gresource', + command: [ + glib_compile_resources, + '--target=@OUTPUT@', + '--dependency-file=@DEPFILE@', + '--sourcedir=@CURRENT_SOURCE_DIR@', + '--sourcedir', demo_blueprints[0], + '@INPUT@', + ], + ) + + gui_sources = files( + '../doc/xyz.iinuwa.credentialsd.Credentials.xml', + 'cbor.py', + 'gui.py', + 'main.py', + 'util.py', + 'webauthn.py', + ) + + custom_target( + 'demo-gui', + input: [gui_sources], + # 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@'], + ) + +endif