1{
2 stdenv,
3 lib,
4 fetchPypi,
5 buildPythonPackage,
6 libvorbis,
7 flac,
8 libogg,
9 libopus,
10 opusfile,
11 substituteAll,
12}:
13
14buildPythonPackage rec {
15 pname = "pyogg";
16 version = "0.6.14a1";
17
18 src = fetchPypi {
19 pname = "PyOgg";
20 inherit version;
21 hash = "sha256-gpSzSqWckCAMRjDCzEpbhEByCRQejl0GnXpb41jpQmI=";
22 };
23
24 buildInputs = [
25 libvorbis
26 flac
27 libogg
28 libopus
29 ];
30
31 propagatedBuildInputs = [
32 libvorbis
33 flac
34 libogg
35 libopus
36 opusfile
37 ];
38
39 # There are no tests in this package.
40 doCheck = false;
41
42 # patch has dos style eol
43 patchFlags = [
44 "-p1"
45 "--binary"
46 ];
47 patches = [
48 (substituteAll {
49 src = ./pyogg-paths.patch;
50 flacLibPath = "${flac.out}/lib/libFLAC${stdenv.hostPlatform.extensions.sharedLibrary}";
51 oggLibPath = "${libogg}/lib/libogg${stdenv.hostPlatform.extensions.sharedLibrary}";
52 vorbisLibPath = "${libvorbis}/lib/libvorbis${stdenv.hostPlatform.extensions.sharedLibrary}";
53 vorbisFileLibPath = "${libvorbis}/lib/libvorbisfile${stdenv.hostPlatform.extensions.sharedLibrary}";
54 vorbisEncLibPath = "${libvorbis}/lib/libvorbisenc${stdenv.hostPlatform.extensions.sharedLibrary}";
55 opusLibPath = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
56 opusFileLibPath = "${opusfile}/lib/libopusfile${stdenv.hostPlatform.extensions.sharedLibrary}";
57 })
58 ];
59
60 meta = with lib; {
61 description = "Xiph.org's Ogg Vorbis, Opus and FLAC for Python";
62 homepage = "https://github.com/Zuzu-Typ/PyOgg";
63 license = licenses.publicDomain;
64 maintainers = with maintainers; [ pmiddend ];
65 };
66}