From 66fd70a9faa3599b82e3fe1beca88083d9d17b1a Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Sun, 26 May 2024 10:10:01 +0800 Subject: [PATCH] python312Packages.python-fontconfig: fix build --- .../python-fontconfig/default.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/python-fontconfig/default.nix b/pkgs/development/python-modules/python-fontconfig/default.nix index 2f90ca56dac6..314f733ca170 100644 --- a/pkgs/development/python-modules/python-fontconfig/default.nix +++ b/pkgs/development/python-modules/python-fontconfig/default.nix @@ -1,12 +1,13 @@ { - lib, buildPythonPackage, - fetchPypi, - fontconfig, - python, cython, + fetchPypi, + fetchpatch, + fontconfig, freefont_ttf, + lib, makeFontsConf, + python, }: let @@ -25,6 +26,16 @@ buildPythonPackage rec { buildInputs = [ fontconfig ]; nativeBuildInputs = [ cython ]; + patches = [ + # distutils has been removed since python 3.12 + # See https://github.com/vayn/python-fontconfig/pull/10 + (fetchpatch { + name = "no-distutils.patch"; + url = "https://github.com/vayn/python-fontconfig/commit/15e1a72c90e93a665569e0ba771ae53c7c8020c8.patch"; + hash = "sha256-2mAemltWh3+LV4FDOg6uSD09zok3Eyd+v1WJJdouOV8="; + }) + ]; + preBuild = '' ${python.pythonOnBuildForHost.interpreter} setup.py build_ext -i '';