mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
aa7ba46ebb
For some reason build.py builds a lot of stuff that is completely unrelated to the fonts themselves. Let's remove that! Also the script is generating so much debug output that Hydra refuses to evaluate the package — my fix is to pipe the output through grep to filter out any log message below INFO, but I wish the script has a built-in way to set the log level so that I don't have to do this hack
68 lines
1.8 KiB
Nix
68 lines
1.8 KiB
Nix
{ lib
|
|
, python312Packages
|
|
, fetchFromGitHub
|
|
, nix-update-script
|
|
}:
|
|
|
|
python312Packages.buildPythonPackage rec {
|
|
pname = "ark-pixel-font";
|
|
version = "2024.05.12";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "TakWolf";
|
|
repo = "ark-pixel-font";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-PGhhKWHDpvOqa3vaI40wuIsAEdWGb62cN7QJeHQqiss=";
|
|
};
|
|
|
|
format = "other";
|
|
|
|
nativeBuildInputs = with python312Packages; [
|
|
pixel-font-builder
|
|
unidata-blocks
|
|
character-encoding-utils
|
|
pypng
|
|
pillow
|
|
beautifulsoup4
|
|
jinja2
|
|
gitpython
|
|
];
|
|
|
|
# By default build.py builds a LOT of extraneous artifacts we don't need.
|
|
patches = [ ./limit-builds.patch ];
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
# Too much debug output would break Hydra, so this jankness has to be here for it to build at all.
|
|
# I wish there's a builtin way to set the log level without modifying the script itself...
|
|
python3 build.py 2>&1 >/dev/null | grep -E '^(INFO|WARN|ERROR)'
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -Dm444 build/outputs/*.bdf -t $out/share/fonts/bdf
|
|
install -Dm444 build/outputs/*.otf -t $out/share/fonts/opentype
|
|
install -Dm444 build/outputs/*.ttf -t $out/share/fonts/truetype
|
|
install -Dm444 build/outputs/*.woff2 -t $out/share/fonts/woff2
|
|
install -Dm444 build/outputs/*.pcf -t $out/share/fonts/pcf
|
|
install -Dm444 build/outputs/*.otc -t $out/share/fonts/otc
|
|
install -Dm444 build/outputs/*.ttc -t $out/share/fonts/ttc
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "Open source pan-CJK pixel font";
|
|
homepage = "https://ark-pixel-font.takwolf.com/";
|
|
license = lib.licenses.ofl;
|
|
maintainers = with lib.maintainers; [ h7x4 ];
|
|
platforms = lib.platforms.all;
|
|
};
|
|
}
|