mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-13 11:30:35 +08:00
Hydra: https://hydra.nixos.org/build/316500429/nixlog/1 Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
68 lines
1.2 KiB
Nix
68 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
cython,
|
|
setuptools,
|
|
|
|
# dependencies
|
|
fontconfig,
|
|
freefont_ttf,
|
|
makeFontsConf,
|
|
|
|
# testing
|
|
dejavu_fonts,
|
|
python,
|
|
}:
|
|
|
|
let
|
|
fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
|
|
in
|
|
buildPythonPackage rec {
|
|
pname = "python-fontconfig";
|
|
version = "0.6.2";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "lilydjwg";
|
|
repo = "python-fontconfig";
|
|
tag = "v${version}";
|
|
hash = "sha256-4qxl5a9oKmhrF8O2OjA8X1wsHyEHL4ViRt20IcU/ANw=";
|
|
};
|
|
|
|
build-system = [
|
|
cython
|
|
setuptools
|
|
];
|
|
|
|
buildInputs = [ fontconfig ];
|
|
|
|
preBuild = ''
|
|
${python.pythonOnBuildForHost.interpreter} setup.py build_ext -i
|
|
'';
|
|
|
|
nativeCheckInputs = [ dejavu_fonts ];
|
|
|
|
preCheck = ''
|
|
export FONTCONFIG_FILE=${fontsConf};
|
|
'';
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
echo y | ${python.interpreter} test/test.py
|
|
runHook postCheck
|
|
'';
|
|
|
|
pythonImportsCheck = [ "fontconfig" ];
|
|
|
|
meta = {
|
|
homepage = "https://github.com/Vayn/python-fontconfig";
|
|
description = "Python binding for Fontconfig";
|
|
license = lib.licenses.gpl3Plus;
|
|
platforms = lib.platforms.all;
|
|
maintainers = [ ];
|
|
};
|
|
}
|