feat: add a one-command windows build script
This commit is contained in:
parent
080b47b24f
commit
65c0ad2c77
3 changed files with 78 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -7,3 +7,5 @@ result-*
|
||||||
*.db
|
*.db
|
||||||
*.db-wal
|
*.db-wal
|
||||||
*.db-shm
|
*.db-shm
|
||||||
|
/dist
|
||||||
|
carrier-windows-*.zip
|
||||||
|
|
|
||||||
15
README.md
15
README.md
|
|
@ -53,3 +53,18 @@ The result is installed into the user flatpak and runs as
|
||||||
`flatpak run com.randogoth.carrier`. Inside the sandbox the app keeps its
|
`flatpak run com.randogoth.carrier`. Inside the sandbox the app keeps its
|
||||||
config under `~/.var/app/com.randogoth.carrier/config/carrier`, so a flatpak
|
config under `~/.var/app/com.randogoth.carrier/config/carrier`, so a flatpak
|
||||||
install starts with a fresh identity rather than the dev build's account.
|
install starts with a fresh identity rather than the dev build's account.
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Install MSYS2 (`winget install MSYS2.MSYS2`), open the **MSYS2 MINGW64**
|
||||||
|
shell, and run the one-command script from the carrier checkout:
|
||||||
|
|
||||||
|
git clone ssh://git@code.randogoth.com:2222/randogoth/carrier.git
|
||||||
|
cd carrier && windows/setup.sh
|
||||||
|
|
||||||
|
`windows/setup.sh` installs the GTK and Rust stack into MSYS2, clones fumi
|
||||||
|
next to carrier if it is missing, builds, and bundles carrier.exe with the
|
||||||
|
GTK runtime into `dist/` and a zip — the complete Windows distribution. The
|
||||||
|
app keeps its config in `%APPDATA%\carrier`. If MSYS2 updates its core
|
||||||
|
mid-run the shell may close; rerun the script and it continues. Cloning
|
||||||
|
over SSH needs the key in `~/.ssh` inside the MSYS2 home.
|
||||||
|
|
|
||||||
61
windows/setup.sh
Executable file
61
windows/setup.sh
Executable file
|
|
@ -0,0 +1,61 @@
|
||||||
|
#!/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.
|
||||||
|
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?"
|
||||||
|
|
||||||
|
say "building carrier (release; the first build takes a while)"
|
||||||
|
cargo build --release --locked || die "cargo build failed"
|
||||||
|
|
||||||
|
say "bundling the runtime"
|
||||||
|
rm -rf dist
|
||||||
|
mkdir -p dist/share/glib-2.0/schemas \
|
||||||
|
dist/share/icons/hicolor/512x512/apps \
|
||||||
|
dist/share/icons/hicolor/256x256/apps \
|
||||||
|
dist/share/icons/hicolor/128x128/apps
|
||||||
|
cp target/release/carrier.exe dist/
|
||||||
|
for dll in $(ldd target/release/carrier.exe | awk '/mingw64/ {print $3}'); do
|
||||||
|
cp "$dll" dist/ || die "copying $dll failed"
|
||||||
|
done
|
||||||
|
[ "$(ls dist/*.dll | wc -l)" -gt 0 ] || die "no DLLs collected — ldd found none under /mingw64"
|
||||||
|
cp /mingw64/share/glib-2.0/schemas/* dist/share/glib-2.0/schemas/
|
||||||
|
glib-compile-schemas dist/share/glib-2.0/schemas/
|
||||||
|
cp -r /mingw64/share/icons/Adwaita dist/share/icons/
|
||||||
|
cp -r /mingw64/share/icons/hicolor dist/share/icons/
|
||||||
|
cp data/icons/com.randogoth.carrier.png dist/share/icons/hicolor/512x512/apps/
|
||||||
|
cp data/icons/com.randogoth.carrier-256.png dist/share/icons/hicolor/256x256/apps/
|
||||||
|
cp data/icons/com.randogoth.carrier-128.png dist/share/icons/hicolor/128x128/apps/
|
||||||
|
|
||||||
|
say "zipping"
|
||||||
|
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -1)
|
||||||
|
rm -f "carrier-windows-$version.zip"
|
||||||
|
(cd dist && zip -qr "../carrier-windows-$version.zip" .)
|
||||||
|
|
||||||
|
say "done — test with ./dist/carrier.exe (SmartScreen may ask once)"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue