              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] = []

             # Needed for the following binutils bug:
             # https://github.com/mesonbuild/meson/issues/1911
             # However, g-ir-scanner does not understand -Wl,-rpath
@@ -404,18 +405,24 @@ class GnomeModule(ExtensionModule):
             link_command.append('--extra-library=' + lib.name)
         else:
             link_command.append('-l' + lib.name)
-        return link_command
-
-    def _get_dependencies_flags(self, deps, state, depends, include_rpath=False,
-                                use_gir_args=False, separate_nodedup=False):
-        cflags = OrderedSet()
-        internal_ldflags = OrderedSet()
-        external_ldflags = OrderedSet()
+        return link_command, new_depends
+
+    def _get_dependencies_flags_raw(
+            self, deps,
+            state,
+            depends,
+            include_rpath: bool = False,
+            use_gir_args: bool = False,
+            ) -> T.Tuple[OrderedSet[str], OrderedSet[T.Union[str, T.Tuple[str, str]]], OrderedSet[T.Union[str, T.Tuple[str, str]]], OrderedSet[str],
+                         T.List]:
+        cflags: OrderedSet[str] = OrderedSet()
         # External linker flags that can't be de-duped reliably because they
-        # require two args in order, such as -framework AVFoundation
-        external_ldflags_nodedup = []
-        gi_includes = OrderedSet()
+        # require two args in order, such as -framework AVFoundation will be stored as a tuple.
+        internal_ldflags: OrderedSet[T.Union[str, T.Tuple[str, str]]] = OrderedSet()
+        external_ldflags: OrderedSet[T.Union[str, T.Tuple[str, str]]] = OrderedSet()
+        gi_includes: OrderedSet[str] = OrderedSet()
         deps = mesonlib.listify(deps)
+        depends = list(depends)
 
         for dep in deps:
             if isinstance(dep, Dependency):
@@ -427,21 +434,20 @@ class GnomeModule(ExtensionModule):
                 cflags.update(state.get_include_args(dep.include_directories))
                 for lib in dep.libraries:
                     if isinstance(lib, build.SharedLibrary):

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):
