1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch2,
6 pytestCheckHook,
7 fontmath,
8 fonttools,
9 glyphslib,
10 setuptools,
11 setuptools-scm,
12 skia-pathops,
13 ttfautohint-py,
14 ufo2ft,
15 ufolib2,
16}:
17
18buildPythonPackage rec {
19 pname = "fontmake";
20 version = "3.10.0";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "googlefonts";
25 repo = "fontmake";
26 tag = "v${version}";
27 hash = "sha256-ZlK8QyZ5cIEphFiZXMV/Z5pL9H62X2UwLBtpwLGpUMQ=";
28 };
29
30 patches = [
31 # Update to FontTools 4.55 and glyphsLib 6.9.5
32 # https://github.com/googlefonts/fontmake/pull/1133
33 (fetchpatch2 {
34 url = "https://github.com/googlefonts/fontmake/commit/ca96d25faa67638930ddc7f9bd1ab218a76caf22.patch";
35 includes = [ "tests/test_main.py" ];
36 hash = "sha256-vz+KeWiGCpUdX5HaXDdyyUCbuMkIylB364j6cD7xR1E=";
37 })
38 ];
39
40 build-system = [
41 setuptools
42 setuptools-scm
43 ];
44
45 dependencies =
46 [
47 fontmath
48 fonttools
49 glyphslib
50 ufo2ft
51 ufolib2
52 ]
53 ++ fonttools.optional-dependencies.ufo
54 ++ fonttools.optional-dependencies.lxml
55 ++ fonttools.optional-dependencies.unicode;
56
57 optional-dependencies = {
58 pathops = [ skia-pathops ];
59 autohint = [ ttfautohint-py ];
60 json = ufolib2.optional-dependencies.json;
61 repacker = fonttools.optional-dependencies.repacker;
62 };
63
64 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.autohint;
65
66 pythonImportsCheck = [ "fontmake" ];
67
68 meta = {
69 description = "Compiles fonts from various sources (.glyphs, .ufo, designspace) into binaries formats (.otf, .ttf)";
70 homepage = "https://github.com/googlefonts/fontmake";
71 changelog = "https://github.com/googlefonts/fontmake/releases/tag/${src.tag}";
72 license = lib.licenses.asl20;
73 maintainers = [ lib.maintainers.BarinovMaxim ];
74 };
75}