From 299d4d72969c9cfd37a94d7c4371aa77b9b02590 Mon Sep 17 00:00:00 2001 From: D Anzorge Date: Fri, 17 Sep 2021 01:06:25 +0200 Subject: [PATCH] streamlink: patch tests for compatibility with Requests 2.26 --- pkgs/applications/video/streamlink/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/video/streamlink/default.nix b/pkgs/applications/video/streamlink/default.nix index 1c1a0fb3d84c..4abc2b6546aa 100644 --- a/pkgs/applications/video/streamlink/default.nix +++ b/pkgs/applications/video/streamlink/default.nix @@ -2,6 +2,7 @@ , python3Packages , rtmpdump , ffmpeg +, fetchpatch }: python3Packages.buildPythonApplication rec { @@ -33,11 +34,14 @@ python3Packages.buildPythonApplication rec { ffmpeg ]; - # note that upstream currently uses requests 2.25.1 in Windows builds - postPatch = '' - substituteInPlace setup.py \ - --replace 'requests>=2.26.0,<3.0' 'requests' - ''; + patches = [ + # Patch failing tests to expect correct Accept-Encoding as generated by Requests + (fetchpatch { + url = "https://github.com/streamlink/streamlink/commit/ae747a113199c119bced4613d33edcc67a222bb9.patch"; + includes = [ "tests/test_stream_json.py" ]; + sha256 = "sha256-KEgyWdh5DNgNktmLSvKQowUQO9p9Q7zP4NbCQJPNgKw="; + }) + ]; meta = with lib; { homepage = "https://streamlink.github.io/";