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.1";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "googlefonts";
25 repo = "fontmake";
26 tag = "v${version}";
27 hash = "sha256-cHFxb7lWUj/7ATynoMGQkhArKWCHHLYvQG5IoaXwVBs=";
28 };
29
30 build-system = [
31 setuptools
32 setuptools-scm
33 ];
34
35 dependencies = [
36 fontmath
37 fonttools
38 glyphslib
39 ufo2ft
40 ufolib2
41 ]
42 ++ fonttools.optional-dependencies.ufo
43 ++ fonttools.optional-dependencies.lxml
44 ++ fonttools.optional-dependencies.unicode;
45
46 optional-dependencies = {
47 pathops = [ skia-pathops ];
48 autohint = [ ttfautohint-py ];
49 json = ufolib2.optional-dependencies.json;
50 repacker = fonttools.optional-dependencies.repacker;
51 };
52
53 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.autohint;
54
55 pythonImportsCheck = [ "fontmake" ];
56
57 meta = {
58 description = "Compiles fonts from various sources (.glyphs, .ufo, designspace) into binaries formats (.otf, .ttf)";
59 homepage = "https://github.com/googlefonts/fontmake";
60 changelog = "https://github.com/googlefonts/fontmake/releases/tag/${src.tag}";
61 license = lib.licenses.asl20;
62 maintainers = [ lib.maintainers.BarinovMaxim ];
63 };
64}