1{
2 lib,
3 buildPythonPackage,
4 cython,
5 fetchPypi,
6 setuptools-scm,
7 fonttools,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "compreffor";
13 version = "0.5.6";
14 pyproject = true;
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-icE9GDf5SD/gmqZrGe30SQ7ghColye3VIytSXaI/EA4=";
19 };
20
21 postPatch = ''
22 substituteInPlace pyproject.toml \
23 --replace-fail '"setuptools_git_ls_files",' ""
24 substituteInPlace setup.py \
25 --replace-fail ', "setuptools_git_ls_files"' ""
26 '';
27
28 build-system = [
29 cython
30 setuptools-scm
31 ];
32
33 dependencies = [ fonttools ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 preCheck = ''
38 # import from $out
39 mv src/python/compreffor/test .
40 rm -r src tools
41 '';
42
43 pythonImportsCheck = [ "compreffor" ];
44
45 meta = with lib; {
46 changelog = "https://github.com/googlefonts/compreffor/releases/tag/${version}";
47 description = "CFF table subroutinizer for FontTools";
48 mainProgram = "compreffor";
49 homepage = "https://github.com/googlefonts/compreffor";
50 license = licenses.asl20;
51 maintainers = [ ];
52 };
53}