python3Packages.opuslib-next: init at 1.3.0

Native bindings to libopus; new dependency for voip-utils.
This commit is contained in:
Martin Weinelt 2026-07-04 21:24:59 +02:00
commit c3a8d36e3f
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
3 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,13 @@
diff --git a/opuslib_next/api/__init__.py b/opuslib_next/api/__init__.py
index dc498b2..b2ded08 100644
--- a/opuslib_next/api/__init__.py
+++ b/opuslib_next/api/__init__.py
@@ -15,7 +15,7 @@ __copyright__ = "Copyright (c) 2025, Kalicyh"
__license__ = "BSD 3-Clause License"
-lib_location = find_library("opus")
+lib_location = "@libopus@"
if lib_location is None:
# find opus library in macOS

View file

@ -0,0 +1,54 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
libopus,
pytestCheckHook,
replaceVars,
stdenv,
}:
buildPythonPackage (finalAttrs: {
pname = "opuslib-next";
version = "1.3.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "kalicyh";
repo = "opuslib-next";
tag = "v${finalAttrs.version}";
hash = "sha256-rR1tsijKUBUH3bZZSISsx1JUO35TZevcTcfPtoQow/E=";
};
patches = [
(replaceVars ./ctypes.patch {
libopus = "${lib.getLib libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
build-system = [
hatchling
];
buildInputs = [
libopus
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"opuslib_next"
];
meta = {
description = "Python bindings to the libopus, IETF low-delay audio codec";
homepage = "https://github.com/kalicyh/opuslib-next";
changelog = "https://github.com/kalicyh/opuslib-next/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ hexa ];
};
})

View file

@ -12250,6 +12250,8 @@ self: super: with self; {
opuslib = callPackage ../development/python-modules/opuslib { };
opuslib-next = callPackage ../development/python-modules/opuslib-next { };
opytimark = callPackage ../development/python-modules/opytimark { };
oracledb = callPackage ../development/python-modules/oracledb { };