From b99f465bd353002858cf6678f3cc6ddc9c47f288 Mon Sep 17 00:00:00 2001 From: Tristan Gosselin-Hane Date: Mon, 6 Dec 2021 22:59:44 -0500 Subject: [PATCH] python3Packages.discordpy: patch ffmpeg usage Update pkgs/development/python-modules/discordpy/default.nix Co-authored-by: Jonathan Ringer --- pkgs/development/python-modules/discordpy/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/discordpy/default.nix b/pkgs/development/python-modules/discordpy/default.nix index 7dfd6e071fe0..aa88147ae7fd 100644 --- a/pkgs/development/python-modules/discordpy/default.nix +++ b/pkgs/development/python-modules/discordpy/default.nix @@ -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