2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
|
|
|
, pythonOlder
|
|
|
|
, fonttools
|
|
|
|
, defcon
|
|
|
|
, lxml
|
|
|
|
, fs
|
|
|
|
, unicodedata2
|
|
|
|
, zopfli
|
|
|
|
, brotlipy
|
|
|
|
, fontpens
|
|
|
|
, brotli
|
|
|
|
, fontmath
|
|
|
|
, mutatormath
|
|
|
|
, booleanoperations
|
|
|
|
, ufoprocessor
|
|
|
|
, ufonormalizer
|
|
|
|
, psautohint
|
|
|
|
, tqdm
|
|
|
|
, setuptools-scm
|
|
|
|
, scikit-build
|
2021-12-26 17:43:05 +00:00
|
|
|
, cmake
|
2023-10-09 19:29:22 +00:00
|
|
|
, ninja
|
2021-12-26 17:43:05 +00:00
|
|
|
, 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";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "3.9.3";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "pyproject";
|
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;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-v0fIhf3P5Xjdn5/ryRNj0Q2YHAisMqi5RTmJQabaUO0=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
scikit-build
|
|
|
|
cmake
|
2023-10-09 19:29:22 +00:00
|
|
|
ninja
|
2021-12-26 17:43:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
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
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
# Use system libxml2
|
|
|
|
FORCE_SYSTEM_LIBXML2 = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
preCheck = ''
|
|
|
|
export PATH=$PATH:$out/bin
|
|
|
|
'';
|
2023-01-20 10:41:00 +00:00
|
|
|
|
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) [
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_dump_option"
|
2022-04-15 01:41:22 +00:00
|
|
|
"test_type1mm_inputs"
|
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; {
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/adobe-type-tools/afdko/blob/${version}/NEWS.md";
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Adobe Font Development Kit for OpenType";
|
2023-01-20 10:41:00 +00:00
|
|
|
homepage = "https://adobe-type-tools.github.io/afdko";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|