Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plover: move into pythonPackages and add plugins #347354

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
37 changes: 0 additions & 37 deletions pkgs/applications/misc/plover/default.nix

This file was deleted.

36 changes: 36 additions & 0 deletions pkgs/development/python-modules/plover-dict-commands/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
lib,
fetchPypi,
python3Packages,
plover,
setuptools,
setuptools-scm,
pythonImportsCheckHook,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-dict-commands";
version = "0.2.5";
pyproject = true;
build-system = [
setuptools
setuptools-scm
];

meta = with lib; {
description = "Plugin for enabling, disabling, and changing the priority of dictionaries in Plover";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "plover_dict_commands";
inherit version;
hash = "sha256-ki/M5V106YbQMjZQmkTNyBzFboVYi/x0hkLAXqPyk8Q=";
};

nativeCheckInputs = [
pythonImportsCheckHook
];

propagatedBuildInputs = [ plover ];
}
44 changes: 44 additions & 0 deletions pkgs/development/python-modules/plover-lapwing-aio/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
lib,
fetchPypi,
python3Packages,
plover,
plover-dict-commands,
plover-last-translation,
plover-modal-dictionary,
plover-python-dictionary,
plover-stitching,
setuptools,
pythonImportsCheckHook,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-lapwing-aio";
version = "1.3.4";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
description = "Automatically installs all the necessary plugins and dictionaries for using Lapwing theory with Plover";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "plover_lapwing_aio";
inherit version;
hash = "sha256-0GqmWGe5uN2JfnH/XMWrIH5As3xueREBU6nk3gGi3Vw=";
};

nativeCheckInputs = [
pythonImportsCheckHook
];

propagatedBuildInputs = [
plover
plover-dict-commands
plover-last-translation
plover-modal-dictionary
plover-python-dictionary
plover-stitching
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
lib,
fetchPypi,
python3Packages,
plover,
setuptools,
pythonImportsCheckHook,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-last-translation";
version = "0.0.2";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
description = "Macro plugins for Plover to repeat output";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "plover_last_translation";
inherit version;
hash = "sha256-lmgjbuwdqZ8eeU4m/d1akFwwj5CmliEaLmXEKAubjdk=";
};

nativeCheckInputs = [
pythonImportsCheckHook
];

propagatedBuildInputs = [ plover ];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
lib,
fetchPypi,
python3Packages,
plover,
setuptools,
pythonImportsCheckHook,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-modal-dictionary";
version = "0.0.3";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
description = "Modal Dictionaries for Plover";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
inherit pname version;
hash = "sha256-qLr5H6ZvPhzG4Wa6dK45iReABO0EvA5+2afp2ctnc1A=";
};

nativeCheckInputs = [
pythonImportsCheckHook
];

propagatedBuildInputs = [ plover ];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
lib,
fetchPypi,
python3Packages,
plover,
setuptools,
pytestCheckHook,
pythonImportsCheckHook,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-python-dictionary";
version = "1.1.0";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
description = "Add support for Python dictionaries to Plover.";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "plover_python_dictionary";
inherit version;
hash = "sha256-YlHTmMtKWUadObGbsrsF+PUspCB4Kr+amy57DQ4eCQs=";
};

nativeCheckInputs = [
pytestCheckHook
pythonImportsCheckHook
];

propagatedBuildInputs = [ plover ];
}
34 changes: 34 additions & 0 deletions pkgs/development/python-modules/plover-stitching/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
lib,
fetchPypi,
python3Packages,
plover,
setuptools,
pythonImportsCheckHook,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-stitching";
version = "0.1.0";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
description = "Write stitched words like T-H-I-S or define stitched sequences like heh-heh-heh";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "plover_stitching";
inherit version;
hash = "sha256-08wsVTf89kKattOM0Uj/R/heW9zSX7JQBcza8aJJwxc=";
};

# pytestCheckHook disabled because tests rely on an old Plover
# testing API
nativeCheckInputs = [
pythonImportsCheckHook
];

propagatedBuildInputs = [ plover ];
}
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/plover-stroke/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
lib,
fetchPypi,
python3Packages,
setuptools,
}:
python3Packages.buildPythonPackage rec {
pname = "plover-stroke";
version = "1.1.0";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
description = "Helper class for working with steno strokes";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "plover_stroke";
inherit version;
hash = "sha256-3gOyP0ruZrZfaffU7MQjNoG0NUFQLYa/FP3inqpy0VM=";
};
}
80 changes: 80 additions & 0 deletions pkgs/development/python-modules/plover/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
stdenv,
lib,
fetchFromGitHub,
python3Packages,
wmctrl,
buildPythonPackage,
pytest,
mock,
babel,
pyqt5,
xlib,
pyserial,
appdirs,
wcwidth,
setuptools,
rtf-tokenize,
plover-stroke,
wrapQtAppsHook,
}:
let
plover = python3Packages.buildPythonPackage rec {
pname = "plover";
version = "4.0.0rc2";
pyproject = true;
build-system = [ setuptools ];

meta = with lib; {
broken = stdenv.hostPlatform.isDarwin;
description = "OpenSteno Plover stenography software";
maintainers = with maintainers; [
twey
kovirobi
];
license = licenses.gpl2;
};

src = fetchFromGitHub {
owner = "openstenoproject";
repo = pname;
rev = "v${version}";
sha256 = "sha256-rmMec/BbvOJ92u8Tmp3Kv2YezzJxB/L8UrDntTDSKj4=";
};

# 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
];
nativeBuildInputs = [ wrapQtAppsHook ];
propagatedBuildInputs = [
babel
pyqt5
xlib
pyserial
appdirs
wcwidth
setuptools
rtf-tokenize
plover-stroke
];

preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
};

plugins = lib.attrsets.mapAttrs' (name: value: {
name = builtins.substring 7 (builtins.stringLength name) name;
inherit value;
}) (lib.attrsets.filterAttrs (k: v: lib.strings.hasPrefix "plover-" k) python3Packages);
in
plover
// {
inherit plugins;
withPlugins = ps: python3Packages.python.withPackages (_: ps plugins);
}
21 changes: 21 additions & 0 deletions pkgs/development/python-modules/rtf-tokenize/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
lib,
fetchPypi,
python3Packages,
}:
python3Packages.buildPythonPackage rec {
pname = "rtf-tokenize";
version = "1.0.0";

meta = with lib; {
description = "A simple RTF tokenizer";
maintainers = with maintainers; [ twey ];
license = licenses.gpl2Plus;
};

src = fetchPypi {
pname = "rtf_tokenize";
inherit version;
hash = "sha256-XD3zkNAEeb12N8gjv81v37Id3RuWroFUY95+HtOS1gg=";
};
}
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31986,7 +31986,7 @@ with pkgs;

plex-mpv-shim = python3Packages.callPackage ../applications/video/plex-mpv-shim { };

plover = recurseIntoAttrs (libsForQt5.callPackage ../applications/misc/plover { });
plover = python3Packages.plover;
Twey marked this conversation as resolved.
Show resolved Hide resolved

plugdata = callPackage ../applications/audio/plugdata { };

Expand Down
Loading