Merge: matrix-synapse: 1.122.0 -> 1.123.0 (#378018)
[NixPkgs.git] / pkgs / development / python-modules / afdko / default.nix
blob6066eb50a1181c8644e8bde340b3da1ffebe6f19
2   lib,
3   stdenv,
4   # Enables some expensive tests, useful for verifying an update
5   afdko,
6   antlr4_13,
7   booleanoperations,
8   buildPythonPackage,
9   cmake,
10   defcon,
11   fetchFromGitHub,
12   fontmath,
13   fontpens,
14   fonttools,
15   libxml2,
16   mutatormath,
17   ninja,
18   pytestCheckHook,
19   pythonOlder,
20   runAllTests ? false,
21   scikit-build,
22   setuptools-scm,
23   tqdm,
24   ufonormalizer,
25   ufoprocessor,
28 buildPythonPackage rec {
29   pname = "afdko";
30   version = "4.0.2";
31   pyproject = true;
33   disabled = pythonOlder "3.8";
35   src = fetchFromGitHub {
36     owner = "adobe-type-tools";
37     repo = "afdko";
38     tag = version;
39     hash = "sha256:0955dvbydifhgx9gswbf5drsmmghry7iyf6jwz6qczhj86clswcm";
40   };
42   build-system = [ setuptools-scm ];
44   nativeBuildInputs = [
45     scikit-build
46     cmake
47     ninja
48   ];
50   buildInputs = [
51     antlr4_13.runtime.cpp
52     libxml2.dev
53   ];
55   patches = [
56     # Don't try to install cmake and ninja using pip
57     ./no-pypi-build-tools.patch
59     # Use antlr4 runtime from nixpkgs and link it dynamically
60     ./use-dynamic-system-antlr4-runtime.patch
61   ];
63   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang (toString [
64     "-Wno-error=incompatible-function-pointer-types"
65     "-Wno-error=int-conversion"
66   ]);
68   # setup.py will always (re-)execute cmake in buildPhase
69   dontConfigure = true;
71   dependencies =
72     [
73       booleanoperations
74       defcon
75       fontmath
76       fontpens
77       fonttools
78       mutatormath
79       tqdm
80       ufonormalizer
81       ufoprocessor
82     ]
83     ++ defcon.optional-dependencies.lxml
84     ++ fonttools.optional-dependencies.lxml
85     ++ fonttools.optional-dependencies.ufo
86     ++ fonttools.optional-dependencies.unicode
87     ++ fonttools.optional-dependencies.woff;
89   # Use system libxml2
90   FORCE_SYSTEM_LIBXML2 = true;
92   nativeCheckInputs = [ pytestCheckHook ];
94   preCheck = ''
95     export PATH=$PATH:$out/bin
97     # Remove build artifacts to prevent them from messing with the tests
98     rm -rf _skbuild
99   '';
101   disabledTests =
102     [
103       # broke in the fontforge 4.51 -> 4.53 update
104       "test_glyphs_2_7"
105       "test_hinting_data"
106       "test_waterfallplot"
107     ]
108     ++ lib.optionals (stdenv.cc.isGNU) [
109       # broke in the gcc 13 -> 14 update
110       "test_dump"
111       "test_input_formats"
112       "test_other_input_formats"
113     ]
114     ++ lib.optionals (!runAllTests) [
115       # Disable slow tests, reduces test time ~25 %
116       "test_report"
117       "test_post_overflow"
118       "test_cjk"
119       "test_extrapolate"
120       "test_filename_without_dir"
121       "test_overwrite"
122       "test_options"
123     ]
124     ++ lib.optionals (stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isRiscV) [
125       # unknown reason so far
126       # https://github.com/adobe-type-tools/afdko/issues/1425
127       "test_spec"
128     ]
129     ++ lib.optionals (stdenv.hostPlatform.isi686) [
130       "test_dump_option"
131       "test_type1mm_inputs"
132     ];
134   passthru.tests = {
135     fullTestsuite = afdko.override { runAllTests = true; };
136   };
138   meta = with lib; {
139     description = "Adobe Font Development Kit for OpenType";
140     changelog = "https://github.com/adobe-type-tools/afdko/blob/${version}/NEWS.md";
141     homepage = "https://adobe-type-tools.github.io/afdko";
142     license = licenses.asl20;
143     maintainers = with maintainers; [ sternenseemann ];
144   };