Files
ink-notes/scripts/package-windows.sh
T
haraldandClaude Opus 5.5 e5a8601f87 feat: Windows build and Android groundwork (Issues #48, #42)
Shared groundwork:
- paths.rs: folders for data, settings and downloads per system (Linux XDG
  unchanged, Windows %APPDATA%/%LOCALAPPDATA%, Android app folder)
- Linux-only parts behind cfg: Wayland on-screen keyboard (osk/wayland.rs),
  display backend and app id, the vendored winit touch extensions
- run_with(event_loop) so that other entry points can start the app

Windows (#48):
- cross-compiled with MinGW into a portable ink-notes_<version>_x86_64.exe
  (system DLLs only), no console window in release builds
- file picker: user folders and drives; held notebook locks are detected
  (ERROR_LOCK_VIOLATION)
- updater: replaces the running .exe via rename, active at the next start
- octotablet panicking without the Tablet PC components no longer crashes
  the app
- release: .exe built in CI and part of the signed checksums
- all library tests pass under wine

Android (#42):
- android_main entry point, winit with android-native-activity,
  android_logger; octotablet and arboard left out there
- cargo check and the cdylib build for aarch64-linux-android pass; the window
  surface does not follow the activity lifecycle yet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:13:37 +01:00

29 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# ==============================================================================
# Builds the portable Windows program target/ink-notes_<version>_x86_64.exe (Issue #48)
# by cross-compiling on Linux. Needs the MinGW-w64 compiler
# (Debian/Ubuntu: gcc-mingw-w64-x86-64) for the C parts of the dependencies.
# ==============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
cd "${ROOT_DIR}"
TARGET="x86_64-pc-windows-gnu"
VERSION=$(grep -m1 '^version = ' Cargo.toml | cut -d '"' -f2)
EXE_NAME="ink-notes_${VERSION}_x86_64.exe"
if ! command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
echo "FEHLER: x86_64-w64-mingw32-gcc nicht gefunden (Paket gcc-mingw-w64-x86-64)."
exit 1
fi
if command -v rustup >/dev/null 2>&1; then
rustup target add "${TARGET}"
fi
echo "=== Baue ${EXE_NAME} ==="
cargo build --release --target "${TARGET}"
cp "${CARGO_TARGET_DIR:-target}/${TARGET}/release/ink-notes.exe" "target/${EXE_NAME}"
ls -lh "target/${EXE_NAME}"