mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-28 03:04:41 +00:00
On darwin, it fails to install because: > - pyobjc not installed > - py-applescript not installed These are not packaged in nixpkgs. Until someone shows up to do the work, let's mark the package as linux only.
86 lines
1.9 KiB
Nix
86 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
decorator,
|
|
fetchFromGitHub,
|
|
json-rpc,
|
|
kaldi-active-grammar,
|
|
lark,
|
|
packaging,
|
|
psutil,
|
|
pynput,
|
|
pyperclip,
|
|
regex,
|
|
requests,
|
|
setuptools,
|
|
six,
|
|
sounddevice,
|
|
webrtcvad,
|
|
werkzeug,
|
|
wmctrl,
|
|
xdotool,
|
|
xprop,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "dragonfly";
|
|
version = "0.35.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "dictation-toolbox";
|
|
repo = "dragonfly";
|
|
tag = version;
|
|
hash = "sha256-sqEEEr5/KG3cn4rmOGJt9zMNAjeLO6h3NJgg0EyewrM=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace dragonfly/actions/keyboard/_x11_xdotool.py \
|
|
--replace-fail 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"'
|
|
substituteInPlace dragonfly/windows/x11_window.py \
|
|
--replace-fail 'xdotool = "xdotool"'${" "}'xdotool = "${xdotool}/bin/xdotool"' \
|
|
--replace-fail 'xprop = "xprop"'${" "}'xprop = "${xprop}/bin/xprop"' \
|
|
--replace-fail 'wmctrl = "wmctrl"'${" "}'wmctrl = "${wmctrl}/bin/wmctrl"'
|
|
'';
|
|
|
|
pythonRemoveDeps = [ "lark-parser" ];
|
|
|
|
propagatedBuildInputs = [
|
|
decorator
|
|
json-rpc
|
|
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;
|
|
|
|
pythonImportsCheck = [ "dragonfly" ];
|
|
|
|
meta = {
|
|
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 = lib.licenses.lgpl3Plus;
|
|
platforms = lib.platforms.linux;
|
|
maintainers = [ ];
|
|
};
|
|
}
|