1a04744f74
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
65 lines
1.4 KiB
Nix
65 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
setuptools,
|
|
aiohttp,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
libopus,
|
|
pynacl,
|
|
withVoice ? true,
|
|
ffmpeg,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "disnake";
|
|
version = "2.10.1";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "DisnakeDev";
|
|
repo = "disnake";
|
|
tag = "v${version}";
|
|
hash = "sha256-MQxYkUA3uclmY2cKBr4DsBg79ovsH1EsMOjiVPGaLVE=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
aiohttp
|
|
]
|
|
++ 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"'
|
|
'';
|
|
|
|
# Only have integration tests with discord
|
|
doCheck = false;
|
|
|
|
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/v${version}/docs/whats_new.rst";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ infinidoge ];
|
|
};
|
|
}
|