2016-12-14 19:13:52 +01:00
|
|
|
{ lib
|
2018-01-29 18:45:38 +01:00
|
|
|
, fetchPypi
|
2016-12-14 19:13:52 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, withVoice ? true, libopus
|
|
|
|
, aiohttp
|
|
|
|
, websockets
|
|
|
|
, pynacl
|
|
|
|
}:
|
|
|
|
|
2018-01-29 18:45:38 +01:00
|
|
|
buildPythonPackage rec {
|
2016-12-14 19:13:52 +01:00
|
|
|
pname = "discord.py";
|
2017-10-25 20:04:35 +02:00
|
|
|
version = "0.16.12";
|
2016-12-14 19:13:52 +01:00
|
|
|
|
2018-01-29 18:45:38 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2017-10-25 20:04:35 +02:00
|
|
|
sha256 = "17fb8814100fbaf7a79468baa432184db6cef3bbea4ad194fe297c7407d50108";
|
2016-12-14 19:13:52 +01:00
|
|
|
};
|
|
|
|
|
2019-03-19 09:51:26 +01:00
|
|
|
propagatedBuildInputs = [ aiohttp websockets pynacl ];
|
2016-12-14 19:13:52 +01:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace "requirements.txt" \
|
|
|
|
--replace "aiohttp>=1.0.0,<1.1.0" "aiohttp"
|
|
|
|
'' + lib.optionalString withVoice ''
|
|
|
|
substituteInPlace "discord/opus.py" \
|
|
|
|
--replace "ctypes.util.find_library('opus')" "'${libopus}/lib/libopus.so.0'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.5";
|
|
|
|
|
2017-09-05 11:16:41 +02:00
|
|
|
# No tests in archive
|
|
|
|
doCheck = false;
|
|
|
|
|
2016-12-14 19:13:52 +01:00
|
|
|
meta = {
|
|
|
|
description = "A python wrapper for the Discord API";
|
|
|
|
homepage = "https://discordpy.rtfd.org/";
|
|
|
|
license = lib.licenses.mit;
|
2018-01-29 18:45:38 +01:00
|
|
|
|
|
|
|
# discord.py requires websockets<4.0
|
|
|
|
# See https://github.com/Rapptz/discord.py/issues/973
|
|
|
|
broken = true;
|
2016-12-14 19:13:52 +01:00
|
|
|
};
|
|
|
|
}
|