              external_ldflags = fix_ldflags(external_ldflags)
 -        if not separate_nodedup:
 -            external_ldflags.update(external_ldflags_nodedup)
--            return cflags, internal_ldflags, external_ldflags, gi_includes
+-            return cflags, internal_ldflags, external_ldflags, None, gi_includes
 -        else:
 -            return cflags, internal_ldflags, external_ldflags, external_ldflags_nodedup, gi_includes
 +        return cflags, internal_ldflags, external_ldflags, gi_includes, depends
 +
 +    def _get_dependencies_flags(
-+            self, deps,
-+            state,
-+            depends,
-+            include_rpath: bool = False,
-+            use_gir_args: bool = False,
++            self, deps: T.Sequence[T.Union['Dependency', build.SharedLibrary, build.StaticLibrary]],
++            state: 'ModuleState', depends: T.List[build.BuildTarget], include_rpath: bool = False,
++            use_gir_args: bool = False
 +            ) -> T.Tuple[OrderedSet[str], T.List[str], T.List[str], OrderedSet[str],
-+                         T.List]:
++                         T.List[T.Union[build.BuildTarget, 'build.GeneratedTypes', 'FileOrString']]]:
 +
 +        cflags, internal_ldflags_raw, external_ldflags_raw, gi_includes, depends = self._get_dependencies_flags_raw(deps, state, depends, include_rpath, use_gir_args)
 +        internal_ldflags: T.List[str] = []

+                external_ldflags.extend(ldflag)
 
+        return cflags, internal_ldflags, external_ldflags, gi_includes, depends
     def _unwrap_gir_target(self, girtarget, state):
         if not isinstance(girtarget, (build.Executable, build.SharedLibrary,
                                       build.StaticLibrary)):
@@ -875,7 +903,7 @@ class GnomeModule(ExtensionModule):
         # ldflags will be misinterpreted by gir scanner (showing
         # spurious dependencies) but building GStreamer fails if they
         # are not used here.
-        dep_cflags, dep_internal_ldflags, dep_external_ldflags, gi_includes = \
+        dep_cflags, dep_internal_ldflags, dep_external_ldflags, gi_includes, depends = \
             self._get_dependencies_flags(deps, state, depends, use_gir_args=True)
         scan_cflags = []
         scan_cflags += list(self._get_scanner_cflags(cflags))
@@ -1170,7 +1198,7 @@ class GnomeModule(ExtensionModule):
         deps = extract_as_list(kwargs, 'dependencies')
         cflags = []
         cflags.extend(mesonlib.stringlistify(kwargs.pop('c_args', [])))
-        deps_cflags, internal_ldflags, external_ldflags, gi_includes = \
+        deps_cflags, internal_ldflags, external_ldflags, gi_includes, depends = \
             self._get_dependencies_flags(deps, state, depends, include_rpath=True)
         inc_dirs = mesonlib.extract_as_list(kwargs, 'include_directories')
         for incd in inc_dirs:

Also pick https://github.com/mesonbuild/meson/commit/68e684d51f1e469e0d9f4b499ffda15146cad98a when resolving conflict.

diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 214f97ac3..0521b2605 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -593,15 +593,16 @@ class GnomeModule(ExtensionModule):
                        lib: T.Union[build.SharedLibrary, build.StaticLibrary],
                        depends: T.List[build.BuildTarget],
                        include_rpath: bool = False,
-                       use_gir_args: bool = False) -> T.List[str]:
+                       use_gir_args: bool = False) -> T.Tuple[T.List[str], T.List[T.Union[build.BuildTarget, 'build.GeneratedTypes', 'FileOrString']]]:
         link_command: T.List[str] = []
+        new_depends = list(depends)
         # Construct link args
         if isinstance(lib, build.SharedLibrary):
