2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
decorator,
|
|
|
|
packaging,
|
|
|
|
pynput,
|
|
|
|
regex,
|
|
|
|
lark,
|
|
|
|
enum34,
|
|
|
|
pyperclip,
|
|
|
|
six,
|
|
|
|
requests,
|
|
|
|
psutil,
|
|
|
|
json-rpc,
|
|
|
|
werkzeug,
|
|
|
|
kaldi-active-grammar,
|
|
|
|
sounddevice,
|
|
|
|
webrtcvad,
|
|
|
|
setuptools,
|
|
|
|
xdotool,
|
|
|
|
wmctrl,
|
|
|
|
xorg,
|
2021-10-17 02:12:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dragonfly";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "0.35.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-10-17 02:12:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dictation-toolbox";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-sqEEEr5/KG3cn4rmOGJt9zMNAjeLO6h3NJgg0EyewrM=";
|
2021-10-17 02:12:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-02-10 20:34:41 +00:00
|
|
|
substituteInPlace setup.py --replace 'lark-parser == 0.8.*' 'lark'
|
2021-10-17 02:12:59 +00:00
|
|
|
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
|
2022-02-10 20:34:41 +00:00
|
|
|
lark
|
2021-10-17 02:12:59 +00:00
|
|
|
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;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2021-10-17 02:12:59 +00:00
|
|
|
};
|
|
|
|
}
|