From 252d091e56fb779977e55f6fc562d9ed1bcc3cc8 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Thu, 20 Apr 2023 16:51:00 +0200 Subject: [PATCH] Add a newer spotdl derivation --- derivations/default.nix | 1 + derivations/spotdl-4.1.6/default.nix | 96 ++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 derivations/spotdl-4.1.6/default.nix diff --git a/derivations/default.nix b/derivations/default.nix index 2701197a..3c9060d7 100644 --- a/derivations/default.nix +++ b/derivations/default.nix @@ -8,4 +8,5 @@ dconf-editor-wrapped = pkgs.callPackage ./dconf-editor-wrapped {}; dell-b1160w = pkgs.callPackage ./dell-b1160w {}; xdg-desktop-portal-termfilechooser = pkgs.callPackage ./xdg-desktop-portal-termfilechooser {}; + spotdl-4_1_6 = pkgs.callPackage ./spotdl-4.1.6 {}; } diff --git a/derivations/spotdl-4.1.6/default.nix b/derivations/spotdl-4.1.6/default.nix new file mode 100644 index 00000000..cea016f6 --- /dev/null +++ b/derivations/spotdl-4.1.6/default.nix @@ -0,0 +1,96 @@ +{ lib +, python3 +, fetchFromGitHub +, ffmpeg +}: + +python3.pkgs.buildPythonApplication rec { + pname = "spotdl"; + version = "4.1.6"; + + format = "pyproject"; + + src = fetchFromGitHub { + owner = "spotDL"; + repo = "spotify-downloader"; + rev = "refs/tags/v${version}"; + hash = "sha256-+hkdrPi3INs16SeAl+iXOE9KFDzG/TYXB3CDd8Tigwk="; + }; + + nativeBuildInputs = with python3.pkgs; [ + poetry-core + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = true; + + propagatedBuildInputs = with python3.pkgs; [ + spotipy + ytmusicapi + pytube + yt-dlp + mutagen + rich + beautifulsoup4 + requests + rapidfuzz + python-slugify + uvicorn + pydantic + fastapi + platformdirs + pykakasi + syncedlyrics + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytestCheckHook + pytest-mock + pytest-vcr + pyfakefs + pytest-subprocess + ]; + + preCheck = '' + export HOME=$TMPDIR + ''; + + disabledTestPaths = [ + # require networking + "tests/test_init.py" + "tests/test_matching.py" + "tests/utils/test_m3u.py" + "tests/utils/test_metadata.py" + "tests/utils/test_search.py" + ]; + + disabledTests = [ + # require networking + "test_album_from_string" + "test_album_from_url" + "test_album_length" + "test_artist_from_url" + "test_artist_from_string" + "test_convert" + "test_download_ffmpeg" + "test_download_song" + "test_playlist_from_string" + "test_playlist_from_url" + "test_playlist_length" + "test_preload_song" + "test_song_from_search_term" + "test_song_from_url" + ]; + + makeWrapperArgs = [ + "--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ]) + ]; + + meta = with lib; { + description = "Download your Spotify playlists and songs along with album art and metadata"; + homepage = "https://github.com/spotDL/spotify-downloader"; + changelog = "https://github.com/spotDL/spotify-downloader/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +}