Stage Qt static dependency archives

ober

2dc69a3f6b06127dacd0942184e8d2f170712921

diff --git a/Dockerfile.qt b/Dockerfile.qt
index c4b5d81..8eb6882 100644
--- a/Dockerfile.qt
+++ b/Dockerfile.qt
@@ -223,6 +223,20 @@ RUN mkdir -p /opt/tree-sitter-grammars && \
     build_grammar scheme     6cdh/tree-sitter-scheme            main && \
     echo "Grammars built:" && ls /opt/tree-sitter-grammars/
 
+# ── Phase 6: Stage Qt transitive static deps for the final link ─────────
+RUN mkdir -p /opt/qt-static-deps/lib && \
+    for lib in \
+      libpng.a libharfbuzz.a libfreetype.a libfontconfig.a libxkbcommon.a \
+      libxkbcommon-x11.a libgraphite2.a libbz2.a libbrotlidec.a \
+      libbrotlicommon.a libexpat.a libXau.a libXdmcp.a libxcb-util.a \
+      libxcb-cursor.a libxcb-icccm.a libxcb-image.a libxcb-keysyms.a \
+      libxcb-randr.a libxcb-render-util.a libxcb-shm.a libxcb-sync.a \
+      libxcb-xfixes.a libxcb-render.a libxcb-shape.a libxcb-xkb.a \
+      libxcb.a libX11-xcb.a libX11.a; do \
+        test -f "/usr/lib/$lib" || { echo "missing static Qt dependency: $lib" >&2; exit 1; }; \
+        cp -a "/usr/lib/$lib" /opt/qt-static-deps/lib/; \
+    done
+
 # ── Stage 1.5: Compile libqt_shim.a with musl-compatible Alpine g++ ──────────
 # Separate stage so Qt6 cache is preserved when qt_shim.cpp changes
 FROM qt-alpine AS qt-shim-alpine
@@ -266,6 +280,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
 
 # Copy Qt6 static libs and tools from Alpine stage
 COPY --from=qt-alpine /opt/qt6-static /opt/qt6-static
+COPY --from=qt-alpine /opt/qt-static-deps/lib/ /usr/local/lib/
 
 # Copy tree-sitter from Alpine stage
 COPY --from=qt-alpine /opt/tree-sitter-lib /opt/tree-sitter-lib