Skip to content

Commit a60cefa

Browse files
committed
disnake: init at 2.10.1
1 parent 20d2e6d commit a60cefa

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
lib,
3+
setuptools,
4+
aiohttp,
5+
buildPythonPackage,
6+
fetchFromGitHub,
7+
libopus,
8+
pynacl,
9+
pythonOlder,
10+
withVoice ? true,
11+
ffmpeg,
12+
}:
13+
14+
buildPythonPackage rec {
15+
pname = "disnake";
16+
version = "2.10.1";
17+
pyproject = true;
18+
19+
disabled = pythonOlder "3.8";
20+
21+
src = fetchFromGitHub {
22+
owner = "DisnakeDev";
23+
repo = "disnake";
24+
tag = "v${version}";
25+
hash = "sha256-MQxYkUA3uclmY2cKBr4DsBg79ovsH1EsMOjiVPGaLVE=";
26+
};
27+
28+
build-system = [ setuptools ];
29+
30+
dependencies =
31+
[
32+
aiohttp
33+
]
34+
++ lib.optionals withVoice [
35+
libopus
36+
pynacl
37+
ffmpeg
38+
];
39+
40+
postPatch = lib.optionalString withVoice ''
41+
substituteInPlace "disnake/opus.py" \
42+
--replace-fail 'ctypes.util.find_library("opus")' "'${libopus}/lib/libopus.so.0'"
43+
substituteInPlace "disnake/player.py" \
44+
--replace-fail 'executable: str = "ffmpeg"' 'executable: str="${ffmpeg}/bin/ffmpeg"'
45+
'';
46+
47+
# Only have integration tests with discord
48+
doCheck = false;
49+
50+
pythonImportsCheck = [
51+
"disnake"
52+
"disnake.file"
53+
"disnake.member"
54+
"disnake.user"
55+
"disnake.state"
56+
"disnake.guild"
57+
"disnake.webhook"
58+
"disnake.ext.commands.bot"
59+
];
60+
61+
meta = {
62+
description = "API wrapper for Discord written in Python";
63+
homepage = "https://disnake.dev/";
64+
changelog = "https://github.com/DisnakeDev/disnake/blob/v${version}/docs/whats_new.rst";
65+
license = lib.licenses.mit;
66+
maintainers = with lib.maintainers; [ infinidoge ];
67+
};
68+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,8 @@ self: super: with self; {
32933293

32943294
diskcache = callPackage ../development/python-modules/diskcache { };
32953295

3296+
disnake = callPackage ../development/python-modules/disnake { };
3297+
32963298
dissect = callPackage ../development/python-modules/dissect { };
32973299

32983300
dissect-archive = callPackage ../development/python-modules/dissect-archive { };

0 commit comments

Comments
 (0)