python3Packages.discordpy: patch ffmpeg usage

Update pkgs/development/python-modules/discordpy/default.nix

Co-authored-by: Jonathan Ringer <jonringer@users.noreply.github.com>
This commit is contained in:
Tristan Gosselin-Hane 2021-12-06 22:59:44 -05:00 committed by Jonathan Ringer
parent f276ef7519
commit b99f465bd3

View File

@ -6,6 +6,7 @@
, pynacl
, pythonOlder
, withVoice ? true
, ffmpeg
}:
buildPythonPackage rec {
@ -24,9 +25,10 @@ buildPythonPackage rec {
propagatedBuildInputs = [
aiohttp
] ++ lib.optionalString withVoice [
] ++ lib.optionals withVoice [
libopus
pynacl
ffmpeg
];
patchPhase = ''
@ -34,6 +36,9 @@ buildPythonPackage rec {
--replace "ctypes.util.find_library('opus')" "'${libopus}/lib/libopus.so.0'"
substituteInPlace requirements.txt \
--replace "aiohttp>=3.6.0,<3.8.0" "aiohttp>=3.6.0,<4"
'' + lib.optionalString withVoice ''
substituteInPlace "discord/player.py" \
--replace "executable='ffmpeg'" "executable='${ffmpeg}/bin/ffmpeg'"
'';
# Only have integration tests with discord