From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: openKylinBot <openKylinBot@openkylin.top>
Date: Mon, 19 Oct 2026 23:58:00 +0800
Subject: [PATCH] Fix FTBFS: don't pull in GIO 2.82 API via gtk4's gnome_47 feature

Description: Avoid the undefined reference to g_unix_mounts_get_from_file()
 gtk4's "gnome_47" feature expands to ["v4_16", "gio/v2_82", "gnome_46"], and
 "gio/v2_82" turns on gio-sys's "v2_82" feature. gio-sys 0.21.5 implements the
 pre-2.84 GIO API names through a shim module (manual.rs), and with "v2_82" set
 but "v2_84" unset that shim calls g_unix_mounts_get_from_file():
 .
   /usr/share/cargo/registry/gio-sys-0.21.5/src/manual.rs:275:
   undefined reference to `g_unix_mounts_get_from_file'
   collect2: error: ld returned 1 exit status
 .
 The GIO shipped in this archive is 2.80.0 (gio-2.0.pc: Version: 2.80.0) and does
 not export that symbol, which was only added in GIO 2.82. Because system-deps
 does not validate the per-feature version requirements, the feature is enabled
 even though the system library is too old.
 .
 Functionality is unchanged: "v4_16" and "gnome_46" reproduce gnome_47 exactly
 apart from the GIO 2.82 requirement, and pfs only uses GIO APIs that are
 available in 2.80 (gio::File, gio::DBusProxy, gio::Settings, gio::FileInfo, ...);
 it does not use UnixMountEntry/UnixMountPoint, gio::Converter::convert_bytes()
 or Settings::bind_with_mapping_closures(), the only GIO functions gated on 2.82.
 .
 This is not architecture specific: the amd64, arm64, loong64 and riscv64 builds
 all fail with the same undefined reference, since all of them build against the
 same GIO 2.80.
Author: openKylinBot <openKylinBot@openkylin.top>
Origin: upstream, https://gitlab.gnome.org/World/Phosh/pfs
Bug: https://build.openkylin.top/~kylinsoft/+archive/openkylin/anything3.0
Last-Update: 2026-10-19
---
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,7 +26,12 @@
 [dependencies]
 gettext-rs = { version = "0.7", features = ["gettext-system"] }
 glib-macros = "0.21"
-gtk = { version = "0.10", package = "gtk4", features = ["gnome_47"] }
+# gtk4's gnome_47 feature also enables gio/v2_82. gio-sys 0.21.5 uses that feature
+# to select g_unix_mounts_get_from_file(), which does not exist in the GIO 2.80
+# shipped in this archive, so linking the static library fails with an undefined
+# reference. Ask for the v4_16 and gnome_46 parts of gnome_47 directly instead;
+# this keeps the GTK 4.16 API available without requiring any GIO 2.82 symbol.
+gtk = { version = "0.10", package = "gtk4", features = ["v4_16", "gnome_46"] }
 
 [dependencies.adw]
 package = "libadwaita"
