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:
@@ -7,10 +7,15 @@
|
|||||||
# This one contains whatever you want to overlay
|
# This one contains whatever you want to overlay
|
||||||
# You can change versions, add patches, set compilation flags, anything really.
|
# You can change versions, add patches, set compilation flags, anything really.
|
||||||
# https://nixos.wiki/wiki/Overlays
|
# https://nixos.wiki/wiki/Overlays
|
||||||
modifications = final: _prev: {
|
modifications = final: prev: {
|
||||||
# aardvark-dns 2.x has a DNS forwarding bug breaking external name
|
# aardvark-dns 2.x has a DNS forwarding bug breaking external name
|
||||||
# resolution in podman networks — pin to last 1.x from nixpkgs-stable.
|
# resolution in podman networks — pin to last 1.x from nixpkgs-stable.
|
||||||
aardvark-dns = import ./mods/aardvark-dns.nix {inherit (final) stable;};
|
aardvark-dns = import ./mods/aardvark-dns.nix {inherit (final) stable;};
|
||||||
|
|
||||||
|
# font-manager 0.9.4 does not compile against gtk4 4.22 (Vala errors
|
||||||
|
# in Gtk.DragIcon.get_for_drag) — apply the upstream fix from
|
||||||
|
# FontManager/font-manager#468 until our nixpkgs lock carries it.
|
||||||
|
font-manager = import ./mods/font-manager.nix {inherit prev;};
|
||||||
};
|
};
|
||||||
|
|
||||||
# temp-packages = final: _prev: {
|
# temp-packages = final: _prev: {
|
||||||
|
|||||||
@@ -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];
|
||||||
|
})
|
||||||
+37
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user