Build scripts
Local release builds for Windows and Linux.
Toolchain
You need a Rust toolchain (1.88+; CI uses 1.96). Install once:
# Recommended (any distro)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# then restart the shell, or: source "$HOME/.cargo/env"
# Or on Arch Linux
sudo pacman -S --needed rust
Also install the platform build libraries under Linux build dependencies below before cargo test / cargo build.
Windows
.\scripts\build-windows.ps1
Output: target\release\posprint.exe
Options:
.\scripts\build-windows.ps1 -Deb:$false # exe only (default)
Linux
chmod +x scripts/build-linux.sh
./scripts/build-linux.sh # release binary
./scripts/build-linux.sh --deb # binary + .deb (prompts to install if interactive)
./scripts/build-linux.sh --deb --install # build .deb and install with apt
On Arch Linux:
chmod +x scripts/build-arch.sh
./scripts/build-arch.sh # .pkg.tar.zst (prompts to install if interactive)
./scripts/build-arch.sh --install # build and install with pacman
After a successful package build, both scripts ask whether to install (TTY only). Pass --install to skip the prompt and install automatically. Non-interactive runs (CI/pipes) never prompt.
Outputs:
| Artifact | Path |
|---|---|
| Binary | target/release/posprint |
| Debian package | target/debian/*.deb |
| Arch package | packaging/arch/posprint-*-x86_64.pkg.tar.zst |
Linux targets we support
| Format | Distros | Notes |
|---|---|---|
.deb | Debian, Ubuntu, Mint, Pop!_OS, etc. | Recommended for apt-based systems; produced by cargo-deb |
.pkg.tar.zst | Arch Linux, Manjaro, EndeavourOS, etc. | Recommended for pacman; sudo pacman -U posprint-*.pkg.tar.zst |
| Raw binary | Any x86_64 Linux | Copy target/release/posprint; needs X11/Wayland libs at runtime |
.rpm | Fedora, RHEL, openSUSE | Not automated yet; build binary and wrap with fpm if needed |
| AppImage | Universal | Not automated yet; good for portable distribution |
Architecture: x86_64 (amd64) only in CI and build scripts today.
Linux build dependencies (Debian/Ubuntu)
sudo apt-get install -y build-essential pkg-config \
libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
libssl-dev libudev-dev
For .deb:
cargo install cargo-deb --locked
Arch Linux build dependencies
sudo pacman -S --needed base-devel rust pkgconf openssl libxkbcommon libxcb dbus \
wayland libx11 fontconfig freetype2 libglvnd git rsync
Tests before release
cargo test --release
Source
| 1 | # Build scripts |
| 2 | |
| 3 | Local release builds for Windows and Linux. |
| 4 | |
| 5 | ## Toolchain |
| 6 | |
| 7 | You need a Rust toolchain (**1.88+**; CI uses 1.96). Install once: |
| 8 | |
| 9 | ```bash |
| 10 | # Recommended (any distro) |
| 11 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 12 | # then restart the shell, or: source "$HOME/.cargo/env" |
| 13 | |
| 14 | # Or on Arch Linux |
| 15 | sudo pacman -S --needed rust |
| 16 | ``` |
| 17 | |
| 18 | Also install the platform build libraries under **Linux build dependencies** below before `cargo test` / `cargo build`. |
| 19 | |
| 20 | ## Windows |
| 21 | |
| 22 | ```powershell |
| 23 | .\scripts\build-windows.ps1 |
| 24 | ``` |
| 25 | |
| 26 | Output: `target\release\posprint.exe` |
| 27 | |
| 28 | Options: |
| 29 | |
| 30 | ```powershell |
| 31 | .\scripts\build-windows.ps1 -Deb:$false # exe only (default) |
| 32 | ``` |
| 33 | |
| 34 | ## Linux |
| 35 | |
| 36 | ```bash |
| 37 | chmod +x scripts/build-linux.sh |
| 38 | ./scripts/build-linux.sh # release binary |
| 39 | ./scripts/build-linux.sh --deb # binary + .deb (prompts to install if interactive) |
| 40 | ./scripts/build-linux.sh --deb --install # build .deb and install with apt |
| 41 | ``` |
| 42 | |
| 43 | On **Arch Linux**: |
| 44 | |
| 45 | ```bash |
| 46 | chmod +x scripts/build-arch.sh |
| 47 | ./scripts/build-arch.sh # .pkg.tar.zst (prompts to install if interactive) |
| 48 | ./scripts/build-arch.sh --install # build and install with pacman |
| 49 | ``` |
| 50 | |
| 51 | After a successful package build, both scripts ask whether to install (TTY only). Pass `--install` to skip the prompt and install automatically. Non-interactive runs (CI/pipes) never prompt. |
| 52 | |
| 53 | Outputs: |
| 54 | |
| 55 | | Artifact | Path | |
| 56 | |----------|------| |
| 57 | | Binary | `target/release/posprint` | |
| 58 | | Debian package | `target/debian/*.deb` | |
| 59 | | Arch package | `packaging/arch/posprint-*-x86_64.pkg.tar.zst` | |
| 60 | |
| 61 | ### Linux targets we support |
| 62 | |
| 63 | | Format | Distros | Notes | |
| 64 | |--------|---------|-------| |
| 65 | | **`.deb`** | Debian, Ubuntu, Mint, Pop!_OS, etc. | **Recommended** for apt-based systems; produced by `cargo-deb` | |
| 66 | | **`.pkg.tar.zst`** | Arch Linux, Manjaro, EndeavourOS, etc. | **Recommended** for pacman; `sudo pacman -U posprint-*.pkg.tar.zst` | |
| 67 | | **Raw binary** | Any x86_64 Linux | Copy `target/release/posprint`; needs X11/Wayland libs at runtime | |
| 68 | | **`.rpm`** | Fedora, RHEL, openSUSE | Not automated yet; build binary and wrap with `fpm` if needed | |
| 69 | | **AppImage** | Universal | Not automated yet; good for portable distribution | |
| 70 | |
| 71 | **Architecture:** `x86_64` (amd64) only in CI and build scripts today. |
| 72 | |
| 73 | ### Linux build dependencies (Debian/Ubuntu) |
| 74 | |
| 75 | ```bash |
| 76 | sudo apt-get install -y build-essential pkg-config \ |
| 77 | libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \ |
| 78 | libssl-dev libudev-dev |
| 79 | ``` |
| 80 | |
| 81 | For `.deb`: |
| 82 | |
| 83 | ```bash |
| 84 | cargo install cargo-deb --locked |
| 85 | ``` |
| 86 | |
| 87 | ### Arch Linux build dependencies |
| 88 | |
| 89 | ```bash |
| 90 | sudo pacman -S --needed base-devel rust pkgconf openssl libxkbcommon libxcb dbus \ |
| 91 | wayland libx11 fontconfig freetype2 libglvnd git rsync |
| 92 | ``` |
| 93 | |
| 94 | ## Tests before release |
| 95 | |
| 96 | ```bash |
| 97 | cargo test --release |
| 98 | ``` |