diff --git a/pkgs/development/python-modules/fonttools/default.nix b/pkgs/development/python-modules/fonttools/default.nix index f93a7bd2152b..d854d9126cbc 100644 --- a/pkgs/development/python-modules/fonttools/default.nix +++ b/pkgs/development/python-modules/fonttools/default.nix @@ -21,19 +21,20 @@ xattr, skia-pathops, uharfbuzz, + addBinToPathHook, pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "fonttools"; - version = "4.61.1"; + version = "4.63.0"; pyproject = true; src = fetchFromGitHub { owner = "fonttools"; repo = "fonttools"; - tag = version; - hash = "sha256-762bqAhOqqnuNSH8yFLTBnzYuigs716nt+uC1UwUqT4="; + tag = finalAttrs.version; + hash = "sha256-XTE18TKpIa4MpbJ5tcHwCyLk3Q6CV/ElzMtddG86HJA="; }; build-system = [ @@ -50,7 +51,7 @@ buildPythonPackage rec { (if isPyPy then brotlicffi else brotli) zopfli ]; - unicode = lib.optional (pythonOlder "3.13") unicodedata2; + unicode = lib.optional (pythonOlder "3.15") unicodedata2; graphite = [ lz4 ]; interpolatable = [ pycairo @@ -59,13 +60,14 @@ buildPythonPackage rec { plot = [ matplotlib ]; symfont = [ sympy ]; type1 = lib.optional stdenv.hostPlatform.isDarwin xattr; - pathops = lib.optional (lib.meta.availableOn stdenv.hostPlatform skia-pathops) skia-pathops; + pathops = [ skia-pathops ]; repacker = [ uharfbuzz ]; }; in extras // { all = lib.concatLists (lib.attrValues extras); }; nativeCheckInputs = [ + addBinToPathHook pytestCheckHook ] ++ lib.concatLists ( @@ -75,20 +77,17 @@ buildPythonPackage rec { # "interpolatable" is not included because it only contains 2 tests at the time of writing but adds 270 extra dependencies "ufo" ] - ++ lib.optionals (!skia-pathops.meta.broken) [ - "pathops" # broken - ] + ++ + lib.optionals (lib.meta.availableOn stdenv.hostPlatform skia-pathops && !skia-pathops.meta.broken) + [ + "pathops" # broken + ] ++ [ "repacker" ] - ) optional-dependencies + ) finalAttrs.passthru.optional-dependencies ); pythonImportsCheck = [ "fontTools" ]; - preCheck = '' - # tests want to execute the "fonttools" executable from $PATH - export PATH="$out/bin:$PATH" - ''; - # Timestamp tests have timing issues probably related # to our file timestamp normalization disabledTests = [ @@ -100,8 +99,8 @@ buildPythonPackage rec { meta = { homepage = "https://github.com/fonttools/fonttools"; description = "Library to manipulate font files from Python"; - changelog = "https://github.com/fonttools/fonttools/blob/${src.tag}/NEWS.rst"; + changelog = "https://github.com/fonttools/fonttools/blob/${finalAttrs.src.tag}/NEWS.rst"; license = lib.licenses.mit; maintainers = [ lib.maintainers.sternenseemann ]; }; -} +})