mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
571c71e6f7
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.
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ lib, python3Packages, fetchFromGitHub }:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "yewtube";
|
|
version = "2.12.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mps-youtube";
|
|
repo = "yewtube";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-66cGnEEISC+lZAYhFXuVdDtwh1TgwvCP6nBD84z2z0I=";
|
|
};
|
|
|
|
postPatch = ''
|
|
# Don't try to detect the version at runtime with pip
|
|
substituteInPlace mps_youtube/__init__.py \
|
|
--replace "from pip._vendor import pkg_resources" "" \
|
|
--replace "__version__ =" "__version__ = '${version}' #"
|
|
'';
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
pyperclip
|
|
requests
|
|
youtube-search-python
|
|
yt-dlp
|
|
pylast
|
|
];
|
|
|
|
checkInputs = with python3Packages; [
|
|
pytestCheckHook
|
|
dbus-python
|
|
pygobject3
|
|
];
|
|
|
|
preCheck = ''
|
|
export XDG_CONFIG_HOME=$(mktemp -d)
|
|
'';
|
|
|
|
pythonImportsCheck = [ "mps_youtube" ];
|
|
|
|
meta = with lib; {
|
|
description = "Terminal based YouTube player and downloader, forked from mps-youtube";
|
|
mainProgram = "yt";
|
|
homepage = "https://github.com/mps-youtube/yewtube";
|
|
license = licenses.gpl3Plus;
|
|
maintainers = with maintainers; [ fgaz koral ];
|
|
};
|
|
}
|