Files
nixpkgs/pkgs/development/python-modules/nextcord/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

84 lines
1.6 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
pythonAtLeast,
pythonOlder,
fetchFromGitHub,
replaceVars,
ffmpeg,
libopus,
aiohttp,
aiodns,
audioop-lts,
brotli,
orjson,
poetry-core,
poetry-dynamic-versioning,
pynacl,
typing-extensions,
}:
buildPythonPackage rec {
pname = "nextcord";
version = "3.1.1";
pyproject = true;
disabled = pythonOlder "3.12";
src = fetchFromGitHub {
owner = "nextcord";
repo = "nextcord";
tag = "v${version}";
hash = "sha256-ex6amnB51Jla5ia2HVaMOZsDOEtgJ8RB1eNTLpXNzSY=";
};
patches = [
(replaceVars ./paths.patch {
ffmpeg = "${ffmpeg}/bin/ffmpeg";
libopus = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
postPatch = ''
# disable dynamic versioning
substituteInPlace pyproject.toml \
--replace-fail 'version = "0.0.0"' 'version = "${version}"' \
--replace-fail 'enable = true' 'enable = false'
'';
build-system = [
poetry-core
poetry-dynamic-versioning
];
dependencies = [
aiodns
aiohttp
brotli
orjson
pynacl
typing-extensions
]
++ lib.optionals (pythonAtLeast "3.13") [
audioop-lts
];
# upstream has no tests
doCheck = false;
pythonImportsCheck = [
"nextcord"
"nextcord.ext.commands"
"nextcord.ext.tasks"
];
meta = {
changelog = "https://github.com/nextcord/nextcord/blob/${src.tag}/docs/whats_new.rst";
description = "Python wrapper for the Discord API forked from discord.py";
homepage = "https://github.com/nextcord/nextcord";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ];
};
}