From 02ee7668c7d6ca1e4387a10779f88dda64b13d1f Mon Sep 17 00:00:00 2001 From: Gavin John Date: Fri, 27 Jun 2025 09:40:20 -0400 Subject: [PATCH] plover.dev: unbork --- pkgs/applications/misc/plover/default.nix | 98 ++++++++++++++--------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/pkgs/applications/misc/plover/default.nix b/pkgs/applications/misc/plover/default.nix index fc0ff2a6b9f9..92c2a95d8f3a 100644 --- a/pkgs/applications/misc/plover/default.nix +++ b/pkgs/applications/misc/plover/default.nix @@ -1,20 +1,70 @@ { lib, config, + stdenv, + buildPythonPackage ? python3Packages.buildPythonPackage, fetchFromGitHub, + versionCheckHook, python3Packages, - wmctrl, - qtbase, - mkDerivationWith, + libsForQt5, }: { - dev = - with python3Packages; - mkDerivationWith buildPythonPackage rec { + dev = ( + buildPythonPackage rec { pname = "plover"; version = "4.0.2"; - format = "setuptools"; + pyproject = true; + + src = fetchFromGitHub { + owner = "openstenoproject"; + repo = "plover"; + tag = "v${version}"; + hash = "sha256-VpQT25bl8yPG4J9IwLkhSkBt31Y8BgPJdwa88WlreA8="; + }; + + postPatch = '' + sed -i 's/,<77//g' pyproject.toml # pythonRelaxDepsHook doesn't work for this for some reason + ''; + + build-system = with python3Packages; [ + babel + setuptools + pyqt5 + wheel + ]; + dependencies = with python3Packages; [ + appdirs + evdev + pyqt5 + pyserial + plover-stroke + rtf-tokenize + setuptools + wcwidth + xlib + ]; + nativeBuildInputs = with libsForQt5; [ + wrapQtAppsHook + ]; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + versionCheckHook + pytest-qt + mock + ]; + + # Segfaults?! + disabledTestPaths = [ "test/gui_qt/test_dictionaries_widget.py" ]; + + preFixup = '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + ''; + + dontWrapQtApps = true; + + pythonImportsCheck = [ "plover" ]; meta = { broken = stdenv.hostPlatform.isDarwin; @@ -25,38 +75,8 @@ ]; license = lib.licenses.gpl2; }; - - src = fetchFromGitHub { - owner = "openstenoproject"; - repo = "plover"; - tag = "v${version}"; - sha256 = "sha256-VpQT25bl8yPG4J9IwLkhSkBt31Y8BgPJdwa88WlreA8="; - }; - - # I'm not sure why we don't find PyQt5 here but there's a similar - # sed on many of the platforms Plover builds for - postPatch = "sed -i /PyQt5/d setup.cfg"; - - nativeCheckInputs = [ - pytest - mock - ]; - propagatedBuildInputs = [ - babel - pyqt5 - xlib - pyserial - appdirs - wcwidth - setuptools - ]; - - dontWrapQtApps = true; - - preFixup = '' - makeWrapperArgs+=("''${qtWrapperArgs[@]}") - ''; - }; + } + ); } // lib.optionalAttrs config.allowAliases { stable = throw "plover.stable was removed because it used Python 2. Use plover.dev instead."; # added 2022-06-05 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ca575294d8bc..04f00495197a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10132,7 +10132,7 @@ with pkgs; plex-mpv-shim = python3Packages.callPackage ../applications/video/plex-mpv-shim { }; - plover = recurseIntoAttrs (libsForQt5.callPackage ../applications/misc/plover { }); + plover = callPackage ../applications/misc/plover { }; # perhaps there are better apps for this task? It's how I had configured my previous system. # And I don't want to rewrite all rules