From ab7ec939f0b4a8fb21418211fee8e7b89d8c1721 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 23 Oct 2025 01:24:56 +0200 Subject: [PATCH] pytrainer: unbreak --- pkgs/by-name/py/pytrainer/package.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/py/pytrainer/package.nix b/pkgs/by-name/py/pytrainer/package.nix index 9cc8686cf22f..8af97702b335 100644 --- a/pkgs/by-name/py/pytrainer/package.nix +++ b/pkgs/by-name/py/pytrainer/package.nix @@ -2,6 +2,7 @@ lib, python3, fetchFromGitHub, + fetchpatch, gdk-pixbuf, adwaita-icon-theme, gpsbabel, @@ -41,6 +42,20 @@ python.pkgs.buildPythonApplication rec { hash = "sha256-t61vHVTKN5KsjrgbhzljB7UZdRask7qfYISd+++QbV0="; }; + patches = [ + # Fix startup crash with SQLAlchemy 2.0 + (fetchpatch { + url = "https://github.com/pytrainer/pytrainer/commit/9847c76e61945466775bde038057bf5fd31ae089.patch"; + hash = "sha256-cGNu4lK0eQWzcSFTKc8g/qHSSHfy0ow4T3eT+zl5lPM="; + }) + + # Port to webkigtk 4.1 + (fetchpatch { + url = "https://github.com/pytrainer/pytrainer/commit/eda968a8b48074f03efbdfbd692b46edef3658cd.patch"; + hash = "sha256-MdxsKO6DgncHhGlJWcEeyYiPKf3qdhMqXrYYC+jqros="; + }) + ]; + build-system = with python3.pkgs; [ setuptools ]; dependencies = with python.pkgs; [ @@ -89,10 +104,6 @@ python.pkgs.buildPythonApplication rec { postPatch = '' substituteInPlace pytrainer/platform.py \ --replace-fail 'sys.prefix' "\"$out\"" - - # https://github.com/pytrainer/pytrainer/pull/281 - substituteInPlace pytrainer/extensions/mapviewer.py \ - --replace-fail "gi.require_version('WebKit2', '4.0')" "gi.require_version('WebKit2', '4.1')" ''; checkPhase = '' @@ -106,8 +117,6 @@ python.pkgs.buildPythonApplication rec { ''; meta = with lib; { - # https://github.com/pytrainer/pytrainer/issues/280 - broken = true; homepage = "https://github.com/pytrainer/pytrainer"; description = "Application for logging and graphing sporting excursions"; mainProgram = "pytrainer";