1{ lib, stdenv, buildPythonPackage, fetchPypi, fetchpatch, pythonOlder
2, fonttools, defcon, lxml, fs, unicodedata2, zopfli, brotlipy, fontpens
3, brotli, fontmath, mutatormath, booleanoperations
4, ufoprocessor, ufonormalizer, psautohint, tqdm
5, setuptools-scm
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "afdko";
11 version = "3.5.1";
12
13 disabled = pythonOlder "3.6";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "1qg7dgl81yq0sp50pkhgvmf8az1svx20zmpkfa68ka9d0ssh1wjw";
18 };
19
20 patches = [
21 # Skip date-dependent test. See
22 # https://github.com/adobe-type-tools/afdko/pull/1232
23 # https://github.com/NixOS/nixpkgs/pull/98158#issuecomment-704321117
24 (fetchpatch {
25 url = "https://github.com/adobe-type-tools/afdko/commit/2c36ad10f9d964759f643e8ed7b0972a27aa26bd.patch";
26 sha256 = "0p6a485mmzrbfldfbhgfghsypfiad3cabcw7qlw2rh993ivpnibf";
27 })
28 # fix tests for fonttools 4.21.1
29 (fetchpatch {
30 url = "https://github.com/adobe-type-tools/afdko/commit/0919e7454a0a05a1b141c23bf8134c67e6b688fc.patch";
31 sha256 = "0glly85swyl1kcc0mi8i0w4bm148bb001jz1winz5drfrw3a63jp";
32 })
33 ];
34
35 nativeBuildInputs = [ setuptools-scm ];
36
37 propagatedBuildInputs = [
38 booleanoperations
39 fonttools
40 lxml # fonttools[lxml], defcon[lxml] extra
41 fs # fonttools[ufo] extra
42 unicodedata2 # fonttools[unicode] extra
43 brotlipy # fonttools[woff] extra
44 zopfli # fonttools[woff] extra
45 fontpens
46 brotli
47 defcon
48 fontmath
49 mutatormath
50 ufoprocessor
51 ufonormalizer
52 psautohint
53 tqdm
54 ];
55
56 # tests are broken on non x86_64
57 # https://github.com/adobe-type-tools/afdko/issues/1163
58 # https://github.com/adobe-type-tools/afdko/issues/1216
59 doCheck = stdenv.isx86_64;
60 checkInputs = [ pytestCheckHook ];
61 preCheck = ''
62 export PATH=$PATH:$out/bin
63
64 # Update tests to match ufinormalizer-0.6.1 expectations:
65 # https://github.com/adobe-type-tools/afdko/issues/1418
66 find tests -name layerinfo.plist -delete
67 '';
68 disabledTests = [
69 # Disable slow tests, reduces test time ~25 %
70 "test_report"
71 "test_post_overflow"
72 "test_cjk"
73 "test_extrapolate"
74 "test_filename_without_dir"
75 "test_overwrite"
76 "test_options"
77 ];
78
79 meta = with lib; {
80 description = "Adobe Font Development Kit for OpenType";
81 homepage = "https://adobe-type-tools.github.io/afdko/";
82 license = licenses.asl20;
83 maintainers = [ maintainers.sternenseemann ];
84 };
85}