about summary refs log tree commit diff
path: root/pkgs/development/python-modules/ssg/default.nix
blob: 53fbbb0f3868e31f0eea7cb4378c3980c1a8f222 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,

  python3,
  unittestCheckHook,
  setuptools,

  fire,
  python-crfsuite,
  tqdm,
}:

buildPythonPackage {
  pname = "ssg";
  version = "0.0.8";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ponrawee";
    repo = "ssg";
    rev = "d1b811ef4f8ac08ba1db839f426ba6b6a8e0eb38";
    hash = "sha256-GBZzVDDfKOTnbcrIxhFRiNHXN2pSNU3T9RvUytJ068w=";
  };

  patches = [
    (fetchpatch {
      name = "fix-deprecation-warnings-and-bump-version";
      url = "https://patch-diff.githubusercontent.com/raw/ponrawee/ssg/pull/10.patch";
      hash = "sha256-4O1fpI0FBUG/3RN+PAi7I8vpgYmPPL5ZMXhoZUFsQy8=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [
    fire
    python-crfsuite
    tqdm
  ];

  nativeCheckInputs = [ unittestCheckHook ];

  pythonImportsCheck = [ "ssg" ];

  postInstall = "rm -rf $out/${python3.sitePackages}/scripts";

  meta = with lib; {
    description = "TCRF syllable segmenter for Thai";
    homepage = "https://github.com/ponrawee/ssg";
    license = licenses.asl20;
    maintainers = with maintainers; [ vizid ];
    mainProgram = "ssg-cli";
  };
}