2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-10-23 06:41:50 +00:00
|
|
|
stdenv,
|
2024-06-05 15:53:02 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-10-04 16:56:33 +00:00
|
|
|
rustPlatform,
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook,
|
2024-10-23 06:41:50 +00:00
|
|
|
libiconv,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "biliass";
|
2024-10-23 06:41:50 +00:00
|
|
|
version = "2.1.0";
|
2024-10-04 16:56:33 +00:00
|
|
|
pyproject = true;
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yutto-dev";
|
2024-10-04 16:56:33 +00:00
|
|
|
repo = "yutto";
|
|
|
|
rev = "refs/tags/biliass@${version}";
|
2024-10-23 06:41:50 +00:00
|
|
|
hash = "sha256-PlZD+988KdJqYC1I1K7i+YAH1Tzr6zfXcJFR/M4mQRA=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
sourceRoot = "source/packages/biliass";
|
|
|
|
cargoRoot = "rust";
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit
|
|
|
|
pname
|
|
|
|
version
|
|
|
|
src
|
|
|
|
;
|
|
|
|
sourceRoot = "${sourceRoot}/${cargoRoot}";
|
2024-10-23 06:41:50 +00:00
|
|
|
hash = "sha256-DMKUbJSVME5siSPybdO5bOluPn3obVq1/6822uoSsDQ=";
|
2024-10-04 16:56:33 +00:00
|
|
|
};
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-10-23 06:41:50 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
doCheck = false; # test artifacts missing
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "biliass" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/yutto-dev/biliass";
|
|
|
|
description = "Convert Bilibili XML/protobuf danmaku to ASS subtitle";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "biliass";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ linsui ];
|
|
|
|
};
|
|
|
|
}
|