1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 cattrs,
6 exceptiongroup,
7 fetchFromGitHub,
8 fonttools,
9 fs,
10 importlib-metadata,
11 poetry-core,
12 pytestCheckHook,
13 pythonOlder,
14 ufo2ft,
15 ufolib2,
16 hatchling,
17 hatch-vcs,
18}:
19
20buildPythonPackage rec {
21 pname = "statmake";
22 version = "1.1.0";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "daltonmaag";
29 repo = "statmake";
30 tag = "v${version}";
31 hash = "sha256-UqL3l27Icu5DoVvFYctbOF7gvKvVV6hK1R5A1y9SYkU=";
32 };
33
34 build-system = [
35 hatchling
36 hatch-vcs
37 ];
38
39 nativeBuildInputs = [ poetry-core ];
40
41 propagatedBuildInputs = [
42 attrs
43 cattrs
44 fonttools
45 # required by fonttools[ufo]
46 fs
47 ]
48 ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]
49 ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
50
51 nativeCheckInputs = [
52 pytestCheckHook
53 ufo2ft
54 ufolib2
55 ];
56
57 pythonImportsCheck = [ "statmake" ];
58
59 disabledTests = [
60 # Test requires an update as later cattrs is present in Nixpkgs
61 # https://github.com/daltonmaag/statmake/issues/42
62 "test_load_stylespace_broken_range"
63 ];
64
65 meta = with lib; {
66 description = "Applies STAT information from a Stylespace to a variable font";
67 mainProgram = "statmake";
68 homepage = "https://github.com/daltonmaag/statmake";
69 changelog = "https://github.com/daltonmaag/statmake/releases/tag/${src.tag}";
70 license = licenses.mit;
71 maintainers = [ ];
72 };
73}