2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
buildPythonPackage,
|
|
|
|
cython,
|
|
|
|
fetchPypi,
|
|
|
|
fetchpatch,
|
|
|
|
fontconfig,
|
|
|
|
freefont_ttf,
|
|
|
|
lib,
|
|
|
|
makeFontsConf,
|
|
|
|
python,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
|
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "python-fontconfig";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "0.5.1";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "Python-fontconfig";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "154rfd0ygcbj9y8m32n537b457yijpfx9dvmf76vi0rg4ikf7kxp";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ fontconfig ];
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preBuild = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
${python.pythonOnBuildForHost.interpreter} setup.py build_ext -i
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export FONTCONFIG_FILE=${fontsConf};
|
|
|
|
echo y | ${python.interpreter} test/test.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/Vayn/python-fontconfig";
|
|
|
|
description = "Python binding for Fontconfig";
|
|
|
|
license = lib.licenses.gpl3;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|