about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/swaglyrics
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/tools/misc/swaglyrics
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/swaglyrics')
-rw-r--r--nixpkgs/pkgs/tools/misc/swaglyrics/default.nix49
1 files changed, 34 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/tools/misc/swaglyrics/default.nix b/nixpkgs/pkgs/tools/misc/swaglyrics/default.nix
index cc1835c55498..8c5a3b7e9474 100644
--- a/nixpkgs/pkgs/tools/misc/swaglyrics/default.nix
+++ b/nixpkgs/pkgs/tools/misc/swaglyrics/default.nix
@@ -1,31 +1,51 @@
-{ lib, python3, fetchFromGitHub, ncurses }:
+{ lib
+, python3
+, fetchFromGitHub
+, ncurses
+}:
 
 python3.pkgs.buildPythonApplication rec {
   pname = "swaglyrics";
   version = "unstable-2021-06-17";
+  format = "setuptools";
 
   src = fetchFromGitHub {
     owner = "SwagLyrics";
     repo = "SwagLyrics-For-Spotify";
     rev = "99fe764a9e45cac6cb9fcdf724c7d2f8cb4524fb";
-    sha256 = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
+    hash = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
   };
 
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "==" ">="
+  '';
+
   propagatedBuildInputs = with python3.pkgs; [
-    unidecode colorama beautifulsoup4 flask requests swspotify
+    beautifulsoup4
+    colorama
+    flask
+    requests
+    swspotify
+    unidecode
   ];
 
-  preConfigure = ''
-    substituteInPlace setup.py \
-      --replace 'beautifulsoup4==4.9.3' 'beautifulsoup4>=4.9.3' \
-      --replace 'unidecode==1.2.0' 'unidecode>=1.2.0' \
-      --replace 'flask==2.0.1' 'flask>=2.0.1'
-  '';
+  checkInputs = with python3.pkgs; [
+    blinker
+    flask
+    flask-testing
+    mock
+    pytestCheckHook
+  ] ++ [
+    ncurses
+  ];
 
-  preBuild = "export HOME=$NIX_BUILD_TOP";
+  preBuild = ''
+    export HOME=$(mktemp -d)
+  '';
 
-  # disable tests which touch network
   disabledTests = [
+     # Disable tests which touch network
      "test_database_for_unsupported_song"
      "test_that_lyrics_works_for_unsupported_songs"
      "test_that_get_lyrics_works"
@@ -33,15 +53,14 @@ python3.pkgs.buildPythonApplication rec {
      "test_songchanged_can_raise_songplaying"
   ];
 
-  checkInputs = with python3.pkgs;
-    [ blinker swspotify pytestCheckHook flask mock flask_testing ]
-    ++ [ ncurses ];
+  pythonImportsCheck = [
+    "swaglyrics"
+  ];
 
   meta = with lib; {
     description = "Lyrics fetcher for currently playing Spotify song";
     homepage = "https://github.com/SwagLyrics/SwagLyrics-For-Spotify";
     license = licenses.mit;
     maintainers = with maintainers; [ siraben ];
-    platforms = platforms.unix;
   };
 }