Files
noahandClaude Opus 5.5 be5edfc2bf Port the toolkit GUI to Windows (wxMSW, cross-built with mingw-w64)
Build: the wx-rs build script chose the platform with cfg!(), which in a
build script describes the build host, so a Linux-to-Windows build took the
GTK path. It now reads CARGO_CFG_TARGET_*, and Windows/GNU builds through
wx-config exactly like GTK, against a static wxMSW from
scripts/build-wx-windows.sh. The C++ runtime is linked statically, so the
.exe imports only Windows system DLLs. crates/alkane-gui/build.rs embeds an
application manifest (Common Controls v6, per-monitor DPI v2, UTF-8 code
page, Windows 10/11), the icon and version info.

Bridge on wxMSW (patches 0007/0008):
- the upstream frame's invisible "OSX key events" child sat above the UI on
  MSW and swallowed every click and key; it is no longer created there
- light/dark is chosen before the first window (wxMSW ignores it later) and
  follows the Windows app mode, with dark grid rules for the data view
- the generic wxDataViewCtrl gets mouse input in its inner main window, so
  drag-select and the per-cell / per-icon tooltips bind there (GTK keeps
  its native GtkTreeView paths; the icon hit-test is shared)
- sizes cross the Rust/C++ boundary in DIPs (identity on GTK), so columns,
  icons, KPI cards and the status bar scale at 125-200 %
- vector shapes go through GDI+ (anti-aliased like Cairo on GTK); selected
  rows use the themed list-view text colour like the native renderer
- the frame never opens larger than the monitor work area; title-bar icon
  from the executable; upstream menu insert no longer reads UTF-8 as UTF-16

App: OS differences live in alkane_core::platform (settings in
%APPDATA%\alkane-toolkit, owner-only secret files, NUL, console-less helper
processes). SSH password logins use SSH_ASKPASS with the toolkit itself as
the helper on every platform, replacing sshpass, which Windows lacks.
Release builds are GUI-subsystem; headless modes attach to the parent
console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:32:44 -06:00

59 lines
2.7 KiB
Bash
Executable File

#!/bin/sh
# Cross-build the vendored wxWidgets 3.3.3 for Windows (wxMSW, x86_64, static,
# monolithic) from Linux with mingw-w64. Mirrors build-wx-linux.sh: the repo
# tree stays pristine, the build lives in ~/.cache/wxbuild, and the result is a
# prefix whose bin/wx-config the wx-rs build script reads (WX_RS_WXCONFIG).
#
# Every third-party library wx needs is the copy bundled in the wx source tree
# ("builtin"), so the prefix needs nothing from the build host and the final
# .exe needs no DLLs beyond the ones Windows itself ships. TIFF and WebP are
# off: the app never loads either format.
#
# Needs: mingw-w64 (the posix-threads g++ variant), make.
set -e
REPO=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
SRC="$REPO/thirdparty/wxwidgets/wxWidgets-3.3.3"
HOST=x86_64-w64-mingw32
BUILD="$HOME/.cache/wxbuild/wxWidgets-3.3.3-mingw"
PREFIX="${WX_WINDOWS_PREFIX:-$HOME/.cache/wx-3.3.3-mingw}"
# std::thread/std::mutex need the posix thread model; Debian's default
# x86_64-w64-mingw32-g++ alternative is the win32 model.
CC="${WX_WINDOWS_CC:-$HOST-gcc-posix}"
CXX="${WX_WINDOWS_CXX:-$HOST-g++-posix}"
command -v "$CXX" >/dev/null || { echo "$CXX not found (apt install mingw-w64)"; exit 1; }
cleanup_wx_build() {
python3 - "$BUILD" "$HOME/.cache/wxbuild" <<'PY'
from pathlib import Path
import shutil
import sys
build, parent = map(Path, sys.argv[1:])
if (build.name != "wxWidgets-3.3.3-mingw" or build.parent != parent
or build.is_symlink() or parent.is_symlink()):
raise SystemExit("refusing unsafe wxWidgets build cleanup path")
if build.is_dir():
shutil.rmtree(build)
PY
}
trap cleanup_wx_build 0
[ -d "$SRC" ] || { echo "thirdparty wxWidgets tree missing"; exit 1; }
[ -d "$BUILD" ] || { mkdir -p "$HOME/.cache/wxbuild"; cp -r "$SRC" "$BUILD"; }
chmod +x "$BUILD/configure" "$BUILD/config.guess" "$BUILD/config.sub" "$BUILD/install-sh" 2>/dev/null || true
mkdir -p "$BUILD/build-msw"
cd "$BUILD/build-msw"
# --enable-unicode is the 3.3 default. wxUSE_RC_MANIFEST/DPI awareness are
# handled by the application's own resource script (crates/alkane-gui/build.rs),
# not here, so the library stays policy-free.
sh ../configure --host="$HOST" --build="$(sh ../config.guess)" \
--prefix="$PREFIX" CC="$CC" CXX="$CXX" \
--disable-shared --enable-monolithic --with-msw \
--with-opengl=no --disable-stc --disable-tests --disable-webview \
--with-libpng=builtin --with-libjpeg=builtin --with-regex=builtin \
--with-zlib=builtin --with-expat=builtin \
--without-libtiff --without-libwebp --without-liblzma
make -j"${WX_BUILD_JOBS:-$(nproc)}"
make install
ls "$PREFIX"/lib/libwx_mswu-3.3-"$HOST".a >/dev/null
echo "installed: $PREFIX ($("$PREFIX/bin/wx-config" --version) $("$PREFIX/bin/wx-config" --selected-config))"