1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 chardet,
7 pytestCheckHook,
8 fetchpatch2,
9}:
10
11buildPythonPackage rec {
12 pname = "pysrt";
13 version = "1.1.2";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "byroot";
18 repo = "pysrt";
19 rev = "v${version}";
20 sha256 = "1f5hxyzlh5mdvvi52qapys9qcinffr6ghgivb6k4jxa92cbs3mfg";
21 };
22
23 patches = [
24 (fetchpatch2 {
25 url = "https://github.com/byroot/pysrt/commit/93f52f6d4f70f4e18dc71deeaae0ec1e9100a50f.patch?full_index=1";
26 hash = "sha256-nikMPwj3OHvl6LunAfRk6ZbFUvVgPwF696Dt8R7BY4U=";
27 })
28 ];
29
30 build-system = [ setuptools ];
31
32 propagatedBuildInputs = [ chardet ];
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 meta = with lib; {
37 homepage = "https://github.com/byroot/pysrt";
38 license = licenses.gpl3Only;
39 description = "Python library used to edit or create SubRip files";
40 mainProgram = "srt";
41 };
42}