|
|
26d557 |
From 84b2ea237d30a1c93f179d0bc44731ae7962910e Mon Sep 17 00:00:00 2001
|
|
|
26d557 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
26d557 |
Date: Wed, 5 Oct 2022 16:40:48 +0200
|
|
|
26d557 |
Subject: [PATCH 7/9] gnome: allow generator outputs as gdbus-codegen inputs
|
|
|
26d557 |
Content-Type: text/plain
|
|
|
26d557 |
|
|
|
26d557 |
GeneratedLists as sources to `gnome.gdbus_codegen` worked until
|
|
|
26d557 |
version 0.60 of Meson, but broke in 0.61 because of the conversion to
|
|
|
26d557 |
typed_pos_args and typed_kwargs. Reinstate this by adding them to the
|
|
|
26d557 |
decorators and annotations.
|
|
|
26d557 |
|
|
|
26d557 |
Note that gdbus_codegen desugars to two custom_targets and therefore the
|
|
|
26d557 |
generator is invoked twice. This is not optimal, but it should not be
|
|
|
26d557 |
an issue and can be changed later.
|
|
|
26d557 |
|
|
|
26d557 |
Fixes: 53a187ba2 ("modules/gnome: use typed_pos_args for gdbus_codegen", 2021-11-01)
|
|
|
26d557 |
Fixes: ef52e6093 ("modules/gnome: use typed_kwargs for gdbus_codegen", 2021-11-08)
|
|
|
26d557 |
---
|
|
|
26d557 |
mesonbuild/modules/gnome.py | 6 +++---
|
|
|
26d557 |
test cases/frameworks/7 gnome/gdbus/meson.build | 8 ++++++++
|
|
|
26d557 |
test cases/frameworks/7 gnome/meson.build | 3 +++
|
|
|
26d557 |
3 files changed, 14 insertions(+), 3 deletions(-)
|
|
|
26d557 |
|
|
|
26d557 |
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
|
|
|
26d557 |
index 00feba45c..d8669bb48 100644
|
|
|
26d557 |
--- a/mesonbuild/modules/gnome.py
|
|
|
26d557 |
+++ b/mesonbuild/modules/gnome.py
|
|
|
26d557 |
@@ -32,7 +32,7 @@ from .. import mesonlib
|
|
|
26d557 |
from .. import mlog
|
|
|
26d557 |
from ..build import CustomTarget, CustomTargetIndex, Executable, GeneratedList, InvalidArguments
|
|
|
26d557 |
from ..dependencies import Dependency, PkgConfigDependency, InternalDependency
|
|
|
26d557 |
-from ..interpreter.type_checking import DEPENDS_KW, DEPEND_FILES_KW, INSTALL_DIR_KW, INSTALL_KW, NoneType, in_set_validator
|
|
|
26d557 |
+from ..interpreter.type_checking import DEPENDS_KW, DEPEND_FILES_KW, INSTALL_DIR_KW, INSTALL_KW, NoneType, SOURCES_KW, in_set_validator
|
|
|
26d557 |
from ..interpreterbase import noPosargs, noKwargs, FeatureNew, FeatureDeprecated
|
|
|
26d557 |
from ..interpreterbase import typed_kwargs, KwargInfo, ContainerTypeInfo
|
|
|
26d557 |
from ..interpreterbase.decorators import typed_pos_args
|
|
|
26d557 |
@@ -1556,11 +1556,11 @@ class GnomeModule(ExtensionModule):
|
|
|
26d557 |
def gtkdoc_html_dir(self, state: 'ModuleState', args: T.Tuple[str], kwargs: 'TYPE_kwargs') -> str:
|
|
|
26d557 |
return os.path.join('share/gtk-doc/html', args[0])
|
|
|
26d557 |
|
|
|
26d557 |
- @typed_pos_args('gnome.gdbus_codegen', str, optargs=[(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex)])
|
|
|
26d557 |
+ @typed_pos_args('gnome.gdbus_codegen', str, optargs=[(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)])
|
|
|
26d557 |
@typed_kwargs(
|
|
|
26d557 |
'gnome.gdbus_codegen',
|
|
|
26d557 |
_BUILD_BY_DEFAULT.evolve(since='0.40.0'),
|
|
|
26d557 |
- KwargInfo('sources', ContainerTypeInfo(list, (str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex)), since='0.46.0', default=[], listify=True),
|
|
|
26d557 |
+ SOURCES_KW.evolve(since='0.46.0'),
|
|
|
26d557 |
KwargInfo('extra_args', ContainerTypeInfo(list, str), since='0.47.0', default=[], listify=True),
|
|
|
26d557 |
KwargInfo('interface_prefix', (str, NoneType)),
|
|
|
26d557 |
KwargInfo('namespace', (str, NoneType)),
|
|
|
26d557 |
diff --git a/test cases/frameworks/7 gnome/gdbus/meson.build b/test cases/frameworks/7 gnome/gdbus/meson.build
|
|
|
26d557 |
index d749033e9..fdb3896ca 100644
|
|
|
26d557 |
--- a/test cases/frameworks/7 gnome/gdbus/meson.build
|
|
|
26d557 |
+++ b/test cases/frameworks/7 gnome/gdbus/meson.build
|
|
|
26d557 |
@@ -79,6 +79,14 @@ gdbus_src_cti = gnome.gdbus_codegen(
|
|
|
26d557 |
annotations : [],
|
|
|
26d557 |
)
|
|
|
26d557 |
|
|
|
26d557 |
+gdbus_src_gen = gnome.gdbus_codegen(
|
|
|
26d557 |
+ 'generated-gdbus-generator-src',
|
|
|
26d557 |
+ copyfile_gen.process('data/com.example.Sample.xml'),
|
|
|
26d557 |
+ interface_prefix : 'com.example.',
|
|
|
26d557 |
+ namespace : 'Sample',
|
|
|
26d557 |
+ annotations : [],
|
|
|
26d557 |
+)
|
|
|
26d557 |
+
|
|
|
26d557 |
gdbus_exe = executable('gdbus-test', 'gdbusprog.c',
|
|
|
26d557 |
gdbus_src,
|
|
|
26d557 |
include_directories : includes,
|
|
|
26d557 |
diff --git a/test cases/frameworks/7 gnome/meson.build b/test cases/frameworks/7 gnome/meson.build
|
|
|
26d557 |
index 920bc6a82..5f438cb67 100644
|
|
|
26d557 |
--- a/test cases/frameworks/7 gnome/meson.build
|
|
|
26d557 |
+++ b/test cases/frameworks/7 gnome/meson.build
|
|
|
26d557 |
@@ -1,6 +1,9 @@
|
|
|
26d557 |
project('gobject-introspection', 'c')
|
|
|
26d557 |
|
|
|
26d557 |
copyfile = find_program('copyfile.py')
|
|
|
26d557 |
+copyfile_gen = generator(copyfile,
|
|
|
26d557 |
+ output: '@BASENAME@Gen.xml',
|
|
|
26d557 |
+ arguments : ['@INPUT@', '@OUTPUT@'])
|
|
|
26d557 |
|
|
|
26d557 |
glib = dependency('glib-2.0', required: false)
|
|
|
26d557 |
if not glib.found()
|
|
|
26d557 |
--
|
|
|
26d557 |
2.38.1
|
|
|
26d557 |
|