Something went wrong. Try again.
lol
Something went wrong. Try again.
1.6 kB · 77 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778{ lib, setuptools, aiohttp, buildPythonPackage, fetchFromGitHub, typing-extensions, libopus, pynacl, pytestCheckHook, pytest-asyncio, looptime, withVoice ? true, ffmpeg,}:
buildPythonPackage rec { pname = "disnake"; version = "2.11.0"; pyproject = true;
src = fetchFromGitHub { owner = "DisnakeDev"; repo = "disnake"; tag = "v${version}"; hash = "sha256-pwhUX5lzqSPik/rPsT42M3AMjzWWeqFN+0mVHA84cCo="; };
build-system = [ setuptools ];
dependencies = [ aiohttp typing-extensions ] ++ lib.optionals withVoice [ libopus pynacl ffmpeg ];
postPatch = lib.optionalString withVoice '' substituteInPlace "disnake/opus.py" \ --replace-fail 'ctypes.util.find_library("opus")' "'${libopus}/lib/libopus.so.0'" substituteInPlace "disnake/player.py" \ --replace-fail 'executable: str = "ffmpeg"' 'executable: str="${ffmpeg}/bin/ffmpeg"' '';
nativeCheckInputs = [ pytestCheckHook pytest-asyncio looptime ];
pytestFlags = [ # DeprecationWarning: There is no current event loop "-Wignore::DeprecationWarning" ];
pythonImportsCheck = [ "disnake" "disnake.file" "disnake.member" "disnake.user" "disnake.state" "disnake.guild" "disnake.webhook" "disnake.ext.commands.bot" ];
meta = { description = "API wrapper for Discord written in Python"; homepage = "https://disnake.dev/"; changelog = "https://github.com/DisnakeDev/disnake/blob/${src.tag}/docs/whats_new.rst"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ infinidoge ]; };}