1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 fetchpatch2,
6 pythonOlder,
7
8 # build-system
9 setuptools,
10 setuptools-scm,
11
12 # dependencies
13 fonttools,
14 defcon,
15 fontmath,
16 booleanoperations,
17
18 # tests
19 python,
20}:
21
22buildPythonPackage rec {
23 pname = "fontparts";
24 version = "0.12.1";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 pname = "fontParts";
31 inherit version;
32 hash = "sha256-eeU13S1IcC+bsiK3YDlT4rVDeXDGcxx1wY/is8t5pCA=";
33 extension = "zip";
34 };
35
36 patches = [
37 (fetchpatch2 {
38 # replace remaining usage of assertEquals for Python 3.12 support
39 # https://github.com/robotools/fontParts/pull/720
40 url = "https://github.com/robotools/fontParts/commit/d7484cd98051aa1588683136da0bb99eac31523b.patch";
41 hash = "sha256-maoUgbmXY/RC4TUZI4triA9OIfB4T98qjUaQ94uhsbg=";
42 })
43 ];
44
45 nativeBuildInputs = [
46 setuptools
47 setuptools-scm
48 ];
49
50 propagatedBuildInputs =
51 [
52 booleanoperations
53 defcon
54 fontmath
55 fonttools
56 ]
57 ++ defcon.optional-dependencies.pens
58 ++ fonttools.optional-dependencies.ufo
59 ++ fonttools.optional-dependencies.lxml
60 ++ fonttools.optional-dependencies.unicode;
61
62 checkPhase = ''
63 runHook preCheck
64 ${python.interpreter} Lib/fontParts/fontshell/test.py
65 runHook postCheck
66 '';
67
68 meta = with lib; {
69 description = "API for interacting with the parts of fonts during the font development process";
70 homepage = "https://github.com/robotools/fontParts";
71 changelog = "https://github.com/robotools/fontParts/releases/tag/${version}";
72 license = licenses.mit;
73 maintainers = [ maintainers.sternenseemann ];
74 };
75}