summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyogg/default.nix
blob: 8a3d2d33fd97dcf2d86d6f1c37d272585524f80a (plain)
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
{
  stdenv,
  lib,
  fetchPypi,
  buildPythonPackage,
  libvorbis,
  flac,
  libogg,
  libopus,
  opusfile,
  replaceVars,
}:

buildPythonPackage rec {
  pname = "pyogg";
  version = "0.6.14a1";
  format = "setuptools";

  src = fetchPypi {
    pname = "PyOgg";
    inherit version;
    hash = "sha256-gpSzSqWckCAMRjDCzEpbhEByCRQejl0GnXpb41jpQmI=";
  };

  buildInputs = [
    libvorbis
    flac
    libogg
    libopus
  ];

  propagatedBuildInputs = [
    libvorbis
    flac
    libogg
    libopus
    opusfile
  ];

  # There are no tests in this package.
  doCheck = false;

  # patch has dos style eol
  patchFlags = [
    "-p1"
    "--binary"
  ];
  patches = [
    (replaceVars ./pyogg-paths.patch {
      flacLibPath = "${flac.out}/lib/libFLAC${stdenv.hostPlatform.extensions.sharedLibrary}";
      oggLibPath = "${libogg}/lib/libogg${stdenv.hostPlatform.extensions.sharedLibrary}";
      vorbisLibPath = "${libvorbis}/lib/libvorbis${stdenv.hostPlatform.extensions.sharedLibrary}";
      vorbisFileLibPath = "${libvorbis}/lib/libvorbisfile${stdenv.hostPlatform.extensions.sharedLibrary}";
      vorbisEncLibPath = "${libvorbis}/lib/libvorbisenc${stdenv.hostPlatform.extensions.sharedLibrary}";
      opusLibPath = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}";
      opusFileLibPath = "${opusfile}/lib/libopusfile${stdenv.hostPlatform.extensions.sharedLibrary}";
    })
  ];

  meta = {
    description = "Xiph.org's Ogg Vorbis, Opus and FLAC for Python";
    homepage = "https://github.com/Zuzu-Typ/PyOgg";
    license = lib.licenses.publicDomain;
    maintainers = with lib.maintainers; [ pmiddend ];
  };
}