From 0c54d0d7e7900bc8fd09ccd1250e8fd2279d5d70 Mon Sep 17 00:00:00 2001 From: Paul-Henri Froidmont Date: Sun, 8 Mar 2020 20:55:29 +0100 Subject: [PATCH] Add patch to fix Lutris with recent gtk3 version --- configs/games.nix | 10 ++++++++ configs/lutris_sort_new_with_model_fix.patch | 26 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 configs/lutris_sort_new_with_model_fix.patch diff --git a/configs/games.nix b/configs/games.nix index bd9df7a..a14525f 100644 --- a/configs/games.nix +++ b/configs/games.nix @@ -2,6 +2,16 @@ { hardware.opengl.driSupport32Bit = true; home-manager.users.froidmpa = {pkgs, config, ...}: { + nixpkgs.config = { + allowUnfree = true; + packageOverrides = super: let self = super.pkgs; in { + lutris-unwrapped = super.lutris-unwrapped.overridePythonAttrs (oldAttrs: rec { + patches = [ + ./lutris_sort_new_with_model_fix.patch + ]; + }); + }; + }; home.packages = with pkgs; [ steam lutris diff --git a/configs/lutris_sort_new_with_model_fix.patch b/configs/lutris_sort_new_with_model_fix.patch new file mode 100644 index 0000000..4dfb6cf --- /dev/null +++ b/configs/lutris_sort_new_with_model_fix.patch @@ -0,0 +1,26 @@ +From 12a458db3c590c3f1972594e091a24cb4d65b610 Mon Sep 17 00:00:00 2001 +From: Mathieu Comandon +Date: Wed, 1 Jan 2020 12:47:55 -0800 +Subject: [PATCH] Support both sort_new_with_model and new_with_model + +--- + lutris/gui/views/store.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lutris/gui/views/store.py b/lutris/gui/views/store.py +index 9e843e9e4..8fe5decf5 100644 +--- a/lutris/gui/views/store.py ++++ b/lutris/gui/views/store.py +@@ -140,7 +140,11 @@ def __init__( + self.prevent_sort_update = False # prevent recursion with signals + self.modelfilter = self.store.filter_new() + self.modelfilter.set_visible_func(self.filter_view) +- self.modelsort = Gtk.TreeModelSort.sort_new_with_model(self.modelfilter) ++ try: ++ self.modelsort = Gtk.TreeModelSort.sort_new_with_model(self.modelfilter) ++ except AttributeError: ++ # Apparently some API breaking changes on GTK minor versions. ++ self.modelsort = Gtk.TreeModelSort.new_with_model(self.modelfilter) + self.modelsort.connect("sort-column-changed", self.on_sort_column_changed) + self.modelsort.set_sort_func(sort_col, sort_func, sort_col) + self.sort_view(sort_key, sort_ascending)