1{
2 stdenv,
3 lib,
4 fetchPypi,
5 buildPythonPackage,
6 libvorbis,
7 flac,
8 libogg,
9 libopus,
10 opusfile,
11 replaceVars,
12}:
13
14buildPythonPackage rec {
15 pname = "pyogg";
16 version = "0.6.14a1";
17 format = "setuptools";
18
19 src = fetchPypi {
20 pname = "PyOgg";
21 inherit version;
22 hash = "sha256-gpSzSqWckCAMRjDCzEpbhEByCRQejl0GnXpb41jpQmI=";
23 };
24
25 buildInputs = [
26 libvorbis
27 flac
28 libogg
29 libopus
30 ];
31
32 propagatedBuildInputs = [
33 libvorbis
34 flac
35 libogg
36 libopus
37 opusfile
38 ];
39
40 # There are no tests in this package.
41 doCheck = false;
42
43 # patch has dos style eol
44 patchFlags = [
45 "-p1"
46 "--binary"
47 ];
48 patches = [
49 (replaceVars ./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}