Blame SOURCES/0007-gnome-allow-generator-outputs-as-gdbus-codegen-input.patch

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