diff --git a/pkgs/applications/misc/plover/default.nix b/pkgs/applications/misc/plover/default.nix deleted file mode 100644 index 65161d713f29a..0000000000000 --- a/pkgs/applications/misc/plover/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib, fetchFromGitHub, python3Packages, wmctrl, qtbase, mkDerivationWith }: - -{ - stable = throw "plover.stable was removed because it used Python 2. Use plover.dev instead."; # added 2022-06-05 - - dev = with python3Packages; mkDerivationWith buildPythonPackage rec { - pname = "plover"; - version = "4.0.0.dev10"; - - 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 = "plover"; - rev = "v${version}"; - sha256 = "sha256-oJ7+R3ZWhUbNTTAw1AfMg2ur8vW1XEbsa5FgSTam1Ns="; - }; - - # 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[@]}") - ''; - }; -} diff --git a/pkgs/development/python-modules/plover-last-translation/default.nix b/pkgs/development/python-modules/plover-last-translation/default.nix new file mode 100644 index 0000000000000..becd0a96797b3 --- /dev/null +++ b/pkgs/development/python-modules/plover-last-translation/default.nix @@ -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 ]; +} 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..82afe67d877df --- /dev/null +++ b/pkgs/development/python-modules/plover-stroke/default.nix @@ -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="; + }; +} diff --git a/pkgs/development/python-modules/plover/default.nix b/pkgs/development/python-modules/plover/default.nix new file mode 100644 index 0000000000000..04993476eda91 --- /dev/null +++ b/pkgs/development/python-modules/plover/default.nix @@ -0,0 +1,80 @@ +{ + stdenv, + lib, + fetchFromGitHub, + wmctrl, + python3Packages, + 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); +} 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..fa002c4a9e94c --- /dev/null +++ b/pkgs/development/python-modules/rtf-tokenize/default.nix @@ -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="; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 89f44b0675e72..aac405384dcca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; plugdata = callPackage ../applications/audio/plugdata { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1e667c9a029ec..0a784d2819332 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9892,6 +9892,14 @@ self: super: with self; { pkg-about = callPackage ../development/python-modules/pkg-about { }; + plover = callPackage ../development/python-modules/plover { + inherit (pkgs.libsForQt5) wrapQtAppsHook; + }; + + plover-last-translation = callPackage ../development/python-modules/plover-last-translation { }; + + plover-stroke = callPackage ../development/python-modules/plover-stroke { }; + micloud = callPackage ../development/python-modules/micloud { }; mqtt2influxdb = callPackage ../development/python-modules/mqtt2influxdb { }; @@ -13837,6 +13845,8 @@ self: super: with self; { rstr = callPackage ../development/python-modules/rstr { }; + rtf-tokenize = callPackage ../development/python-modules/rtf-tokenize { }; + rtmidi-python = callPackage ../development/python-modules/rtmidi-python { inherit (pkgs.darwin.apple_sdk.frameworks) CoreAudio CoreMIDI CoreServices; };