File size: 1,419 Bytes
e5a3ec0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# Standalone build script for SolveSpace (parametric 2D/3D CAD tool).
# Reproduces the entire build from scratch. Runs as root, no sudo required.
set -euo pipefail

REPO_URL="https://github.com/solvespace/solvespace"
COMMIT="08fdb3596922dc93837578a8cd8cda32e3c83f23"
SRC_DIR="/workspace/repo"
BUILD_DIR="${SRC_DIR}/build"
INSTALL_DIR="/workspace/install"

export DEBIAN_FRONTEND=noninteractive

# --- 1. Install build dependencies -----------------------------------------
apt-get update -qq || true
apt-get install -y \
    git build-essential cmake pkg-config \
    zlib1g-dev libpng-dev libcairo2-dev libfreetype6-dev libjson-c-dev \
    libfontconfig1-dev libpangomm-1.4-dev libgl-dev libglu-dev \
    libspnav-dev libgtkmm-3.0-dev

# --- 3. Configure & build (Release, install to /workspace/install) ----------
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_OPENMP=ON \
    -DENABLE_GUI=ON \
    -DUSE_QT_GUI=OFF \
    -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"

make -j"$(nproc)"
make install

# --- 4. Make the install tree world-readable/executable --------------------
# build.sh runs as root; downstream stages launch the app as an unprivileged
# user, so everything under the install prefix must be readable/executable.
chmod -R a+rX "${INSTALL_DIR}"

echo "Build complete. Executable: ${INSTALL_DIR}/bin/solvespace"