diff --git a/app/build_grantlee.sh b/app/build_grantlee.sh new file mode 100755 index 000000000..7fd2e80fc --- /dev/null +++ b/app/build_grantlee.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +# build_grantlee.sh - try installing grantlee via apt, otherwise build from source +QT_ROOT=${QT_ROOT:-/opt/Qt/6.8.3/gcc_64} +INSTALL_PREFIX=${INSTALL_PREFIX:-/usr/local} + +echo "Attempting to install libgrantlee5 via apt..." +if apt-get update && apt-get install -y --no-install-recommends libgrantlee5 libgrantlee5-dev; then + echo "Installed libgrantlee5 from apt" + exit 0 +fi + +echo "libgrantlee not available via apt; building from source (steveire/grantlee)..." +TMPDIR=$(mktemp -d) +trap 'rm -rf "$TMPDIR"' EXIT +cd "$TMPDIR" + +if ! git clone --depth 1 https://github.com/steveire/grantlee.git grantlee; then + echo "Warning: failed to clone grantlee from github; network or access issue. Exiting gracefully." >&2 + exit 0 +fi + +mkdir -p grantlee/build +cd grantlee/build +cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_PREFIX_PATH="${QT_ROOT}:${INSTALL_PREFIX}" .. + +cmake --build . -- -j$(nproc) || true +cmake --install . || true + +echo "Grantlee build script finished." +exit 0 diff --git a/app/build_kdreports.sh b/app/build_kdreports.sh new file mode 100755 index 000000000..5ea113a33 --- /dev/null +++ b/app/build_kdreports.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +# build_kdreports.sh - try apt, otherwise build KDReports from KDAB GitHub mirror +QT_ROOT=${QT_ROOT:-/opt/Qt/6.8.3/gcc_64} +INSTALL_PREFIX=${INSTALL_PREFIX:-/usr/local} + +echo "Attempting to install KDReports via apt..." +if apt-get update && apt-get install -y --no-install-recommends libkdreports-dev; then + echo "Installed KDReports from apt" + exit 0 +fi + +echo "KDReports not available via apt; building from source (KDAB/KDReports)..." +TMPDIR=$(mktemp -d) +trap 'rm -rf "$TMPDIR"' EXIT +cd "$TMPDIR" + +# KDAB mirror location on GitHub +if ! git clone --depth 1 https://github.com/KDAB/KDReports.git kdreports; then + echo "Warning: failed to clone KDReports from github; network or access issue. Exiting gracefully." >&2 + exit 0 +fi + +mkdir -p kdreports/build +cd kdreports/build +cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + -DCMAKE_PREFIX_PATH="${QT_ROOT}:${INSTALL_PREFIX}" .. + +cmake --build . -- -j$(nproc) || true +cmake --install . || true + +echo "KDReports build script finished." +exit 0