build(docker): add build_grantlee.sh and build_kdreports.sh to install or build Grantlee and KDReports from source\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
5a74df95f2
commit
f613b4f266
2 files changed
+69
No files matched your search
Executable
+34
@@ -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
|
||||||
Executable
+35
@@ -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
|
||||||
Reference in new issue
Block a user