2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "castero";
|
|
|
|
version = "0.9.5";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xgi";
|
|
|
|
repo = "castero";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-6/7oCKBMEcQeJ8PaFP15Xef9sQRYCpigtzINv2M6GUY=";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = with python3.pkgs; [
|
2024-04-21 15:54:59 +00:00
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
requests
|
|
|
|
grequests
|
|
|
|
cjkwrap
|
|
|
|
pytz
|
|
|
|
beautifulsoup4
|
|
|
|
lxml
|
|
|
|
mpv
|
|
|
|
python-vlc
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ requests.optional-dependencies.socks;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests"
|
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
# Disable tests that are problematic with pytest
|
|
|
|
# Check NixOS/nixpkgs#333019 for more info about these
|
|
|
|
disabledTests = [
|
|
|
|
"test_datafile_download"
|
|
|
|
"test_display_get_input_str"
|
|
|
|
"test_display_get_y_n"
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
pythonImportsCheck = [
|
2024-04-21 15:54:59 +00:00
|
|
|
"castero"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Resolve configuration tests, which access $HOME
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Satisfy the python-mpv depedency, which is mpv within NixOS
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace-fail "python-mpv" "mpv"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# VLC currently doesn't support Darwin on NixOS
|
|
|
|
meta = with lib; {
|
|
|
|
mainProgram = "castero";
|
|
|
|
description = "TUI podcast client for the terminal";
|
|
|
|
homepage = "https://github.com/xgi/castero";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ keto ];
|
|
|
|
};
|
|
|
|
}
|