Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

qgnomeplatform: hardcode gsettings schemas

Fixes #81866

(cherry picked from commit 0ea686647faf81ff224bdfa782856290069dda4e)

+46 -1
+22 -1
pkgs/development/libraries/qgnomeplatform/default.nix
··· 1 - { mkDerivation, lib, fetchFromGitHub, pkgconfig, gtk3, qtbase, qmake, qtx11extras, pantheon }: 2 3 mkDerivation rec { 4 pname = "qgnomeplatform"; ··· 11 sha256 = "0fb1mzs6sx76bl7f0z2xhc0jq6y1c55jrw1v3na8577is6g5ji0a"; 12 }; 13 14 nativeBuildInputs = [ 15 pkgconfig 16 qmake 17 ]; 18 19 buildInputs = [ 20 gtk3 21 qtbase 22 qtx11extras
··· 1 + { mkDerivation 2 + , lib 3 + , fetchFromGitHub 4 + , pkgconfig 5 + , gtk3 6 + , glib 7 + , qtbase 8 + , qmake 9 + , qtx11extras 10 + , pantheon 11 + , substituteAll 12 + , gsettings-desktop-schemas 13 + }: 14 15 mkDerivation rec { 16 pname = "qgnomeplatform"; ··· 23 sha256 = "0fb1mzs6sx76bl7f0z2xhc0jq6y1c55jrw1v3na8577is6g5ji0a"; 24 }; 25 26 + patches = [ 27 + # Hardcode GSettings schema path to avoid crashes from missing schemas 28 + (substituteAll { 29 + src = ./hardcode-gsettings.patch; 30 + gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; 31 + }) 32 + ]; 33 + 34 nativeBuildInputs = [ 35 pkgconfig 36 qmake 37 ]; 38 39 buildInputs = [ 40 + glib 41 gtk3 42 qtbase 43 qtx11extras
+24
pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch
···
··· 1 + diff --git a/common/gnomehintssettings.cpp b/common/gnomehintssettings.cpp 2 + index 9860e57..40fa6ec 100644 3 + --- a/common/gnomehintssettings.cpp 4 + +++ b/common/gnomehintssettings.cpp 5 + @@ -80,9 +80,17 @@ void gtkMessageHandler(const gchar *log_domain, 6 + GnomeHintsSettings::GnomeHintsSettings() 7 + : QObject(0) 8 + , m_usePortal(checkUsePortalSupport()) 9 + - , m_gnomeDesktopSettings(g_settings_new("org.gnome.desktop.wm.preferences")) 10 + - , m_settings(g_settings_new("org.gnome.desktop.interface")) 11 + { 12 + + g_autoptr(GSettingsSchemaSource) schemaSource = nullptr; 13 + + g_autoptr(GSettingsSchema) gnomeDesktopSchema = nullptr; 14 + + g_autoptr(GSettingsSchema) settingsSchema = nullptr; 15 + + 16 + + schemaSource = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", g_settings_schema_source_get_default(), true, nullptr); 17 + + gnomeDesktopSchema = g_settings_schema_source_lookup(schemaSource, "org.gnome.desktop.wm.preferences", false); 18 + + m_gnomeDesktopSettings = g_settings_new_full(gnomeDesktopSchema, nullptr, nullptr); 19 + + settingsSchema = g_settings_schema_source_lookup(schemaSource, "org.gnome.desktop.interface", false); 20 + + m_settings = g_settings_new_full(settingsSchema, nullptr, nullptr); 21 + + 22 + gtk_init(nullptr, nullptr); 23 + 24 + // Set log handler to suppress false GtkDialog warnings