BlueGit

timfa posprint

Files

posprint / scripts / build-linux.sh

build-linux.sh

build-linux.sh 757 B Download Raw
1#!/usr/bin/env bash
2set -euo pipefail
3
4ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5cd "$ROOT"
6
7BUILD_DEB=false
8SKIP_TESTS=false
9
10for arg in "$@"; do
11 case "$arg" in
12 --deb) BUILD_DEB=true ;;
13 --skip-tests) SKIP_TESTS=true ;;
14 *) echo "Unknown option: $arg"; exit 1 ;;
15 esac
16done
17
18echo "Building posprint for Linux (x86_64)..."
19
20if [[ "$SKIP_TESTS" != "true" ]]; then
21 cargo test
22fi
23
24cargo build --release
25BIN="$ROOT/target/release/posprint"
26echo "OK: $BIN"
27ls -lh "$BIN"
28
29if [[ "$BUILD_DEB" == "true" ]]; then
30 if ! command -v cargo-deb &>/dev/null; then
31 echo "Installing cargo-deb..."
32 cargo install cargo-deb --locked
33 fi
34 cargo deb
35 echo "Debian packages:"
36 ls -lh "$ROOT/target/debian/"*.deb
37fi