blob: 0f86ee525000bd0dd2d83cf2a45305819452ac4f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
setuptools,
miniaudio,
cffi,
pytestCheckHook,
AudioToolbox,
CoreAudio,
}:
let
# TODO: recheck after 1.59
miniaudio' = miniaudio.overrideAttrs (oldAttrs: rec {
version = "0.11.16"; # cffi breakage with 0.11.17
src = fetchFromGitHub {
inherit (oldAttrs.src) owner repo;
rev = "refs/tags/${version}";
hash = "sha256-POe/dYPJ25RKNGIhaLoqxm9JJ08MrTyHVN4NmaGOdwM=";
};
});
in
buildPythonPackage rec {
pname = "miniaudio";
version = "1.61";
pyproject = true;
src = fetchFromGitHub {
owner = "irmen";
repo = "pyminiaudio";
rev = "refs/tags/v${version}";
hash = "sha256-H3o2IWGuMqLrJTzQ7w636Ito6f57WBtMXpXXzrZ7UD8=";
};
postPatch = ''
rm -r miniaudio
ln -s ${miniaudio'} miniaudio
substituteInPlace build_ffi_module.py \
--replace-fail "miniaudio/stb_vorbis.c" "miniaudio/extras/stb_vorbis.c";
substituteInPlace miniaudio.c \
--replace-fail "miniaudio/stb_vorbis.c" "miniaudio/extras/stb_vorbis.c";
'';
build-system = [ setuptools ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
AudioToolbox
CoreAudio
];
propagatedNativeBuildInputs = [ cffi ];
dependencies = [ cffi ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "miniaudio" ];
meta = with lib; {
changelog = "https://github.com/irmen/pyminiaudio/releases/tag/v${version}";
description = "Python bindings for the miniaudio library and its decoders";
homepage = "https://github.com/irmen/pyminiaudio";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}
|