aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 16:27:28 +0100
committereunhhu <[email protected]>2026-09-28 16:27:28 +0100
commit96c35e7919e5e25187bd5adedda516a32cfc8639 (patch)
tree73419274bd29afe2ef552825ba94e1c083953008 /Makefile
parentfb8e49a31a7ba7f333965c93b08bd0c58120494e (diff)
downloadvega-96c35e7919e5e25187bd5adedda516a32cfc8639.tar.gz
vega-96c35e7919e5e25187bd5adedda516a32cfc8639.zip
Follow HarfBuzz and Unicode with one command
text/upstream.py brings in a HarfBuzz release (default: the one the build links) and the UCD of the Unicode version its tables came from, builds that HarfBuzz as one static library from its amalgamated source (no system package, any version), regenerates the Unicode tables and the syllabic ones, holds the syllable machines to HarfBuzz's compiled ones, and runs the text checks built against it: Unicode's conformance tests on that UCD, random shaping against that HarfBuzz, the layout's promises, the kern class tests, HarfBuzz's own suite. --corpus adds every installed font (text/fonts.py, the corpus runner, now in the tree). What a new version breaks shows as failing checks with the font and the input to port a fix from; the generated files are left changed for review. make check-text is those checks alone; UCD and HARFBUZZ_SRC default to build/upstream's when the tool fetched them. Its first run found that text/shape-build.c used clock_gettime without asking for POSIX, building only because the system HarfBuzz's headers did. Against HarfBuzz 10.2.0 built from source and the 16.0.0 UCD, every check passes in about a minute.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 17 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 94b7ac7..cedcb17 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ LIBPURE = $(PURE)/build/libpure.a
SURFACES = surfaces/screen.c surfaces/draw.c surfaces/width.c surfaces/web.c surfaces/pixels.c surfaces/display.c \
surfaces/input.c surfaces/hangul.c surfaces/dbus.c surfaces/access.c surfaces/main.c
-.PHONY: all check check-harfbuzz FORCE
+.PHONY: all check check-text check-harfbuzz FORCE
all: $(BUILD)/vega $(BUILD)/vega-symbols $(BUILD)/vega-surface.so
$(BUILD):
@@ -69,29 +69,35 @@ $(BUILD)/test-layout: text/test-layout.c $(LAYOUT) text/layout.h text/shape.h te
symbols/symbols.h | $(BUILD)
$(CC) $(CPPFLAGS) $(CFLAGS) -Itext -Isymbols text/test-layout.c $(LAYOUT) symbols/symbols.c $(LDFLAGS) -lm $(LDLIBS) -o $@
-# Unicode's conformance tests, where the UCD is installed (Debian: unicode-data);
-# and shaping, where DejaVu Sans is: the build refuses a file whose shaping
-# differs from HarfBuzz's on random runs of Latin, Greek, Cyrillic, Hebrew,
-# Arabic and Common text, both ways.
-UCD ?= /usr/share/unicode
+# Unicode's conformance tests, on the UCD the tables were made from: the one
+# text/upstream.py fetches into build/upstream, else the installed one
+# (Debian: unicode-data), which test-text passes over when its version is
+# not the tables'. And shaping, where DejaVu Sans is: the build refuses a
+# file whose shaping differs from HarfBuzz's on random runs of Latin, Greek,
+# Cyrillic, Hebrew, Arabic and Common text, both ways.
+UNICODE_VERSION := $(shell sed -n '1s/.*Database \([0-9.]*\):.*/\1/p' text/unicode-data.c)
+UCD ?= $(if $(wildcard build/upstream/ucd-$(UNICODE_VERSION)/ReadMe.txt),build/upstream/ucd-$(UNICODE_VERSION),/usr/share/unicode)
SHAPED_FONT ?= /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
SHAPED_CODES = 0x20-0x7e,0xa0-0x24f,0x300-0x36f,0x370-0x3ff,0x400-0x4ff,0x591-0x5f4,0x600-0x6ff,0x2000-0x206f
# HarfBuzz's own shaping tests, where a HarfBuzz release's source is
-# (HARFBUZZ_SRC: the same version the build links): each case shaped by
-# Vega and by HarfBuzz must agree, but for those text/harfbuzz-suite.known
-# lists.
-HARFBUZZ_SRC ?=
+# (HARFBUZZ_SRC: the same version the build links; build/upstream's, when
+# text/upstream.py fetched one): each case shaped by Vega and by HarfBuzz
+# must agree, but for those text/harfbuzz-suite.known lists.
+HARFBUZZ_SRC ?= $(lastword $(wildcard build/upstream/harfbuzz-*))
check-harfbuzz: $(BUILD)/vega-symbols
if [ -d "$(HARFBUZZ_SRC)/test/shape/data" ]; then python3 text/harfbuzz-suite.py $(HARFBUZZ_SRC) $(BUILD)/vega-symbols; \
else echo "no HarfBuzz source at HARFBUZZ_SRC: its test suite skipped"; fi
-check: $(BUILD)/vega $(BUILD)/vega-symbols $(BUILD)/vega-surface.so $(BUILD)/test-text $(BUILD)/test-layout check-harfbuzz
+# What text/upstream.py runs against a new HarfBuzz and UCD: the text alone.
+check-text: $(BUILD)/vega-symbols $(BUILD)/test-text $(BUILD)/test-layout check-harfbuzz
if [ -f $(UCD)/BidiTest.txt ]; then $(BUILD)/test-text $(UCD); else echo "no UCD at $(UCD): text tests skipped"; fi
if [ -f $(SHAPED_FONT) ]; then $(BUILD)/vega-symbols build --font $(SHAPED_FONT) --codes $(SHAPED_CODES) \
--shape Latn,Grek,Cyrl,Hebr,Arab,Zyyy --runs 5000 -o $(BUILD)/shaped.vsym && \
$(BUILD)/test-layout $(BUILD)/shaped.vsym; else echo "no $(SHAPED_FONT): shaping tests skipped"; fi
if [ -f $(SHAPED_FONT) ] && python3 -c 'import fontTools' 2>/dev/null; then \
python3 text/test-kern.py $(BUILD)/vega-symbols $(SHAPED_FONT); else echo "no fontTools: kern class tests skipped"; fi
+
+check: $(BUILD)/vega $(BUILD)/vega-surface.so check-text
$(MAKE) -C $(AUP) build/aup
$(MAKE) -C $(PURE) build/pure-serve
python3 tests/check.py --vega $(BUILD)/vega --symbols $(BUILD)/vega-symbols --aup $(AUP)/build/aup --serve $(PURE)/build/pure-serve