blade-formatter: 1.42.0 -> 1.42.1 (#376873)
[NixPkgs.git] / pkgs / development / python-modules / opuslib / default.nix
blob4f7c86d2a4816638f43a69cb151a4c3835d09ef6
2   buildPythonPackage,
3   fetchFromGitHub,
4   fetchpatch,
5   isPy27,
6   libopus,
7   pytestCheckHook,
8   lib,
9   stdenv,
10   substituteAll,
11   setuptools,
14 buildPythonPackage rec {
15   pname = "opuslib";
16   version = "3.0.3";
17   pyproject = true;
19   disabled = isPy27;
21   src = fetchFromGitHub {
22     owner = "orion-labs";
23     repo = pname;
24     rev = "92109c528f9f6c550df5e5325ca0fcd4f86b0909";
25     hash = "sha256-NxmC/4TTIEDVzrfMPN4PcT1JY4QCw8IBMy80XiM/o00=";
26   };
28   patches = [
29     # https://github.com/orion-labs/opuslib/pull/22
30     (fetchpatch {
31       name = "fix-variadic-functions-on-aarch64-darwin.patch";
32       url = "https://github.com/orion-labs/opuslib/commit/8aee916e4da4b3183d49cff5a986dc2408076d8d.patch";
33       hash = "sha256-oa1HCFHNS3ejzSf0jxv9NueUKOZgdCtpv+xTrjYW5os=";
34     })
35     # https://github.com/orion-labs/opuslib/pull/25
36     (fetchpatch {
37       name = "fix-tests-when-using-libopus-1.4.patch";
38       url = "https://github.com/orion-labs/opuslib/commit/87a214fc98c1dcae38035e99fe8e279a160c4a52.patch";
39       hash = "sha256-UoOafyTFvWLY7ErtBhkXTZSgbMZFrg5DGxjbhqEI7wo=";
40     })
41     (substituteAll {
42       src = ./opuslib-paths.patch;
43       opusLibPath = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
44     })
45   ];
47   build-system = [ setuptools ];
49   nativeCheckInputs = [ pytestCheckHook ];
51   pytestFlagsArray = [
52     "tests/{decoder,encoder,hl_decoder,hl_encoder}.py"
53   ];
55   meta = with lib; {
56     description = "Python bindings to the libopus, IETF low-delay audio codec";
57     homepage = "https://github.com/orion-labs/opuslib";
58     license = licenses.bsd3;
59     platforms = platforms.all;
60     maintainers = with maintainers; [ thelegy ];
61   };