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