about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/streamlink
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/video/streamlink')
-rw-r--r--nixpkgs/pkgs/applications/video/streamlink/default.nix37
1 files changed, 20 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/applications/video/streamlink/default.nix b/nixpkgs/pkgs/applications/video/streamlink/default.nix
index 8097c5dbe92a..4abc2b6546aa 100644
--- a/nixpkgs/pkgs/applications/video/streamlink/default.nix
+++ b/nixpkgs/pkgs/applications/video/streamlink/default.nix
@@ -1,48 +1,50 @@
 { lib
-, python3
-, fetchFromGitHub
+, python3Packages
 , rtmpdump
 , ffmpeg
+, fetchpatch
 }:
 
-python3.pkgs.buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   pname = "streamlink";
-  version = "2.3.0";
+  version = "2.4.0";
 
-  src = fetchFromGitHub {
-    owner = "streamlink";
-    repo = "streamlink";
-    rev = version;
-    sha256 = "sha256-lsurDFvVHn1rxR3bgG7BY512ISavpja36/UaKXauf+g=";
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "e95588e222d1a7bd51e3171cd4bce84fd6f646418537aff37993d40f597810af";
   };
 
-  checkInputs = with python3.pkgs; [
+  checkInputs = with python3Packages; [
     pytestCheckHook
     mock
     requests-mock
     freezegun
   ];
 
-  propagatedBuildInputs = (with python3.pkgs; [
+  propagatedBuildInputs = (with python3Packages; [
     pycryptodome
     requests
     iso-639
     iso3166
     websocket-client
     isodate
+    lxml
   ]) ++ [
     rtmpdump
     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>=2.25.1,<3.0'
-  '';
+  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://github.com/streamlink/streamlink";
+    homepage = "https://streamlink.github.io/";
     description = "CLI for extracting streams from various websites to video player of your choosing";
     longDescription = ''
       Streamlink is a CLI utility that pipes videos from online
@@ -51,6 +53,7 @@ python3.pkgs.buildPythonApplication rec {
 
       Streamlink is a fork of the livestreamer project.
     '';
+    changelog = "https://github.com/streamlink/streamlink/raw/${version}/CHANGELOG.md";
     license = licenses.bsd2;
     platforms = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ dezgeg zraexy DeeUnderscore ];