1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchFromGitHub
6, substituteAll
7, ffmpeg
8, libopus
9, aiohttp
10, aiodns
11, brotli
12, cchardet
13, orjson
14, pynacl
15}:
16
17buildPythonPackage rec {
18 pname = "nextcord";
19 version = "2.3.2";
20
21 format = "setuptools";
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "nextcord";
27 repo = "nextcord";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-ZflCOTqNhalBhxDkee3UwusiVA+ShtfabP0slE28/UQ=";
30 };
31
32 patches = [
33 (substituteAll {
34 src = ./paths.patch;
35 ffmpeg = "${ffmpeg}/bin/ffmpeg";
36 libopus = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
37 })
38 ];
39
40 propagatedBuildInputs = [
41 aiodns
42 aiohttp
43 brotli
44 cchardet
45 orjson
46 pynacl
47 ];
48
49 # upstream has no tests
50 doCheck = false;
51
52 pythonImportsCheck = [
53 "nextcord"
54 "nextcord.ext.commands"
55 "nextcord.ext.tasks"
56 ];
57
58 meta = with lib; {
59 description = "Python wrapper for the Discord API forked from discord.py";
60 homepage = "https://github.com/nextcord/nextcord";
61 license = licenses.mit;
62 maintainers = with maintainers; [ dotlambda ];
63 };
64}