fix(overlay): patch font-manager 0.9.4 for gtk4 4.22 Vala errors

font-manager 0.9.4 fails to compile against gtk4 4.22: the
Gtk.DragIcon.get_for_drag binding changed in the gtk4 vapi, producing
'use new operator' errors in Collections.vala and FontList.vala that
broke home-manager-path for all desktop hosts.

0.9.4 is the latest upstream release (master unfixed too); the fix is
upstream PR FontManager/font-manager#468, already carried by nixpkgs
master but predating our locked nixpkgs and nixpkgs-master inputs.
Vendor the patch as an overlay mod, following the aardvark-dns pattern.
Drop once the nixpkgs lock carries it.
This commit is contained in:
2026-08-31 12:37:32 +02:00
parent ed2f9ba4d2
commit e2c7cce3b0
3 changed files with 62 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
# font-manager 0.9.4: fix compilation against gtk4 >= 4.22 / newer Vala.
#
# In GTK 4.22 the Gtk.DragIcon.get_for_drag binding changed in the gtk4
# vapi, turning `Gtk.DragIcon.get_for_drag(drag)` into a hard Vala error
# ("use `new' operator to create new objects") in Collections.vala and
# FontList.vala. 0.9.4 is the latest upstream release and even upstream
# master is unfixed; the fix lives in FontManager/font-manager#468 and is
# already carried as a patch by current nixpkgs master — but our locked
# nixpkgs (and the locked nixpkgs-master input) predate it.
#
# Drop this overlay (and the patch file) once our nixpkgs lock advances
# past nixpkgs@e2ad529-vendoring (pkgs/by-name/fo/font-manager carries
# fix-compilation-error-with-newer-vala-versions.patch).
{prev}:
prev.font-manager.overrideAttrs (old: {
patches =
(old.patches or [])
++ [./patches/font-manager-fix-compilation-error-with-newer-vala-versions.patch];
})
@@ -0,0 +1,37 @@
From e2ad529a88929bbc76906ac78260dacf4d8c8c6b Mon Sep 17 00:00:00 2001
From: Jan Baier <jan.baier@amagical.net>
Date: Fri, 1 May 2026 17:25:25 +0200
Subject: [PATCH] Fix compilation error with newer Vala versions
Fixes #467
---
src/font-manager/Collections.vala | 2 +-
src/font-manager/FontList.vala | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/font-manager/Collections.vala b/src/font-manager/Collections.vala
index 5e7f5cdb..43531e54 100644
--- a/src/font-manager/Collections.vala
+++ b/src/font-manager/Collections.vala
@@ -523,7 +523,7 @@ namespace FontManager {
var row = ((CollectionListRow) source.widget);
var drag_icon = new Gtk.Label(row.item_label.label);
drag_icon.add_css_class("FontManagerListRowDrag");
- var gtk_drag_icon = (Gtk.DragIcon) Gtk.DragIcon.get_for_drag(drag);
+ var gtk_drag_icon = new Gtk.DragIcon.get_for_drag(drag);
gtk_drag_icon.set_child(drag_icon);
return;
}
diff --git a/src/font-manager/FontList.vala b/src/font-manager/FontList.vala
index c8b170cb..9720dc2b 100644
--- a/src/font-manager/FontList.vala
+++ b/src/font-manager/FontList.vala
@@ -669,7 +669,7 @@ namespace FontManager {
widget_set_name(drag_count, "FontManagerListDragCount");
drag_icon.add_overlay(drag_count);
drag_count.set_label(selected_items.length.to_string());
- var gtk_drag_icon = (Gtk.DragIcon) Gtk.DragIcon.get_for_drag(drag);
+ var gtk_drag_icon = new Gtk.DragIcon.get_for_drag(drag);
gtk_drag_icon.set_child(drag_icon);
return;
}