about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pysrt/default.nix
blob: 9be5028a878796e9ff71562fff7cbf2aff301e2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  chardet,
  pytestCheckHook,
  fetchpatch2,
}:

buildPythonPackage rec {
  pname = "pysrt";
  version = "1.1.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "byroot";
    repo = "pysrt";
    rev = "v${version}";
    sha256 = "1f5hxyzlh5mdvvi52qapys9qcinffr6ghgivb6k4jxa92cbs3mfg";
  };

  patches = [
    (fetchpatch2 {
      url = "https://github.com/byroot/pysrt/commit/93f52f6d4f70f4e18dc71deeaae0ec1e9100a50f.patch?full_index=1";
      hash = "sha256-nikMPwj3OHvl6LunAfRk6ZbFUvVgPwF696Dt8R7BY4U=";
    })
  ];

  build-system = [ setuptools ];

  propagatedBuildInputs = [ chardet ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = with lib; {
    homepage = "https://github.com/byroot/pysrt";
    license = licenses.gpl3Only;
    description = "Python library used to edit or create SubRip files";
    mainProgram = "srt";
  };
}