The build always unconditionally depends on gi-docgen and clones the git repo
if not found in the system. That get_option part is broken? Using meson 1.2.2.

It would be nice if you wouldn't have any automatism downloading things during
build. Please stop that.

--- gdk-pixbuf2-2.42.10/docs/meson.build.orig	2023-11-11 12:22:08.410634330 +0000
+++ gdk-pixbuf2-2.42.10/docs/meson.build	2023-11-11 12:23:44.497625422 +0000
@@ -1,9 +1,16 @@
-gidocgen_dep = dependency('gi-docgen',
-  version: '>= 2021.1',
-  fallback: ['gi-docgen', 'dummy_dep'],
-  required: get_option('gtk_doc'),
-)
+build_docs = get_option('gtk_doc')
+if get_option('docs')
+  warning('The docs option is deprecated; use -Dgtk_doc=true')
+  build_docs = true
+endif
 
+if build_docs
+  gidocgen_dep = dependency('gi-docgen',
+    version: '>= 2021.1',
+    fallback: ['gi-docgen', 'dummy_dep'],
+    required: get_option('gtk_doc'),
+  )
+endif
 
 toml_conf = configuration_data()
 toml_conf.set('VERSION', meson.project_version())
@@ -18,12 +25,6 @@
   'scaling-compositing.md',
 ]
 
-build_docs = get_option('gtk_doc')
-if get_option('docs')
-  warning('The docs option is deprecated; use -Dgtk_doc=true')
-  build_docs = true
-endif
-
 if build_docs
   custom_target('gdk-pixbuf-doc',
     input: [ pixbuf_toml, gdkpixbuf_gir[0] ],
