push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
{
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 = with lib; {
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 = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@@ -0,0 +1,74 @@
diff --git a/nextcord/opus.py b/nextcord/opus.py
index b1119a8e..b7c9c713 100644
--- a/nextcord/opus.py
+++ b/nextcord/opus.py
@@ -233,7 +233,7 @@ def _load_default() -> bool:
_filename = os.path.join(_basedir, "bin", f"libopus-0.{_target}.dll")
_lib = libopus_loader(_filename)
else:
- opus = ctypes.util.find_library("opus")
+ opus = "@libopus@"
if opus is None:
_lib = None
diff --git a/nextcord/player.py b/nextcord/player.py
index 5c7daf52..48a11eb7 100644
--- a/nextcord/player.py
+++ b/nextcord/player.py
@@ -127,7 +127,7 @@ class FFmpegAudio(AudioSource):
self,
source: Union[str, io.BufferedIOBase],
*,
- executable: str = "ffmpeg",
+ executable: str = "@ffmpeg@",
args: Any,
**subprocess_kwargs: Any,
) -> None:
@@ -254,7 +254,7 @@ class FFmpegPCMAudio(FFmpegAudio):
self,
source: Union[str, io.BufferedIOBase],
*,
- executable: str = "ffmpeg",
+ executable: str = "@ffmpeg@",
pipe: bool = False,
stderr: Optional[IO[str]] = None,
before_options: Optional[str] = None,
@@ -357,7 +357,7 @@ class FFmpegOpusAudio(FFmpegAudio):
*,
bitrate: int = 128,
codec: Optional[str] = None,
- executable: str = "ffmpeg",
+ executable: str = "@ffmpeg@",
pipe: bool = False,
stderr=None,
before_options=None,
@@ -510,7 +510,7 @@ class FFmpegOpusAudio(FFmpegAudio):
"""
method = method or "native"
- executable = executable or "ffmpeg"
+ executable = executable or "@ffmpeg@"
probefunc = fallback = None
if isinstance(method, str):
@@ -555,9 +555,9 @@ class FFmpegOpusAudio(FFmpegAudio):
@staticmethod
def _probe_codec_native(
- source, executable: str = "ffmpeg"
+ source, executable: str = "@ffmpeg@"
) -> Tuple[Optional[str], Optional[int]]:
- exe = executable[:2] + "probe" if executable in ("ffmpeg", "avconv") else executable
+ exe = executable[:-4] + "probe" if executable.endswith(("ffmpeg", "avconv")) else executable
args = [
exe,
"-v",
@@ -584,7 +584,7 @@ class FFmpegOpusAudio(FFmpegAudio):
@staticmethod
def _probe_codec_fallback(
- source, executable: str = "ffmpeg"
+ source, executable: str = "@ffmpeg@"
) -> Tuple[Optional[str], Optional[int]]:
args = [executable, "-hide_banner", "-i", source]
proc = subprocess.Popen(