Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions pkgs/applications/misc/plover/default.nix

This file was deleted.

68 changes: 68 additions & 0 deletions pkgs/development/python-modules/plover-dev/default.nix
Original file line number Diff line number Diff line change
@@ -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)";
})
39 changes: 39 additions & 0 deletions pkgs/development/python-modules/plover-stroke/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
96 changes: 96 additions & 0 deletions pkgs/development/python-modules/plover/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/rtf-tokenize/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
6 changes: 6 additions & 0 deletions pkgs/top-level/aliases.nix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the "move to by-name" part of this PR, we could create a reference under pkgs/by-name with the python3Packages.toPythonApplication function.

Still, we need to think about how to handle backward compatibility. We may want pkgs.plover to be the Python application of python3Packages.plover, but plover used to be a set containing plover.stable and plover.dev. We might need some config.allowAliases tricks under pkgs.plover.passthru to expose the deprecated plover.stable and plover.dev.

This is not a blocker. Thank you for fixing plover, and I look forward to its merge!

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down
14 changes: 14 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

@ShamrockLee ShamrockLee Apr 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyqt5 and pyqt6 provide separate modules (PyQt5 and PyQt6) and are not interoperable.
We should use the pyqt5 parameter directly unless plover accepts both of pyqt5 and pyqt6.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see why you add the pyqt and wrapQtAppsHook parameters. That enables python3Packages.plover-dev to reuse python3Packages.plover's logic via overriding.

I'm going to consult Python/by-name people about this pattern.

};

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 { };
Expand Down Expand Up @@ -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 { };
Expand Down
Loading