From 467aead38e5092f9550a0c84dde43af4e792043b Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 21 Nov 2021 19:31:42 +0100 Subject: [PATCH 1/3] pulseaudio-dlna: unstable-2017-11-01 -> unstable-2021-11-09 This moves pulseaudio-dlna to a more recent fork, which works with Python 3. --- ...etup.py-remove-dbus-python-from-list.patch | 25 +++++++ .../audio/pulseaudio-dlna/default.nix | 74 ++++++++++++------- 2 files changed, 73 insertions(+), 26 deletions(-) create mode 100644 pkgs/applications/audio/pulseaudio-dlna/0001-setup.py-remove-dbus-python-from-list.patch diff --git a/pkgs/applications/audio/pulseaudio-dlna/0001-setup.py-remove-dbus-python-from-list.patch b/pkgs/applications/audio/pulseaudio-dlna/0001-setup.py-remove-dbus-python-from-list.patch new file mode 100644 index 000000000000..2f38386f96c0 --- /dev/null +++ b/pkgs/applications/audio/pulseaudio-dlna/0001-setup.py-remove-dbus-python-from-list.patch @@ -0,0 +1,25 @@ +From a4bf7df795146c843696daee8c02826ba0034298 Mon Sep 17 00:00:00 2001 +From: Florian Klink +Date: Sun, 21 Nov 2021 12:04:48 +0100 +Subject: [PATCH] setup.py: remove dbus-python from list + +I wasn't able to convince setuptools to find this. +--- + setup.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 61d6831..013fff3 100644 +--- a/setup.py ++++ b/setup.py +@@ -42,7 +42,6 @@ setuptools.setup( + install_requires=[ + 'docopt', + 'chardet', +- 'dbus-python', + 'docopt', + 'requests', + 'setproctitle', +-- +2.33.1 + diff --git a/pkgs/applications/audio/pulseaudio-dlna/default.nix b/pkgs/applications/audio/pulseaudio-dlna/default.nix index 83de192c6b31..11c1fd081fd4 100644 --- a/pkgs/applications/audio/pulseaudio-dlna/default.nix +++ b/pkgs/applications/audio/pulseaudio-dlna/default.nix @@ -1,10 +1,18 @@ -{ fetchFromGitHub, lib, pythonPackages -, mp3Support ? true, lame ? null -, opusSupport ? true, opusTools ? null -, faacSupport ? false, faac ? null -, flacSupport ? true, flac ? null -, soxSupport ? true, sox ? null -, vorbisSupport ? true, vorbis-tools ? null +{ fetchFromGitHub +, lib +, python3Packages +, mp3Support ? true +, lame ? null +, opusSupport ? true +, opusTools ? null +, faacSupport ? false +, faac ? null +, flacSupport ? true +, flac ? null +, soxSupport ? true +, sox ? null +, vorbisSupport ? true +, vorbis-tools ? null }: assert mp3Support -> lame != null; @@ -14,30 +22,44 @@ assert flacSupport -> flac != null; assert soxSupport -> sox != null; assert vorbisSupport -> vorbis-tools != null; -let - zeroconf = pythonPackages.callPackage ./zeroconf.nix { }; -in -pythonPackages.buildPythonApplication { +python3Packages.buildPythonApplication { pname = "pulseaudio-dlna"; - version = "unstable-2017-11-01"; + version = "unstable-2021-11-09"; src = fetchFromGitHub { - owner = "masmu"; + owner = "Cygn"; repo = "pulseaudio-dlna"; - rev = "4472928dd23f274193f14289f59daec411023ab0"; - sha256 = "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"; + rev = "637a2e7bba2277137c5f12fb58e63100dab7cbe6"; + sha256 = "sha256-Oda+zQQJE2D3fiNWTzxYvI8cZVHG5JAoV2Wf5Z6IU3M="; }; - propagatedBuildInputs = with pythonPackages; [ - dbus-python docopt requests setproctitle protobuf psutil futures - chardet notify2 netifaces pyroute2 pygobject2 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; + 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; # upstream has no tests checkPhase = '' @@ -46,7 +68,7 @@ pythonPackages.buildPythonApplication { meta = with lib; { description = "A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux"; - homepage = "https://github.com/masmu/pulseaudio-dlna"; + homepage = "https://github.com/Cygn/pulseaudio-dlna"; license = licenses.gpl3Plus; maintainers = with maintainers; [ mog ]; platforms = platforms.linux; From b1204359faf82a68465ba285f8d40dffd671241e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 26 Nov 2021 13:22:20 +0100 Subject: [PATCH 2/3] pulseaudio-dlna: minor cleanups --- .../audio/pulseaudio-dlna/default.nix | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/audio/pulseaudio-dlna/default.nix b/pkgs/applications/audio/pulseaudio-dlna/default.nix index 11c1fd081fd4..98803b32ec9f 100644 --- a/pkgs/applications/audio/pulseaudio-dlna/default.nix +++ b/pkgs/applications/audio/pulseaudio-dlna/default.nix @@ -2,26 +2,19 @@ , lib , python3Packages , mp3Support ? true -, lame ? null +, lame , opusSupport ? true -, opusTools ? null +, opusTools , faacSupport ? false -, faac ? null +, faac , flacSupport ? true -, flac ? null +, flac , soxSupport ? true -, sox ? null +, sox , vorbisSupport ? true -, vorbis-tools ? null +, vorbis-tools }: -assert mp3Support -> lame != null; -assert opusSupport -> opusTools != null; -assert faacSupport -> faac != null; -assert flacSupport -> flac != null; -assert soxSupport -> sox != null; -assert vorbisSupport -> vorbis-tools != null; - python3Packages.buildPythonApplication { pname = "pulseaudio-dlna"; version = "unstable-2021-11-09"; From f567ff4440b5cfe085348620c2784d71cc5c7792 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 26 Nov 2021 13:32:29 +0100 Subject: [PATCH 3/3] pulseaudio-dlna: ensure pactl is available 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) --- pkgs/applications/audio/pulseaudio-dlna/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/audio/pulseaudio-dlna/default.nix b/pkgs/applications/audio/pulseaudio-dlna/default.nix index 98803b32ec9f..384718f1db54 100644 --- a/pkgs/applications/audio/pulseaudio-dlna/default.nix +++ b/pkgs/applications/audio/pulseaudio-dlna/default.nix @@ -13,6 +13,7 @@ , sox , vorbisSupport ? true , vorbis-tools +, pulseaudio }: python3Packages.buildPythonApplication { @@ -54,6 +55,11 @@ python3Packages.buildPythonApplication { ++ 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