Files
converge/scripts/build
T
jbrechtel ef49f30c88
Build / build (push) Successful in 58s
Add Arch Linux PKGBUILD and package build step
- PKGBUILD: builds converge package, uses pre-built binary from
  build/converge when available (from scripts/build), falls back to
  stack build from source. Installs binary, systemd user service,
  example config, and README.
- scripts/build: added final step to run makepkg -f on the host
  (conditional, skipped if makepkg not found). Produces .pkg.tar.zst
  alongside the binary.
- scripts/makepkg: convenience wrapper for standalone makepkg runs.
2026-05-14 19:03:07 -04:00

35 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
echo "Formatting with fourmolu..."
./hs fourmolu --mode inplace app/ src/ test/
echo "Building..."
./hs stack build --copy-bins --local-bin-path /work/build
echo "Compressing with UPX..."
./hs bash -c '
UPX_VERSION="5.1.1"
UPX_URL="https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz"
UPX_DIR="/tmp/upx-${UPX_VERSION}-amd64_linux"
if [ ! -x "${UPX_DIR}/upx" ]; then
curl -fsSL "${UPX_URL}" | tar -xJ -C /tmp
fi
"${UPX_DIR}/upx" /work/build/converge
'
echo "Done: $(ls -lh build/converge | awk '{print $5}')"
# Build Arch Linux package (if makepkg is available)
if command -v makepkg &>/dev/null; then
echo "Building Arch package with makepkg..."
if makepkg -f 2>&1; then
echo "Package: $(ls -1 converge-*.pkg.tar.zst 2>/dev/null)"
else
echo "WARNING: makepkg failed (see above)" >&2
fi
else
echo "Skipping package build (makepkg not found)"
fi