From bcee192ea5260509d3ca398fdc84ef64dc31354b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 18 Jun 2026 14:58:08 -0700 Subject: [PATCH 1/4] python3Packages.fontpens: 0.3.0 -> 0.4.0 Diff: https://github.com/robotools/fontpens/compare/v0.3.0...v0.4.0 Changelog: https://github.com/robotools/fontPens/releases/tag/v0.4.0 --- .../python-modules/fontpens/default.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/fontpens/default.nix b/pkgs/development/python-modules/fontpens/default.nix index 0ed674c0de5a..480fd2feaca8 100644 --- a/pkgs/development/python-modules/fontpens/default.nix +++ b/pkgs/development/python-modules/fontpens/default.nix @@ -3,22 +3,26 @@ buildPythonPackage, fetchFromGitHub, fonttools, - setuptools, + hatch-vcs, + hatchling, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "fontpens"; - version = "0.3.0"; + version = "0.4.0"; pyproject = true; src = fetchFromGitHub { owner = "robotools"; repo = "fontpens"; - tag = "v${version}"; - sha256 = "13msj0s7mg45klzbnd2w4f4ljb16bp9m0s872s6hczn0j7jmyz11"; + tag = "v${finalAttrs.version}"; + hash = "sha256-K768vbhacnuSRlmC3QG+7p+y8QiBtvqETvCYOuO1IxM="; }; - build-system = [ setuptools ]; + build-system = [ + hatch-vcs + hatchling + ]; dependencies = [ fonttools ]; @@ -43,9 +47,10 @@ buildPythonPackage rec { ]); meta = { + changelog = "https://github.com/robotools/fontPens/releases/tag/${finalAttrs.src.tag}"; description = "Collection of classes implementing the pen protocol for manipulating glyphs"; homepage = "https://github.com/robotools/fontPens"; license = lib.licenses.bsd3; maintainers = [ lib.maintainers.sternenseemann ]; }; -} +}) From 917e5f65050d6662af05c288c090003c9a1c270c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 19 Jun 2026 09:53:13 -0700 Subject: [PATCH 2/4] python3Packages.booleanoperations: 0.9.0 -> 0.10.0 Diff: https://github.com/typemytype/booleanOperations/compare/0.9.0...0.10.0 Changelog: https://github.com/typemytype/booleanOperations/releases/tag/0.10.0 --- .../booleanoperations/default.nix | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/booleanoperations/default.nix b/pkgs/development/python-modules/booleanoperations/default.nix index f0d01e3756e5..caab5892715f 100644 --- a/pkgs/development/python-modules/booleanoperations/default.nix +++ b/pkgs/development/python-modules/booleanoperations/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, fonttools, pyclipper, defcon, @@ -11,16 +11,16 @@ pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "booleanoperations"; - version = "0.9.0"; + version = "0.10.0"; pyproject = true; - src = fetchPypi { - pname = "booleanOperations"; - inherit version; - hash = "sha256-jPqCHDKtN0+hINay4LRE6+rFfJHmYxUoZF+hmsKigbg="; - extension = "zip"; + src = fetchFromGitHub { + owner = "typemytype"; + repo = "booleanOperations"; + tag = finalAttrs.version; + hash = "sha256-IJyb6g2xwWj82Vm33Mtkqen1X/w0tSaP+Q/DtFc8Dd4="; }; build-system = [ @@ -41,22 +41,11 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = [ - # started failing with fonttools update from 4.55.3 -> 4.56.0 - "test_QTail_reversed_difference" - "test_QTail_reversed_intersection" - "test_QTail_reversed_union" - "test_QTail_reversed_xor" - "test_Q_difference" - "test_Q_intersection" - "test_Q_union" - "test_Q_xor" - ]; - meta = { + changelog = "https://github.com/typemytype/booleanOperations/releases/tag/${finalAttrs.src.tag}"; description = "Boolean operations on paths"; homepage = "https://github.com/typemytype/booleanOperations"; license = lib.licenses.mit; maintainers = [ lib.maintainers.sternenseemann ]; }; -} +}) From a95fcb976497422a1df26883b7d3907470c55543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 19 Jun 2026 09:46:46 -0700 Subject: [PATCH 3/4] python3Packages.fontparts: 0.13.1 -> 1.0.0 Diff: https://github.com/robotools/fontParts/compare/0.13.1...1.0.0 Changelog: https://github.com/robotools/fontParts/releases/tag/1.0.0 --- .../python-modules/fontparts/default.nix | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/fontparts/default.nix b/pkgs/development/python-modules/fontparts/default.nix index b48b195a423c..bc6b8c1e797a 100644 --- a/pkgs/development/python-modules/fontparts/default.nix +++ b/pkgs/development/python-modules/fontparts/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, # build-system setuptools, @@ -17,17 +17,23 @@ python, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "fontparts"; - version = "0.13.1"; + version = "1.0.0"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-+oifxmY7MUkQj3Sy75wjRmoVEPkgZaO3+8/sauMMxYA="; - extension = "zip"; + src = fetchFromGitHub { + owner = "robotools"; + repo = "fontParts"; + tag = finalAttrs.version; + hash = "sha256-dBR9Lf8ECLAOAkEkEy4JCgOKmyXzwXaOXdW4cErWQcs="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail ', "vcs-versioning"' "" + ''; + build-system = [ setuptools setuptools-scm @@ -44,6 +50,8 @@ buildPythonPackage rec { ++ fonttools.optional-dependencies.lxml ++ fonttools.optional-dependencies.unicode; + pythonImportsCheck = [ "fontParts" ]; + checkPhase = '' runHook preCheck ${python.interpreter} Lib/fontParts/fontshell/test.py @@ -53,8 +61,8 @@ buildPythonPackage rec { meta = { description = "API for interacting with the parts of fonts during the font development process"; homepage = "https://github.com/robotools/fontParts"; - changelog = "https://github.com/robotools/fontParts/releases/tag/${version}"; + changelog = "https://github.com/robotools/fontParts/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = [ lib.maintainers.sternenseemann ]; }; -} +}) From deff7230186bd8b7253ae0f5b2b6860a5370cf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 14 Apr 2026 14:25:26 -0700 Subject: [PATCH 4/4] python3Packages.afdko: 4.0.2 -> 5.0.1 Diff: https://github.com/adobe-type-tools/afdko/compare/4.0.2...5.0.1 Changelog: https://github.com/adobe-type-tools/afdko/blob/5.0.1/NEWS.md --- .../python-modules/afdko/default.nix | 84 +++++++------------ .../afdko/dont-fetch-third-party-libs.patch | 12 +++ .../afdko/no-pypi-build-tools.patch | 24 ------ .../use-dynamic-system-antlr4-runtime.patch | 67 +++++---------- 4 files changed, 62 insertions(+), 125 deletions(-) create mode 100644 pkgs/development/python-modules/afdko/dont-fetch-third-party-libs.patch delete mode 100644 pkgs/development/python-modules/afdko/no-pypi-build-tools.patch diff --git a/pkgs/development/python-modules/afdko/default.nix b/pkgs/development/python-modules/afdko/default.nix index c1df13372fc1..1053d44c328f 100644 --- a/pkgs/development/python-modules/afdko/default.nix +++ b/pkgs/development/python-modules/afdko/default.nix @@ -1,25 +1,28 @@ { lib, stdenv, + addBinToPathHook, antlr4_13, booleanoperations, buildPythonPackage, cmake, + cython, defcon, fetchFromGitHub, - fetchpatch, fontmath, fonttools, libxml2, lxml, + mypy, ninja, pytestCheckHook, runAllTests ? false, - scikit-build, + scikit-build-core, setuptools-scm, tqdm, ufonormalizer, ufoprocessor, + uharfbuzz, # passthru afdko, @@ -27,22 +30,33 @@ buildPythonPackage (finalAttrs: { pname = "afdko"; - version = "4.0.2"; + version = "5.0.1"; pyproject = true; src = fetchFromGitHub { owner = "adobe-type-tools"; repo = "afdko"; tag = finalAttrs.version; - hash = "sha256:0955dvbydifhgx9gswbf5drsmmghry7iyf6jwz6qczhj86clswcm"; + hash = "sha256:sha256-ts7vFfbPPrdooOH0JYrn3YKs7kRju4LbZ8Ypd3ExELc="; }; - build-system = [ setuptools-scm ]; + postPatch = '' + # https://github.com/NixOS/nixpkgs/pull/510112#issuecomment-4263642029 + substituteInPlace CMakeLists.txt \ + --replace-fail 'cmake_minimum_required(VERSION 3.16)' "cmake_minimum_required(VERSION 3.16) + find_package(LibXml2 REQUIRED)" + ''; - nativeBuildInputs = [ - scikit-build + build-system = [ cmake + cython ninja + scikit-build-core + setuptools-scm + ]; + + cmakeFlags = [ + "-DANTLR4_INCLUDE_DIRS=${lib.getDev antlr4_13.runtime.cpp}/include/antlr4-runtime" ]; buildInputs = [ @@ -51,37 +65,19 @@ buildPythonPackage (finalAttrs: { ]; patches = [ - # Don't try to install cmake and ninja using pip - ./no-pypi-build-tools.patch + ./dont-fetch-third-party-libs.patch # Use antlr4 runtime from nixpkgs and link it dynamically ./use-dynamic-system-antlr4-runtime.patch - - # Fix tests - # FIXME: remove in 5.0 - (fetchpatch { - url = "https://github.com/adobe-type-tools/afdko/commit/3b78bea15245e2bd2417c25ba5c2b8b15b07793c.patch"; - excludes = [ - "CMakeLists.txt" - "requirements.txt" - ]; - hash = "sha256-Ao5AUVm1h4a3qidqlBFWdC7jiXyBfXQEnsT7XsXXXRU="; - }) ]; env = { + FORCE_SYSTEM_ANTLR4 = true; # Use system libxml2 FORCE_SYSTEM_LIBXML2 = true; - } - // lib.optionalAttrs stdenv.cc.isClang { - NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=incompatible-function-pointer-types" - "-Wno-error=int-conversion" - ]; }; - # setup.py will always (re-)execute cmake in buildPhase - dontConfigure = true; + dontUseCmakeConfigure = true; dependencies = [ booleanoperations @@ -100,34 +96,14 @@ buildPythonPackage (finalAttrs: { ++ fonttools.optional-dependencies.unicode ++ fonttools.optional-dependencies.woff; - postInstall = '' - # clean up the install directory - # 5.0.0 release revamps the build system and hopefully makes this unnecessary - rm -r $out/{_skbuild,c,tests} - ''; - - nativeCheckInputs = [ pytestCheckHook ]; - - preCheck = '' - export PATH=$PATH:$out/bin - - # Remove build artifacts to prevent them from messing with the tests - rm -r _skbuild - ''; + nativeCheckInputs = [ + addBinToPathHook + mypy + pytestCheckHook + uharfbuzz + ]; disabledTests = [ - # broke in the fontforge 4.51 -> 4.53 update - "test_glyphs_2_7" - "test_hinting_data" - "test_waterfallplot" - # broke at some point - "test_type1_supported_hint" - ] - ++ lib.optionals (stdenv.cc.isGNU) [ - # broke in the gcc 13 -> 14 update - "test_dump" - "test_input_formats" - "test_other_input_formats" ] ++ lib.optionals (!runAllTests) [ # Disable slow tests, reduces test time ~25 % diff --git a/pkgs/development/python-modules/afdko/dont-fetch-third-party-libs.patch b/pkgs/development/python-modules/afdko/dont-fetch-third-party-libs.patch new file mode 100644 index 000000000000..48e4ce99fcfe --- /dev/null +++ b/pkgs/development/python-modules/afdko/dont-fetch-third-party-libs.patch @@ -0,0 +1,12 @@ +diff --git a/third_party/LibXml2/CMakeLists.txt b/third_party/LibXml2/CMakeLists.txt +index 2549e5f0..8835658f 100644 +--- a/third_party/LibXml2/CMakeLists.txt ++++ b/third_party/LibXml2/CMakeLists.txt +@@ -12,6 +12,7 @@ FetchContent_Declare(LibXml2 + GIT_REPOSITORY https://gitlab.gnome.org/GNOME/libxml2.git + GIT_TAG ${LIBXML2_TAG} + EXCLUDE_FROM_ALL ++ ${fetch_content_args} + ) + + option(AFDKO_BUILD_LIBXML2_SHARED_LIB diff --git a/pkgs/development/python-modules/afdko/no-pypi-build-tools.patch b/pkgs/development/python-modules/afdko/no-pypi-build-tools.patch deleted file mode 100644 index a3ef7dd23b85..000000000000 --- a/pkgs/development/python-modules/afdko/no-pypi-build-tools.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit a5fde72bd15e0baba008ea54270a1ffe017544a0 -Author: sternenseemann -Date: Tue Oct 5 18:17:20 2021 +0200 - - Don't use pypi distributions of build tools - - We want to use regular cmake and ninja and not the pypi projects which - somehow wrap and vendor a version of the proper tool. - -diff --git a/setup.py b/setup.py -index 973e2826..dba58766 100644 ---- a/setup.py -+++ b/setup.py -@@ -198,9 +198,7 @@ def main(): - setup_requires=[ - 'wheel', - 'setuptools_scm', -- 'scikit-build', -- 'cmake', -- 'ninja' -+ 'scikit-build' - ], - tests_require=[ - 'pytest', diff --git a/pkgs/development/python-modules/afdko/use-dynamic-system-antlr4-runtime.patch b/pkgs/development/python-modules/afdko/use-dynamic-system-antlr4-runtime.patch index d2184e8d2804..df574f96d89c 100644 --- a/pkgs/development/python-modules/afdko/use-dynamic-system-antlr4-runtime.patch +++ b/pkgs/development/python-modules/afdko/use-dynamic-system-antlr4-runtime.patch @@ -1,53 +1,26 @@ -commit 3560653d5d52bf30a52ce971ecfe262b1a09d7a3 -Author: sternenseemann -Date: Tue Oct 5 18:16:10 2021 +0200 - - Link against system antlr4 runtime, dynamically - - Instead of cloning a antlr4 version from git, use the system one. Also - don't link it statically, but dynamically by default (the library is - called antlr4-runtime, not antlr4_static). - diff --git a/CMakeLists.txt b/CMakeLists.txt -index 88e9cfd0..3df902b4 100644 +index e6b30c83..ec74fd5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -36,11 +36,10 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - # https://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip - # set(ANTLR4_ZIP_REPOSITORY "/path_to_antlr4_archive/a4.zip") +@@ -134,7 +134,7 @@ add_subdirectory(c/spot) + add_subdirectory(c/type1) + add_subdirectory(c/addfeatures) --add_definitions(-DANTLR4CPP_STATIC) - set(ANTLR4_WITH_STATIC_CRT OFF) --# 4.9.3 is the latest ANTLR4 version - set(ANTLR4_TAG tags/4.13.2) --include(ExternalAntlr4Cpp) -+find_path(ANTLR4_HEADER antlr4-runtime.h PATH_SUFFIXES antlr4-runtime) -+set(ANTLR4_INCLUDE_DIRS ${ANTLR4_HEADER}) +-target_link_libraries(_internal PRIVATE afdko_version detype1 type1 addfeatures spot sfntedit sfntdiff mergefonts rotatefont shared afdko::antlr4) ++target_link_libraries(_internal PRIVATE afdko_version detype1 type1 addfeatures spot sfntedit sfntdiff mergefonts rotatefont shared antlr4-runtime) + if(CMAKE_USE_PTHREADS_INIT) + target_link_libraries(_internal PRIVATE Threads::Threads) +diff --git a/c/addfeatures/hotconv/CMakeLists.txt b/c/addfeatures/hotconv/CMakeLists.txt +index 7e281af9..f7100558 100644 +--- a/c/addfeatures/hotconv/CMakeLists.txt ++++ b/c/addfeatures/hotconv/CMakeLists.txt +@@ -72,7 +72,7 @@ target_include_directories(hotconv BEFORE PRIVATE $<$:${AN + target_include_directories(hotconv AFTER PRIVATE ../include ../../shared/resource) + # Because hotconv is an object library, all this should do is + # establish the build dependency +-target_link_libraries(hotconv PUBLIC afdko::antlr4 shared) ++target_link_libraries(hotconv PUBLIC antlr4-runtime shared) - if (DEFINED ENV{FORCE_BUILD_LIBXML2}) -diff --git a/c/makeotf/lib/cffread/CMakeLists.txt b/c/makeotf/lib/cffread/CMakeLists.txt -index 2990035f..fab25a77 100644 ---- a/c/makeotf/lib/cffread/CMakeLists.txt -+++ b/c/makeotf/lib/cffread/CMakeLists.txt -@@ -8,6 +8,6 @@ if (${NEED_LIBXML2_DEPEND}) - add_dependencies(makeotf_cffread ${LIBXML2_TARGET}) - endif() - --target_link_libraries(makeotf_cffread PUBLIC antlr4_static) -+target_link_libraries(makeotf_cffread PUBLIC antlr4-runtime) - - target_compile_definitions(makeotf_cffread PRIVATE $<$:CFF_DEBUG=1> CFF_T13_SUPPORT=0) -diff --git a/c/makeotf/lib/hotconv/CMakeLists.txt b/c/makeotf/lib/hotconv/CMakeLists.txt -index 60e49458..ada728c0 100644 ---- a/c/makeotf/lib/hotconv/CMakeLists.txt -+++ b/c/makeotf/lib/hotconv/CMakeLists.txt -@@ -70,7 +70,7 @@ add_library(hotconv STATIC - set_property(TARGET hotconv PROPERTY C_STANDARD 99) - set_property(TARGET hotconv PROPERTY CXX_STANDARD 17) - target_include_directories(hotconv PRIVATE AFTER $<$:${ANTLR4_INCLUDE_DIRS}>) --target_link_libraries(hotconv PUBLIC antlr4_static) -+target_link_libraries(hotconv PUBLIC antlr4-runtime) - - target_link_libraries(hotconv PUBLIC ${CHOSEN_LIBXML2_LIBRARY}) - + if ( CMAKE_COMPILER_IS_GNUCC ) + set_property(TARGET hotconv APPEND PROPERTY