about summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2016-12-14 22:05:44 +0100
committerGitHub <noreply@github.com>2016-12-14 22:05:44 +0100
commitf412c8739040e40c89667f1853a34af36550e38c (patch)
tree07ba1b639b6e17cc81df176c4489ece0a10cd6e2 /pkgs/development/python-modules
parent4b33b2b9b2f32638fcb4eba6f9e1cc6aa81ba8d3 (diff)
parent0f97f71525f9158e6464a9b727a1b6472ee69006 (diff)
downloadnixlib-f412c8739040e40c89667f1853a34af36550e38c.tar
nixlib-f412c8739040e40c89667f1853a34af36550e38c.tar.gz
nixlib-f412c8739040e40c89667f1853a34af36550e38c.tar.bz2
nixlib-f412c8739040e40c89667f1853a34af36550e38c.tar.lz
nixlib-f412c8739040e40c89667f1853a34af36550e38c.tar.xz
nixlib-f412c8739040e40c89667f1853a34af36550e38c.tar.zst
nixlib-f412c8739040e40c89667f1853a34af36550e38c.zip
Merge pull request #21076 from schneefux/pkg.discordpy
pythonPackages.discordpy: init at 0.15.1
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/discordpy/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/discordpy/default.nix b/pkgs/development/python-modules/discordpy/default.nix
new file mode 100644
index 000000000000..cf01ec835a7d
--- /dev/null
+++ b/pkgs/development/python-modules/discordpy/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, fetchurl
+, buildPythonPackage
+, pythonOlder
+, withVoice ? true, libopus
+, asyncio
+, aiohttp
+, websockets
+, pynacl
+}:
+
+let
+  pname = "discord.py";
+  version = "0.15.1";
+in buildPythonPackage rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
+    sha256 = "01lgidvnwwva1i65853gaplamllym2nsk0jis2r6f1rzbamgk1yj";
+  };
+
+  propagatedBuildInputs = [ asyncio aiohttp websockets pynacl ];
+  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";
+
+  meta = {
+    description = "A python wrapper for the Discord API";
+    homepage    = "https://discordpy.rtfd.org/";
+    license     = lib.licenses.mit;
+  };
+}