evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / afdko / default.nix
blob3181ecda763970dfed62f3850b3280e34e950fa9
2   lib,
3   stdenv,
4   # Enables some expensive tests, useful for verifying an update
5   afdko,
6   antlr4_9,
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.1";
31   pyproject = true;
33   disabled = pythonOlder "3.8";
35   src = fetchFromGitHub {
36     owner = "adobe-type-tools";
37     repo = "afdko";
38     rev = "refs/tags/${version}";
39     hash = "sha256-I5GKPkbyQX8QNSZgNB3wPKdWwpx8Xkklesu1M7nhgp8=";
40   };
42   build-system = [ setuptools-scm ];
44   nativeBuildInputs = [
45     scikit-build
46     cmake
47     ninja
48   ];
50   buildInputs = [
51     antlr4_9.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   # Happy new year
64   postPatch = ''
65     substituteInPlace tests/tx_data/expected_output/alt-missing-glif.pfb --replace 2023 2024
66   '';
68   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang (toString [
69     "-Wno-error=incompatible-function-pointer-types"
70     "-Wno-error=int-conversion"
71   ]);
73   # setup.py will always (re-)execute cmake in buildPhase
74   dontConfigure = true;
76   dependencies =
77     [
78       booleanoperations
79       defcon
80       fontmath
81       fontpens
82       fonttools
83       mutatormath
84       tqdm
85       ufonormalizer
86       ufoprocessor
87     ]
88     ++ defcon.optional-dependencies.lxml
89     ++ fonttools.optional-dependencies.lxml
90     ++ fonttools.optional-dependencies.ufo
91     ++ fonttools.optional-dependencies.unicode
92     ++ fonttools.optional-dependencies.woff;
94   # Use system libxml2
95   FORCE_SYSTEM_LIBXML2 = true;
97   nativeCheckInputs = [ pytestCheckHook ];
99   preCheck = ''
100     export PATH=$PATH:$out/bin
102     # Remove build artifacts to prevent them from messing with the tests
103     rm -rf _skbuild
104   '';
106   disabledTests =
107     [
108       # broke in the fontforge 4.51 -> 4.53 update
109       "test_glyphs_2_7"
110       "test_hinting_data"
111       "test_waterfallplot"
112     ]
113     ++ lib.optionals (stdenv.cc.isGNU) [
114       # broke in the gcc 13 -> 14 update
115       "test_dump"
116       "test_input_formats"
117       "test_other_input_formats"
118     ]
119     ++ lib.optionals (!runAllTests) [
120       # Disable slow tests, reduces test time ~25 %
121       "test_report"
122       "test_post_overflow"
123       "test_cjk"
124       "test_extrapolate"
125       "test_filename_without_dir"
126       "test_overwrite"
127       "test_options"
128     ]
129     ++ lib.optionals (stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isRiscV) [
130       # unknown reason so far
131       # https://github.com/adobe-type-tools/afdko/issues/1425
132       "test_spec"
133     ]
134     ++ lib.optionals (stdenv.hostPlatform.isi686) [
135       "test_dump_option"
136       "test_type1mm_inputs"
137     ];
139   passthru.tests = {
140     fullTestsuite = afdko.override { runAllTests = true; };
141   };
143   meta = with lib; {
144     description = "Adobe Font Development Kit for OpenType";
145     changelog = "https://github.com/adobe-type-tools/afdko/blob/${version}/NEWS.md";
146     homepage = "https://adobe-type-tools.github.io/afdko";
147     license = licenses.asl20;
148     maintainers = with maintainers; [ sternenseemann ];
149   };