python312Packages.dragonfly: refactor
This commit is contained in:
@@ -1,69 +1,76 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
decorator,
|
||||
packaging,
|
||||
pynput,
|
||||
regex,
|
||||
lark,
|
||||
enum34,
|
||||
pyperclip,
|
||||
six,
|
||||
requests,
|
||||
psutil,
|
||||
fetchFromGitHub,
|
||||
json-rpc,
|
||||
werkzeug,
|
||||
kaldi-active-grammar,
|
||||
lark,
|
||||
packaging,
|
||||
psutil,
|
||||
pynput,
|
||||
pyperclip,
|
||||
pythonOlder,
|
||||
regex,
|
||||
requests,
|
||||
setuptools,
|
||||
six,
|
||||
sounddevice,
|
||||
webrtcvad,
|
||||
setuptools,
|
||||
xdotool,
|
||||
werkzeug,
|
||||
wmctrl,
|
||||
xdotool,
|
||||
xorg,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "dragonfly";
|
||||
version = "0.35.0";
|
||||
format = "setuptools";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dictation-toolbox";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
repo = "dragonfly";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-sqEEEr5/KG3cn4rmOGJt9zMNAjeLO6h3NJgg0EyewrM=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py --replace 'lark-parser == 0.8.*' 'lark'
|
||||
substituteInPlace dragonfly/actions/keyboard/_x11_xdotool.py \
|
||||
--replace 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"'
|
||||
--replace-fail '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"'
|
||||
--replace-fail 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"' \
|
||||
--replace-fail 'xprop = "xprop"'${" "}'xprop = "${xorg.xprop}/bin/xprop"' \
|
||||
--replace-fail 'wmctrl = "wmctrl"'${" "}'wmctrl = "${wmctrl}/bin/wmctrl"'
|
||||
'';
|
||||
|
||||
pythonRemoveDeps = [ "lark-parser" ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
decorator
|
||||
packaging
|
||||
pynput
|
||||
regex
|
||||
lark
|
||||
enum34
|
||||
pyperclip
|
||||
six
|
||||
requests
|
||||
psutil
|
||||
json-rpc
|
||||
werkzeug
|
||||
kaldi-active-grammar # for the Kaldi engine
|
||||
sounddevice
|
||||
webrtcvad
|
||||
lark
|
||||
packaging
|
||||
psutil
|
||||
pynput
|
||||
pyperclip
|
||||
regex
|
||||
requests
|
||||
setuptools # needs pkg_resources at runtime
|
||||
six
|
||||
werkzeug
|
||||
];
|
||||
|
||||
optional-dependencies = {
|
||||
kaldi = [
|
||||
kaldi-active-grammar
|
||||
sounddevice
|
||||
webrtcvad
|
||||
];
|
||||
};
|
||||
|
||||
# Too many tests fail because of the unusual environment or
|
||||
# because of the missing dependencies for some of the engines.
|
||||
doCheck = false;
|
||||
@@ -73,6 +80,7 @@ buildPythonPackage rec {
|
||||
meta = with lib; {
|
||||
description = "Speech recognition framework allowing powerful Python-based scripting";
|
||||
homepage = "https://github.com/dictation-toolbox/dragonfly";
|
||||
changelog = "https://github.com/dictation-toolbox/dragonfly/blob/${version}/CHANGELOG.rst";
|
||||
license = licenses.lgpl3Plus;
|
||||
maintainers = [ ];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user