nixpkgs/pkgs/by-name/tv/tvnamer/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

55 lines
1.3 KiB
Nix

{ lib
, python3
, fetchPypi
}:
let
python' = python3.override {
self = python';
packageOverrides = final: prev: rec {
# tvdb_api v3.1.0 has a hard requirement on requests-cache < 0.6
requests-cache = prev.requests-cache.overridePythonAttrs (oldAttrs: rec {
version = "0.5.2";
src = fetchPypi {
inherit (oldAttrs) pname;
inherit version;
sha256 = "sha256-gTAjJpaGBF+OAeIonMHn6a5asi3dHihJqQk6s6tycOs=";
};
nativeBuildInputs = with final; [
setuptools
];
# too many changes have been made to requests-cache based on version 0.6 so
# simply disable tests
doCheck = false;
});
};
};
pypkgs = python'.pkgs;
in
pypkgs.buildPythonApplication rec {
pname = "tvnamer";
version = "3.0.4";
src = fetchPypi {
inherit pname version;
sha256 = "dc2ea8188df6ac56439343630466b874c57756dd0b2538dd8e7905048f425f04";
};
propagatedBuildInputs = with pypkgs; [ tvdb-api ];
# no tests from pypi
doCheck = false;
meta = with lib; {
description = "Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api";
homepage = "https://github.com/dbr/tvnamer";
license = licenses.unlicense;
maintainers = with maintainers; [ peterhoeg ];
mainProgram = "tvnamer";
};
}