Skip to content

Commit

Permalink
Merge pull request #144549 from siraben/swaglyrics-darwin
Browse files Browse the repository at this point in the history
swaglyrics, python3Packages.swspotify: update and fix build on darwin
  • Loading branch information
siraben authored Nov 3, 2021
2 parents 4571625 + 04a1551 commit 38f6e71
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
18 changes: 10 additions & 8 deletions pkgs/development/python-modules/swspotify/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{ lib, buildPythonPackage, fetchFromGitHub, requests, flask-cors, dbus-python, pytestCheckHook, mock, isPy27 }:
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, poetry-core, requests
, pytestCheckHook, flask, flask-cors, dbus-python, mock, isPy27 }:

buildPythonPackage rec {
pname = "SwSpotify";
version = "1.2.1";
version = "1.2.2";
disabled = isPy27;

src = fetchFromGitHub {
owner = "SwagLyrics";
repo = "SwSpotify";
rev = "v${version}";
sha256 = "0jxcvy8lw8kpjbl4q6mi11164pvi0w9m9p76bxj2m7i7s5p4dxd4";
sha256 = "sha256-571knnY8LegIbqyPeKUfl+d0suTWAMQHYLN7edKFNdI=";
};

propagatedBuildInputs = [
requests flask-cors dbus-python
requests flask flask-cors dbus-python
];

preConfigure = ''
substituteInPlace setup.py \
--replace 'requests>=2.24.0' 'requests~=2.23' \
--replace 'flask-cors==3.0.8' 'flask-cors'
--replace 'flask==2.0.1' 'flask'
'';

doCheck = !stdenv.isDarwin;

checkPhase = ''
pytest tests/test_spotify.py::LinuxTests
pytest tests/test_spotify.py::${if stdenv.isDarwin then "DarwinTests" else "LinuxTests"}
'';

checkInputs = [ pytestCheckHook mock ];
Expand All @@ -35,6 +37,6 @@ buildPythonPackage rec {
description = "Library to get the currently playing song and artist from Spotify";
license = licenses.mit;
maintainers = with maintainers; [ siraben ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
15 changes: 7 additions & 8 deletions pkgs/tools/misc/swaglyrics/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

python3.pkgs.buildPythonApplication rec {
pname = "swaglyrics";
version = "1.2.2";
version = "unstable-2021-06-17";

src = fetchFromGitHub {
owner = "SwagLyrics";
repo = "SwagLyrics-For-Spotify";
rev = "v${version}";
sha256 = "1dwj9fpyhqqpm2z3imp8hfribkzxya891shh77yg77rc2xghp7mh";
rev = "99fe764a9e45cac6cb9fcdf724c7d2f8cb4524fb";
sha256 = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
};

propagatedBuildInputs = with python3.pkgs; [
Expand All @@ -17,10 +17,9 @@ python3.pkgs.buildPythonApplication rec {

preConfigure = ''
substituteInPlace setup.py \
--replace 'requests>=2.24.0' 'requests~=2.23' \
--replace 'beautifulsoup4==4.9.1' 'beautifulsoup4~=4.9' \
--replace 'colorama==0.4.3' 'colorama~=0.4' \
--replace 'unidecode==1.1.1' 'unidecode~=1.2'
--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'
'';

preBuild = "export HOME=$NIX_BUILD_TOP";
Expand All @@ -43,6 +42,6 @@ python3.pkgs.buildPythonApplication rec {
homepage = "https://github.com/SwagLyrics/SwagLyrics-For-Spotify";
license = licenses.mit;
maintainers = with maintainers; [ siraben ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}

0 comments on commit 38f6e71

Please sign in to comment.