nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, brotlipy
6, zopfli
7, lxml
8, scipy
9, munkres
10, unicodedata2
11, sympy
12, reportlab
13, sphinx
14, pytestCheckHook
15, glibcLocales
16, setuptools-scm
17}:
18
19buildPythonPackage rec {
20 pname = "fonttools";
21 version = "4.33.3";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = pname;
27 repo = pname;
28 rev = version;
29 sha256 = "MUIZGnYwlfTat9655AOYgK5r6AvHj/xXghUvOZR8HIM=";
30 };
31
32 nativeBuildInputs = [ setuptools-scm ];
33
34 # all dependencies are optional, but
35 # we run the checks with them
36
37 checkInputs = [
38 pytestCheckHook
39 # etree extra
40 lxml
41 # woff extra
42 brotlipy
43 zopfli
44 # interpolatable extra
45 scipy
46 munkres
47 # symfont
48 sympy
49 # pens
50 reportlab
51 sphinx
52 ] ++ lib.optionals (pythonOlder "3.9") [
53 # unicode extra
54 unicodedata2
55 ];
56
57 pythonImportsCheck = [ "fontTools" ];
58
59 preCheck = ''
60 # tests want to execute the "fonttools" executable from $PATH
61 export PATH="$out/bin:$PATH"
62 '';
63
64 # Timestamp tests have timing issues probably related
65 # to our file timestamp normalization
66 disabledTests = [
67 "test_recalc_timestamp_ttf"
68 "test_recalc_timestamp_otf"
69 "test_ttcompile_timestamp_calcs"
70 ];
71
72 disabledTestPaths = [
73 # avoid test which depend on fs and matplotlib
74 # fs and matplotlib were removed to prevent strong cyclic dependencies
75 "Tests/misc/plistlib_test.py"
76 "Tests/pens"
77 "Tests/ufoLib"
78 ];
79
80 meta = with lib; {
81 homepage = "https://github.com/fonttools/fonttools";
82 description = "A library to manipulate font files from Python";
83 license = licenses.mit;
84 maintainers = [ maintainers.sternenseemann ];
85 };
86}