summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/compreffor/default.nix
blob: 0c6ffcf6873313e538b411190dfab99e28a8cd1a (plain)
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
{
  lib,
  buildPythonPackage,
  cython,
  fetchPypi,
  setuptools-scm,
  fonttools,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "compreffor";
  version = "0.5.6";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-icE9GDf5SD/gmqZrGe30SQ7ghColye3VIytSXaI/EA4=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail '"setuptools_git_ls_files",' ""
    substituteInPlace setup.py \
      --replace-fail ', "setuptools_git_ls_files"' ""
  '';

  build-system = [
    cython
    setuptools-scm
  ];

  dependencies = [ fonttools ];

  nativeCheckInputs = [ pytestCheckHook ];

  preCheck = ''
    # import from $out
    mv src/python/compreffor/test .
    rm -r src tools
  '';

  pythonImportsCheck = [ "compreffor" ];

  meta = {
    changelog = "https://github.com/googlefonts/compreffor/releases/tag/${version}";
    description = "CFF table subroutinizer for FontTools";
    mainProgram = "compreffor";
    homepage = "https://github.com/googlefonts/compreffor";
    license = lib.licenses.asl20;
    maintainers = [ ];
  };
}