about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/pulseaudio-dlna/default.nix
blob: 57f99b81299e37e787793e80c184b1c91798fc26 (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
68
69
70
71
72
73
74
75
76
{ fetchFromGitHub
, lib
, python3Packages
, mp3Support ? true
, lame
, opusSupport ? true
, opusTools
, faacSupport ? false
, faac
, flacSupport ? true
, flac
, soxSupport ? true
, sox
, vorbisSupport ? true
, vorbis-tools
, pulseaudio
}:

python3Packages.buildPythonApplication {
  pname = "pulseaudio-dlna";
  version = "unstable-2021-11-09";

  src = fetchFromGitHub {
    owner = "Cygn";
    repo = "pulseaudio-dlna";
    rev = "637a2e7bba2277137c5f12fb58e63100dab7cbe6";
    sha256 = "sha256-Oda+zQQJE2D3fiNWTzxYvI8cZVHG5JAoV2Wf5Z6IU3M=";
  };

  patches = [
    ./0001-setup.py-remove-dbus-python-from-list.patch
  ];

  propagatedBuildInputs = with python3Packages; [
    dbus-python
    docopt
    requests
    setproctitle
    protobuf
    psutil
    chardet
    netifaces
    notify2
    pyroute2
    pygobject3
    pychromecast
    lxml
    setuptools
    zeroconf
  ]
  ++ lib.optional mp3Support lame
  ++ lib.optional opusSupport opusTools
  ++ lib.optional faacSupport faac
  ++ lib.optional flacSupport flac
  ++ lib.optional soxSupport sox
  ++ lib.optional vorbisSupport vorbis-tools;

  # pulseaudio-dlna shells out to pactl to configure sinks and sources.
  # As pactl might not be in $PATH, add --suffix it (so pactl configured by the
  # user get priority)
  makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ pulseaudio ]}" ];

  # upstream has no tests
  checkPhase = ''
    $out/bin/pulseaudio-dlna --help > /dev/null
  '';

  meta = with lib; {
    description = "A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux";
    mainProgram = "pulseaudio-dlna";
    homepage = "https://github.com/Cygn/pulseaudio-dlna";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ mog ];
    platforms = platforms.linux;
  };
}