2022-02-10 20:34:41 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, fetchpatch, pythonOlder
|
2020-09-25 04:45:31 +00:00
|
|
|
, fonttools, defcon, lxml, fs, unicodedata2, zopfli, brotlipy, fontpens
|
|
|
|
, brotli, fontmath, mutatormath, booleanoperations
|
2020-10-16 20:44:37 +00:00
|
|
|
, ufoprocessor, ufonormalizer, psautohint, tqdm
|
2021-12-26 17:43:05 +00:00
|
|
|
, setuptools-scm, scikit-build
|
|
|
|
, cmake
|
|
|
|
, antlr4_9
|
2022-07-14 12:49:19 +00:00
|
|
|
, libxml2
|
2020-12-25 13:55:36 +00:00
|
|
|
, pytestCheckHook
|
2021-12-26 17:43:05 +00:00
|
|
|
# Enables some expensive tests, useful for verifying an update
|
|
|
|
, runAllTests ? false
|
|
|
|
, afdko
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "afdko";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "3.9.0";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-07-14 12:49:19 +00:00
|
|
|
sha256 = "1fjsaz6bp028fbmry6fzfcih78mdzycqmky1wsz5y0bg4kfk4shh";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
scikit-build
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
antlr4_9.runtime.cpp
|
2022-07-14 12:49:19 +00:00
|
|
|
libxml2.dev
|
2021-12-26 17:43:05 +00:00
|
|
|
];
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
patches = [
|
2021-12-26 17:43:05 +00:00
|
|
|
# Don't try to install cmake and ninja using pip
|
|
|
|
./no-pypi-build-tools.patch
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
# Use antlr4 runtime from nixpkgs and link it dynamically
|
|
|
|
./use-dynamic-system-antlr4-runtime.patch
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
./libxml2-cmake-find-package.patch
|
2020-10-16 20:44:37 +00:00
|
|
|
];
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
# setup.py will always (re-)execute cmake in buildPhase
|
|
|
|
dontConfigure = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
booleanoperations
|
|
|
|
fonttools
|
|
|
|
lxml # fonttools[lxml], defcon[lxml] extra
|
|
|
|
fs # fonttools[ufo] extra
|
|
|
|
unicodedata2 # fonttools[unicode] extra
|
|
|
|
brotlipy # fonttools[woff] extra
|
|
|
|
zopfli # fonttools[woff] extra
|
|
|
|
fontpens
|
|
|
|
brotli
|
|
|
|
defcon
|
|
|
|
fontmath
|
|
|
|
mutatormath
|
|
|
|
ufoprocessor
|
|
|
|
ufonormalizer
|
|
|
|
psautohint
|
2020-10-16 20:44:37 +00:00
|
|
|
tqdm
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2021-12-06 16:07:01 +00:00
|
|
|
preCheck = ''
|
|
|
|
export PATH=$PATH:$out/bin
|
|
|
|
|
|
|
|
# Update tests to match ufinormalizer-0.6.1 expectations:
|
|
|
|
# https://github.com/adobe-type-tools/afdko/issues/1418
|
|
|
|
find tests -name layerinfo.plist -delete
|
|
|
|
'';
|
2021-12-26 17:43:05 +00:00
|
|
|
disabledTests = lib.optionals (!runAllTests) [
|
2020-12-25 13:55:36 +00:00
|
|
|
# Disable slow tests, reduces test time ~25 %
|
|
|
|
"test_report"
|
|
|
|
"test_post_overflow"
|
|
|
|
"test_cjk"
|
|
|
|
"test_extrapolate"
|
|
|
|
"test_filename_without_dir"
|
|
|
|
"test_overwrite"
|
|
|
|
"test_options"
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isRiscV) [
|
2022-06-16 17:23:12 +00:00
|
|
|
# unknown reason so far
|
2021-12-26 17:43:05 +00:00
|
|
|
# https://github.com/adobe-type-tools/afdko/issues/1425
|
|
|
|
"test_spec"
|
2022-04-15 01:41:22 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isi686) [
|
|
|
|
"test_type1mm_inputs"
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ [
|
|
|
|
# No longer succeeds in 2023
|
|
|
|
# https://github.com/adobe-type-tools/afdko/issues/1589
|
|
|
|
"test_ufo_fontinfo_parsing"
|
2020-12-25 13:55:36 +00:00
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
passthru.tests = {
|
|
|
|
fullTestsuite = afdko.override { runAllTests = true; };
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Adobe Font Development Kit for OpenType";
|
|
|
|
homepage = "https://adobe-type-tools.github.io/afdko/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|