Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.05] ark-pixel-font: unbreak by suppressing debug logs, and remove extraneous builds #314417

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions pkgs/by-name/ar/ark-pixel-font/limit-builds.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/build.py b/build.py
index 48bc757d..88b9ed9b 100644
--- a/build.py
+++ b/build.py
@@ -1,6 +1,5 @@
from scripts import configs
from scripts.configs import path_define
-from scripts.services import publish_service, info_service, template_service, image_service
from scripts.services.font_service import DesignContext, FontContext
from scripts.utils import fs_util

@@ -21,21 +20,6 @@ def main():
font_context.make_pcf()
font_context.make_otc()
font_context.make_ttc()
- publish_service.make_release_zips(font_config, width_mode)
- info_service.make_info_file(design_context, width_mode)
- info_service.make_alphabet_txt_file(design_context, width_mode)
- template_service.make_alphabet_html_file(design_context, width_mode)
- template_service.make_demo_html_file(design_context)
- image_service.make_preview_image_file(font_config)
- template_service.make_index_html_file()
- template_service.make_playground_html_file()
- image_service.make_readme_banner()
- image_service.make_github_banner()
- image_service.make_itch_io_banner()
- image_service.make_itch_io_background()
- image_service.make_itch_io_cover()
- image_service.make_afdian_cover()
-

if __name__ == '__main__':
main()

10 changes: 9 additions & 1 deletion pkgs/by-name/ar/ark-pixel-font/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ python312Packages.buildPythonPackage rec {
gitpython
];

# By default build.py builds a LOT of extraneous artifacts we don't need.
patches = [ ./limit-builds.patch ];

buildPhase = ''
runHook preBuild

python build.py
# 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
'';
Expand All @@ -43,6 +48,9 @@ python312Packages.buildPythonPackage rec {
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
'';
Expand Down