diff --git a/pkgs/by-name/bi/bili-live-tool/package.nix b/pkgs/by-name/bi/bili-live-tool/package.nix new file mode 100644 index 000000000000..4e00973669dd --- /dev/null +++ b/pkgs/by-name/bi/bili-live-tool/package.nix @@ -0,0 +1,61 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + nix-update-script, +}: + +let + version = "0.3.9"; +in +python3Packages.buildPythonApplication { + pname = "bili-live-tool"; + inherit version; + + src = fetchFromGitHub { + owner = "chenxi-Eumenides"; + repo = "bilibili_live_tool"; + tag = "v${version}"; + hash = "sha256-gNzR9cDy4sixQOSWAXeX5qOoGkaFOjBU//+iHvG0lG8="; + }; + + postPatch = '' + tee >> pyproject.toml < $out/bin/bili-live-tool + chmod +x $out/bin/bili-live-tool + ''; + + nativeCheckInputs = with python3Packages; [ unittestCheckHook ]; + unittestFlags = [ + "-s" + "unittest" + "-v" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Tool to start and stop streaming and getting streaming codes for Bilibili live"; + homepage = "https://github.com/chenxi-Eumenides/bilibili_live_tool"; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ ulysseszhan ]; + mainProgram = "bili-live-tool"; + }; +}