carrier/windows/setup.sh

39 lines
1.4 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Windows build in one command. Run inside the MSYS2 MINGW64 shell from
# the carrier checkout: it installs the dependencies into MSYS2, clones
# fumi next to carrier if missing, builds, and bundles carrier plus the
# GTK runtime into dist/ and carrier-windows.zip.
#
# If MSYS2 updates its own core mid-run the shell may die — just rerun.
# Building and bundling live in windows/bundle.sh, shared with the
# forgejo Windows release job.
set -euo pipefail
say() { printf '\n==> %s\n' "$*"; }
die() { printf '\n!! %s\n' "$*" >&2; exit 1; }
[ -d ../fumi/core ] || {
say "fumi not found next to carrier — cloning it"
git clone ssh://git@code.randogoth.com:2222/randogoth/fumi.git ../fumi \
|| die "cloning fumi failed — check your SSH key in ~/.ssh"
}
say "installing dependencies (first run downloads several hundred MB)"
pacman -Syu --noconfirm || die "pacman update failed — reopen the shell and rerun this script"
pacman -S --noconfirm --needed \
mingw-w64-x86_64-gtk4 \
mingw-w64-x86_64-libadwaita \
mingw-w64-x86_64-adwaita-icon-theme \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-rust \
mingw-w64-x86_64-git \
zip \
|| die "installing the build stack failed"
pkg-config --exists gtk4 libadwaita-1 \
|| die "gtk4/libadwaita invisible to pkg-config — are you in the MINGW64 shell?"
bash windows/bundle.sh
say "done — test with ./dist/carrier.exe (SmartScreen may ask once)"