nixpkgs/pkgs/by-name/sw/swaglyrics/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

68 lines
1.4 KiB
Nix

{ 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";
hash = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "==" ">="
'';
propagatedBuildInputs = with python3.pkgs; [
beautifulsoup4
colorama
flask
requests
swspotify
unidecode
];
nativeCheckInputs = with python3.pkgs; [
blinker
flask
flask-testing
mock
pytestCheckHook
] ++ [
ncurses
];
preBuild = ''
export HOME=$(mktemp -d)
'';
disabledTests = [
# Disable tests which touch network
"test_database_for_unsupported_song"
"test_that_lyrics_works_for_unsupported_songs"
"test_that_get_lyrics_works"
"test_lyrics_are_shown_in_tab"
"test_songchanged_can_raise_songplaying"
];
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 ];
mainProgram = "swaglyrics";
};
}