2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
python3,
|
|
|
|
mopidy,
|
|
|
|
yt-dlp,
|
|
|
|
extraPkgs ? pkgs: [ ],
|
2021-10-11 16:52:03 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mopidy-youtube";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "3.7";
|
2022-03-30 09:31:56 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "natumbri";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-iFt7r8Ljymc+grNJiOClTHkZOeo7AcYpcNc8tLMPROk=";
|
2021-10-11 16:52:03 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
with python3.pkgs;
|
|
|
|
[
|
|
|
|
beautifulsoup4
|
|
|
|
cachetools
|
|
|
|
pykka
|
|
|
|
requests
|
|
|
|
ytmusicapi
|
|
|
|
]
|
|
|
|
++ [
|
|
|
|
mopidy
|
|
|
|
yt-dlp
|
|
|
|
]
|
|
|
|
++ extraPkgs pkgs;
|
2021-10-11 16:52:03 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
2021-10-11 16:52:03 +00:00
|
|
|
vcrpy
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace mopidy_youtube/youtube.py \
|
|
|
|
--replace-fail 'youtube_dl_package = "youtube_dl"' 'youtube_dl_package = "yt_dlp"'
|
|
|
|
substituteInPlace tests/conftest.py \
|
|
|
|
--replace-fail 'import youtube_dl' 'import yt_dlp' \
|
|
|
|
--replace-fail 'patcher = mock.patch.object(youtube, "youtube_dl", spec=youtube_dl)' \
|
|
|
|
'patcher = mock.patch.object(youtube, "youtube_dl", spec=yt_dlp)' \
|
|
|
|
--replace-fail '"youtube_dl_package": "youtube_dl",' '"youtube_dl_package": "yt_dlp",'
|
|
|
|
'';
|
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Test requires a YouTube API key
|
|
|
|
"test_get_default_config"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2022-03-30 09:31:56 +00:00
|
|
|
# Disable tests which interact with Youtube
|
|
|
|
"tests/test_api.py"
|
2021-10-11 16:52:03 +00:00
|
|
|
"tests/test_backend.py"
|
2022-03-30 09:31:56 +00:00
|
|
|
"tests/test_youtube.py"
|
2021-10-11 16:52:03 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
pythonImportsCheck = [ "mopidy_youtube" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Mopidy extension for playing music from YouTube";
|
2021-10-11 16:52:03 +00:00
|
|
|
homepage = "https://github.com/natumbri/mopidy-youtube";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|