From 089f23f446efd60623982b1f43b532cc7da8da53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 27 Nov 2025 07:54:57 +0000 Subject: [PATCH] wip static xxhash --- scripts/Makefile.static | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile.static b/scripts/Makefile.static index 5f21944..93c20b6 100644 --- a/scripts/Makefile.static +++ b/scripts/Makefile.static @@ -7,11 +7,20 @@ GZ = $(patsubst %,%.gz,$(SRCS)) .PHONY: all all: $(ZSTD) $(BR) $(GZ) -%.br: % - brotli $< +.SECONDARY: -%.zst: % - zstd -19 $< +%.br: %.xxhash + brotli -f $* -%.gz: % - zopfli $< +%.zst: %.xxhash + zstd -f -19 $* + +%.gz: %.xxhash + zopfli $* + +# https://github.com/gohugoio/hugo/issues/10842 +%.xxhash: % + current=$$(xxhsum $< | cut -d' ' -f1); \ + if [ ! -f $< ] || [ "$$(cat $@ 2>/dev/null)" != "$$current" ]; then \ + echo "$$current" > $@; \ + fi