meson: Fixes for dbus modules
v3 cover meson: Fixes for dbus modules
I found it was failing to build dbus modules when --enable-dbus so here are fixes.
---
Changes in v3:
- Merged dbus_display1_lib into libqemuutil.
- Added patch "audio: Do not include ui/dbus.h".
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Updated MAINTAINERS.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Akihiko Odaki (3):
Move dbus-display1 out of ui
meson: Add dbus_display1 to util_ss and genh
audio: Do not include ui/dbus.h
MAINTAINERS | 1 + meson.build | 23 +++++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 3 +-- tests/qtest/dbus-display-test.c | 2 +- audio/meson.build | 2 +- ui/dbus-display1.xml => dbus-display1.xml | 0 tests/qtest/meson.build | 2 +- ui/meson.build | 20 +------------------- 9 files changed, 30 insertions(+), 25 deletions(-)
---
base-commit: 4705fc0c8511d073bee4751c3c974aab2b10a970
change-id: 20231215-dbus-86876ecb7b09
Best regards,
Signature · 1 line
Akihiko Odaki <[email protected]>
PATCH v3 1/3 Move dbus-display1 out of ui
Despite its name, dbus-display1 does not only provide DBus interfaces for the display but also for the audio.
--- MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +- ui/dbus-display1.xml => dbus-display1.xml | 0 ui/meson.build | 18 ------------------ 7 files changed, 25 insertions(+), 21 deletions(-)
MAINTAINERS +1 -0
@@ -3389,6 +3389,7 @@ F: docs/sphinx/dbus* F: docs/sphinx/fakedbusdoc.py F: tests/qtest/dbus* F: scripts/xml-preprocess* +F: dbus-display.xml Seccomp M: Daniel P. Berrange <[email protected]>
meson.build +21 -0
@@ -2014,6 +2014,27 @@ dbus_display = get_option('dbus_display') \ error_message: gdbus_codegen_error.format('-display dbus')) \ .allowed() +if dbus_display + env = environment() + env.set('TARGETOS', targetos) + xml = custom_target('dbus-display preprocess', + input: 'dbus-display1.xml', + output: 'dbus-display1.xml', + env: env, + command: [xml_pp, '@INPUT@', '@OUTPUT@']) + dbus_display1 = custom_target('dbus-display gdbus-codegen', + output: ['dbus-display1.h', 'dbus-display1.c'], + input: xml, + command: [gdbus_codegen, '@INPUT@', + '--glib-min-required', '2.64', + '--output-directory', meson.current_build_dir(), + '--interface-prefix', 'org.qemu.', + '--c-namespace', 'QemuDBus', + '--generate-c-code', '@BASENAME@']) + dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) + dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) +endif + have_virtfs = get_option('virtfs') \ .require(targetos == 'linux' or targetos == 'darwin', error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
ui/dbus.h +1 -1
@@ -31,7 +31,7 @@#include "ui/console.h" #include "ui/clipboard.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" typedef struct DBusClipboardRequest { GDBusMethodInvocation *invocation;
audio/dbusaudio.c +1 -1
@@ -34,7 +34,7 @@#endif #include "ui/dbus.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" #define AUDIO_CAP "dbus"#include "audio.h"
tests/qtest/dbus-display-test.c +1 -1
@@ -5,7 +5,7 @@#include <gio/gio.h> #include <gio/gunixfdlist.h> #include "libqtest.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" static GDBusConnection *test_dbus_p2p_from_fd (int fd)
dbus-display1.xml renamed from ui/dbus-display1.xml +0 -0
ui/meson.build +0 -18
@@ -75,24 +75,6 @@ endif if dbus_display dbus_ss = ss.source_set() - env = environment() - env.set('TARGETOS', targetos) - xml = custom_target('dbus-display preprocess', - input: 'dbus-display1.xml', - output: 'dbus-display1.xml', - env: env, - command: [xml_pp, '@INPUT@', '@OUTPUT@']) - dbus_display1 = custom_target('dbus-display gdbus-codegen', - output: ['dbus-display1.h', 'dbus-display1.c'], - input: xml, - command: [gdbus_codegen, '@INPUT@', - '--glib-min-required', '2.64', - '--output-directory', meson.current_build_dir(), - '--interface-prefix', 'org.qemu.', - '--c-namespace', 'QemuDBus', - '--generate-c-code', '@BASENAME@']) - dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) dbus_ss.add(when: [gio, dbus_display1_dep], if_true: [files( 'dbus-chardev.c',
Signature · 1 line
2.43.0
Re: [PATCH v3 1/3] Move dbus-display1 out of ui
Quoted 11 lines · Akihiko Odaki
Despite its name, dbus-display1 does not only provide DBus interfaces for the display but also for the audio.
Signed-off-by Akihiko Odaki <[email protected]>--- MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +- ui/dbus-display1.xml => dbus-display1.xml | 0
What about moving it to backends/ instead? Also could be renamed. "ui" means User Interface. Audio is still one. Suggestions:
ui/dbus-backend, backends/dbus-... ?
Quoted 2 lines
ui/meson.build | 18 ------------------ 7 files changed, 25 insertions(+), 21 deletions(-)
Re: [PATCH v3 1/3] Move dbus-display1 out of ui
Quoted 13 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Akihiko Odaki
Despite its name, dbus-display1 does not only provide DBus interfaces for the display but also for the audio.
Signed-off-by Akihiko Odaki <[email protected]>---
MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +-ui/dbus-display1.xml=> dbus-display1.xml | 0
Quoted 4 lines
What about moving it to backends/ instead? Also could be renamed. "ui" means User Interface. Audio is still one. Suggestions:
ui/dbus-backend, backends/dbus-... ?
Moved to util with v4 as I'm adding it to libqemuutil for dbus-display-test. (And I sent v5 since I missed to update the documentation; sorry for sending changes so frequently.)
The file name represents the D-Bus interface name, and renaming the D-Bus interface name will be a breaking change so I decided not to do that for now.
PATCH v3 2/3 meson: Add dbus_display1 to util_ss and genh
In reply to Akihiko OdakiAdding dbus_display1 to util_ss ensures that the source will be linked with audio/dbus. It also avoids recompilation when linking with dbus-display-test.
Adding dbus_display1 to genh ensures that dbus-display1.h is generated before compiling ui/dbus, audio/dbus, and dbus-display-test.
Both changes combined, it is no longer necessary for ui/dbus, audio/dbus, and dbus-display-test to explicitly state the dependency on dbus_display1.
--- meson.build | 6 ++++-- tests/qtest/meson.build | 2 +- ui/meson.build | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-)
meson.build +4 -2
@@ -2014,6 +2014,7 @@ dbus_display = get_option('dbus_display') \ error_message: gdbus_codegen_error.format('-display dbus')) \ .allowed() +dbus_display1_ss = ss.source_set() if dbus_display env = environment() env.set('TARGETOS', targetos)
@@ -2031,8 +2032,8 @@ if dbus_display '--interface-prefix', 'org.qemu.', '--c-namespace', 'QemuDBus', '--generate-c-code', '@BASENAME@']) - dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) + dbus_display1_ss.add(dbus_display1) + genh += dbus_display1[0] endif have_virtfs = get_option('virtfs') \
@@ -3433,6 +3434,7 @@ event_loop_base = declare_dependency(link_whole: event_loop_base, stub_ss = stub_ss.apply(config_all, strict: false) +util_ss.add_all(dbus_display1_ss) util_ss.add_all(trace_ss) util_ss = util_ss.apply(config_all, strict: false) libqemuutil = static_library('qemuutil',
tests/qtest/meson.build +1 -1
@@ -332,7 +332,7 @@ if vnc.found() endif if dbus_display - qtests += {'dbus-display-test': [dbus_display1, gio]} + qtests += {'dbus-display-test': [gio]} endif qtest_executables = {}
ui/meson.build +1 -1
@@ -75,7 +75,7 @@ endif if dbus_display dbus_ss = ss.source_set() - dbus_ss.add(when: [gio, dbus_display1_dep], + dbus_ss.add(when: [gio], if_true: [files( 'dbus-chardev.c', 'dbus-clipboard.c',
Signature · 1 line
2.43.0
PATCH v3 3/3 audio: Do not include ui/dbus.h
In reply to Akihiko Odakiui/dbusaudio.c does not depend on ui/dbus.h
--- audio/dbusaudio.c | 1 - audio/meson.build | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
audio/dbusaudio.c +0 -1
@@ -33,7 +33,6 @@#include <gio/gunixfdlist.h> #endif -#include "ui/dbus.h" #include "dbus-display1.h" #define AUDIO_CAP "dbus"
audio/meson.build +1 -1
@@ -30,7 +30,7 @@ endforeach if dbus_display module_ss = ss.source_set() - module_ss.add(when: [gio, pixman], if_true: files('dbusaudio.c')) + module_ss.add(when: [gio], if_true: files('dbusaudio.c')) audio_modules += {'dbus': module_ss} endif
Signature · 1 line
2.43.0