From 7f61f9720de6529a54bf41560d8606959efc89ff Mon Sep 17 00:00:00 2001 From: ckie Date: Mon, 26 Jul 2021 01:57:11 +0300 Subject: [PATCH] dragonfly: init at 0.32.0 Co-authored-by: Sandro --- .../python-modules/dragonfly/default.nix | 77 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/development/python-modules/dragonfly/default.nix diff --git a/pkgs/development/python-modules/dragonfly/default.nix b/pkgs/development/python-modules/dragonfly/default.nix new file mode 100644 index 000000000000..fb3feaae63ee --- /dev/null +++ b/pkgs/development/python-modules/dragonfly/default.nix @@ -0,0 +1,77 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, decorator +, packaging +, pynput +, regex +, lark-parser +, enum34 +, pyperclip +, six +, requests +, psutil +, json-rpc +, werkzeug +, kaldi-active-grammar +, sounddevice +, webrtcvad +, setuptools +, xdotool +, wmctrl +, xorg +}: + +buildPythonPackage rec { + pname = "dragonfly"; + version = "0.32.0"; + + src = fetchFromGitHub { + owner = "dictation-toolbox"; + repo = pname; + rev = version; + sha256 = "BUbIhc8as/DVx8/4VeQS9emOLGcWFujNCxesSEEBqKQ="; + }; + + postPatch = '' + substituteInPlace setup.py --replace 'lark-parser == 0.8.*' 'lark-parser' + substituteInPlace dragonfly/actions/keyboard/_x11_xdotool.py \ + --replace 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"' + substituteInPlace dragonfly/windows/x11_window.py \ + --replace 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"' \ + --replace 'xprop = "xprop"'${" "}'xprop = "${xorg.xprop}/bin/xprop"' \ + --replace 'wmctrl = "wmctrl"'${" "}'wmctrl = "${wmctrl}/bin/wmctrl"' + ''; + + propagatedBuildInputs = [ + decorator + packaging + pynput + regex + lark-parser + enum34 + pyperclip + six + requests + psutil + json-rpc + werkzeug + kaldi-active-grammar # for the Kaldi engine + sounddevice + webrtcvad + setuptools # needs pkg_resources at runtime + ]; + + # Too many tests fail because of the unusual environment or + # because of the missing dependencies for some of the engines. + doCheck = false; + + pythonImportsCheck = [ "dragonfly" ]; + + meta = with lib; { + description = "Speech recognition framework allowing powerful Python-based scripting"; + homepage = "https://github.com/dictation-toolbox/dragonfly"; + license = licenses.lgpl3Plus; + maintainers = with maintainers; [ ckie ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d11d765c1ba6..5c2483924deb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2174,6 +2174,8 @@ in { dpkt = callPackage ../development/python-modules/dpkt { }; + dragonfly = callPackage ../development/python-modules/dragonfly { }; + drf-jwt = callPackage ../development/python-modules/drf-jwt { }; drf-nested-routers = callPackage ../development/python-modules/drf-nested-routers { };