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