2020-04-24 23:36:52 +00:00
|
|
|
{ buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2022-09-30 11:47:45 +00:00
|
|
|
fetchpatch,
|
2020-04-24 23:36:52 +00:00
|
|
|
isPy27,
|
|
|
|
libopus,
|
|
|
|
nose,
|
2021-01-15 22:18:51 +00:00
|
|
|
lib, stdenv,
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteAll,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "opuslib";
|
|
|
|
version = "3.0.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "orion-labs";
|
2022-09-30 11:47:45 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "92109c528f9f6c550df5e5325ca0fcd4f86b0909";
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-NxmC/4TTIEDVzrfMPN4PcT1JY4QCw8IBMy80XiM/o00=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/orion-labs/opuslib/pull/22
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-variadic-functions-on-aarch64-darwin.patch";
|
|
|
|
url = "https://github.com/orion-labs/opuslib/commit/8aee916e4da4b3183d49cff5a986dc2408076d8d.patch";
|
|
|
|
hash = "sha256-oa1HCFHNS3ejzSf0jxv9NueUKOZgdCtpv+xTrjYW5os=";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
# https://github.com/orion-labs/opuslib/pull/25
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tests-when-using-libopus-1.4.patch";
|
|
|
|
url = "https://github.com/orion-labs/opuslib/commit/87a214fc98c1dcae38035e99fe8e279a160c4a52.patch";
|
|
|
|
hash = "sha256-UoOafyTFvWLY7ErtBhkXTZSgbMZFrg5DGxjbhqEI7wo=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./opuslib-paths.patch;
|
|
|
|
opusLibPath = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ nose ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python bindings to the libopus, IETF low-delay audio codec";
|
|
|
|
homepage = "https://github.com/orion-labs/opuslib";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ thelegy ];
|
|
|
|
};
|
|
|
|
}
|