diff --git a/pkgs/applications/misc/plover/default.nix b/pkgs/applications/misc/plover/default.nix deleted file mode 100644 index fc0ff2a6b9f97..0000000000000 --- a/pkgs/applications/misc/plover/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - lib, - config, - fetchFromGitHub, - python3Packages, - wmctrl, - qtbase, - mkDerivationWith, -}: - -{ - dev = - with python3Packages; - mkDerivationWith buildPythonPackage rec { - pname = "plover"; - version = "4.0.2"; - format = "setuptools"; - - meta = { - broken = stdenv.hostPlatform.isDarwin; - description = "OpenSteno Plover stenography software"; - maintainers = with lib.maintainers; [ - twey - kovirobi - ]; - 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/development/python-modules/plover-dev/default.nix b/pkgs/development/python-modules/plover-dev/default.nix new file mode 100644 index 0000000000000..4b43bd1bee366 --- /dev/null +++ b/pkgs/development/python-modules/plover-dev/default.nix @@ -0,0 +1,68 @@ +{ + lib, + fetchFromGitHub, + writeShellScriptBin, + plover, + python3Packages, + pkginfo, + packaging, + psutil, + pygments, + readme-renderer, + requests-cache, + requests-futures, + # Qt + pyqt, + qtbase, + wrapQtAppsHook, +}: + +(plover.override { + inherit wrapQtAppsHook pyqt; +}).overridePythonAttrs + (oldAttrs: rec { + version = "5.0.0.dev2"; + + src = fetchFromGitHub { + owner = "openstenoproject"; + repo = "plover"; + tag = "v${version}"; + hash = "sha256-PZwxVrdQPhgbj+YmWZIUETngeJGs6IQty0hY43tLQO0="; + }; + + # pythonRelaxDeps seemingly doesn't work here + postPatch = oldAttrs.postPatch + '' + sed -i /PySide6-Essentials/d pyproject.toml + ''; + + build-system = oldAttrs.build-system ++ [ + # Replacement for missing pyside6-essentials tools, + # workaround for https://github.com/NixOS/nixpkgs/issues/277849. + # Ideally this would be solved in pyside6 itself but I spent four + # hours trying to untangle its build system before giving up. If + # anyone wants to spend the time fixing it feel free to request + # me (@Pandapip1) as a reviewer. + (writeShellScriptBin "pyside6-uic" '' + exec ${qtbase}/libexec/uic -g python "$@" + '') + (writeShellScriptBin "pyside6-rcc" '' + exec ${qtbase}/libexec/rcc -g python "$@" + '') + ]; + + dependencies = + oldAttrs.dependencies + ++ [ + packaging + pkginfo + psutil + pygments + qtbase + readme-renderer + requests-cache + requests-futures + ] + ++ readme-renderer.optional-dependencies.md; + + meta.description = oldAttrs.meta.description + " (Development version)"; + }) diff --git a/pkgs/development/python-modules/plover-stroke/default.nix b/pkgs/development/python-modules/plover-stroke/default.nix new file mode 100644 index 0000000000000..62da35229cd21 --- /dev/null +++ b/pkgs/development/python-modules/plover-stroke/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + pytestCheckHook, + pytest-qt, + pyside6, +}: + +buildPythonPackage rec { + pname = "plover-stroke"; + version = "1.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "openstenoproject"; + repo = "plover_stroke"; + tag = version; + hash = "sha256-A75OMzmEn0VmDAvmQCp6/7uptxzwWJTwsih3kWlYioA="; + }; + + build-system = [ setuptools ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-qt + pyside6 + ]; + + pythonImportsCheck = [ "plover_stroke" ]; + + meta = { + description = "Helper class for working with steno strokes"; + homepage = "https://github.com/openstenoproject/plover_stroke"; + license = lib.licenses.gpl2Plus; # https://github.com/openstenoproject/plover_stroke/issues/4 + maintainers = with lib.maintainers; [ pandapip1 ]; + }; +} diff --git a/pkgs/development/python-modules/plover/default.nix b/pkgs/development/python-modules/plover/default.nix new file mode 100644 index 0000000000000..17c106c01e635 --- /dev/null +++ b/pkgs/development/python-modules/plover/default.nix @@ -0,0 +1,96 @@ +{ + lib, + config, + stdenv, + plover, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + versionCheckHook, + appdirs, + babel, + evdev, + mock, + pyserial, + pytestCheckHook, + pytest-qt, + plover-stroke, + rtf-tokenize, + setuptools, + wcwidth, + wheel, + xlib, + # Qt dependencies + pyqt, + wrapQtAppsHook, +}: + +buildPythonPackage rec { + pname = "plover"; + version = "4.0.2"; + 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 = [ + babel + setuptools + pyqt + wheel + ]; + dependencies = [ + appdirs + evdev + pyqt + pyserial + plover-stroke + rtf-tokenize + setuptools + wcwidth + xlib + ]; + nativeBuildInputs = [ + wrapQtAppsHook + ]; + + nativeCheckInputs = [ + pytestCheckHook + versionCheckHook + pytest-qt + mock + ]; + + # Segfaults?! + disabledTestPaths = [ "test/gui_qt/test_dictionaries_widget.py" ]; + + preFixup = '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + ''; + + dontWrapQtApps = true; + + pythonImportsCheck = [ "plover" ]; + + meta = { + description = "OpenSteno Plover stenography software"; + homepage = "https://www.openstenoproject.org/plover/"; + mainProgram = "plover"; + maintainers = with lib.maintainers; [ + twey + kovirobi + pandapip1 + ]; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + broken = stdenv.hostPlatform.isDarwin; + }; +} diff --git a/pkgs/development/python-modules/rtf-tokenize/default.nix b/pkgs/development/python-modules/rtf-tokenize/default.nix new file mode 100644 index 0000000000000..805845f5284e8 --- /dev/null +++ b/pkgs/development/python-modules/rtf-tokenize/default.nix @@ -0,0 +1,33 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "rtf-tokenize"; + version = "1.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "openstenoproject"; + repo = "rtf_tokenize"; + tag = version; + hash = "sha256-zwD2sRYTY1Kmm/Ag2hps9VRdUyQoi4zKtDPR+F52t9A="; + }; + + build-system = [ setuptools ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "rtf_tokenize" ]; + + meta = { + description = "Simple RTF tokenizer package for Python"; + homepage = "https://github.com/openstenoproject/rtf_tokenize"; + license = lib.licenses.gpl2Plus; # https://github.com/openstenoproject/rtf_tokenize/issues/1 + maintainers = with lib.maintainers; [ pandapip1 ]; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index e2e2d54edccef..c0577f08b179b 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1351,6 +1351,12 @@ mapAliases { platformioPackages.platformio-core = platformio-core; # Added 2025-09-04 plex-media-player = throw "'plex-media-player' has been discontinued, the new official client is available as 'plex-desktop'"; # Added 2025-05-28 PlistCpp = throw "'PlistCpp' has been renamed to/replaced by 'plistcpp'"; # Converted to throw 2025-10-27 + plover.dev = + if lib.versionOlder "25.11" lib.version then + throw "plover.dev was renamed. Use python3Packages.plover-dev instead." # Added 2025-11-15 + else + python3Packages.plover-dev; + plover.stable = throw "plover.stable was renamed. Use python3Packages.plover instead."; # Added 2022-06-05; Updated 2025-11-15 pltScheme = throw "'pltScheme' has been renamed to/replaced by 'racket'"; # Converted to throw 2025-10-27 plv8 = throw "'plv8' has been removed. Use 'postgresqlPackages.plv8' instead."; # Added 2025-07-19 pn = throw "'pn' has been removed as upstream was archived in 2020"; # Added 2025-10-17 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 746d96f57bafa..3a1f65eb96668 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11514,8 +11514,6 @@ with pkgs; plex-mpv-shim = python3Packages.callPackage ../applications/video/plex-mpv-shim { }; - plover = recurseIntoAttrs (libsForQt5.callPackage ../applications/misc/plover { }); - pokefinder = qt6Packages.callPackage ../tools/games/pokefinder { }; pothos = libsForQt5.callPackage ../applications/radio/pothos { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a4895fcee9209..5174b6728159a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12344,6 +12344,18 @@ self: super: with self; { plotpy = callPackage ../development/python-modules/plotpy { }; + plover = callPackage ../development/python-modules/plover { + inherit (pkgs.libsForQt5) wrapQtAppsHook; + pyqt = self.pyqt5; + }; + + plover-dev = callPackage ../development/python-modules/plover-dev { + inherit (pkgs.qt6) wrapQtAppsHook qtbase; + pyqt = self.pyside6; + }; + + plover-stroke = callPackage ../development/python-modules/plover-stroke { }; + pluggy = callPackage ../development/python-modules/pluggy { }; pluginbase = callPackage ../development/python-modules/pluginbase { }; @@ -16723,6 +16735,8 @@ self: super: with self; { rtb-data = callPackage ../development/python-modules/rtb-data { }; + rtf-tokenize = callPackage ../development/python-modules/rtf-tokenize { }; + rtfde = callPackage ../development/python-modules/rtfde { }; rtfunicode = callPackage ../development/python-modules/rtfunicode { };