- Dockerfile.gplan: pre-built armv7 image with cbang + camotics objects - build-gplan.sh: relinks against Python 3.5m in ~3sec - Pi Python 3.5 headers cached in .pi/pi-python35.tar.gz (gitignored)
41 lines
1.8 KiB
Docker
41 lines
1.8 KiB
Docker
# Pre-built armv7 environment for gplan.so
|
|
# Build once: docker build --platform linux/arm/v7 -t onefin-gplan -f .pi/Dockerfile.gplan .pi/
|
|
# Then use: .pi/build-gplan.sh
|
|
FROM debian:bullseye
|
|
|
|
RUN apt-get update -qq && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
|
|
build-essential scons git ca-certificates python3-dev \
|
|
libssl-dev libexpat1-dev libbz2-dev liblz4-dev zlib1g-dev perl file && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Clone and build cbang (static lib, ~5min under QEMU)
|
|
RUN mkdir -p /opt/cbang && cd /opt/cbang && git init -q && \
|
|
git remote add origin https://github.com/CauldronDevelopmentLLC/cbang && \
|
|
git fetch --depth 1 -q origin 18f1e963107ef26abe750c023355a5c40dd07853 && \
|
|
git reset --hard FETCH_HEAD -q && \
|
|
scons -j2 disable_local="re2 libevent" && \
|
|
rm -rf .git build/dep
|
|
|
|
# Clone and patch camotics (source only, don't compile yet — that depends on workspace)
|
|
RUN mkdir -p /opt/camotics && cd /opt/camotics && git init -q && \
|
|
git remote add origin https://github.com/CauldronDevelopmentLLC/camotics && \
|
|
git fetch --depth 1 -q origin ec876c80d20fc19837133087cef0c447df5a939d && \
|
|
git reset --hard FETCH_HEAD -q && \
|
|
mkdir -p build && touch build/version.txt && \
|
|
P="src/gcode/plan" && \
|
|
for F in LineCommand.cpp LinePlanner.cpp; do \
|
|
for V in maxVel maxJerk maxAccel; do \
|
|
perl -i -0pe "s/(fabs\((config\.$V\[axis\]) \/ unit\[axis\]\));/std::min(\2, \1);/gm" $P/$F; \
|
|
done; \
|
|
done && \
|
|
rm -rf .git
|
|
|
|
# Pre-compile camotics objects (the slow part, ~20min under QEMU)
|
|
ENV CBANG_HOME=/opt/cbang
|
|
RUN cd /opt/camotics && scons -j2 gplan.so with_gui=0 with_tpl=0 && \
|
|
rm -f gplan.so # remove the python3.9-linked one, we relink at build time
|
|
|
|
ENV CBANG_HOME=/opt/cbang
|
|
WORKDIR /opt/camotics
|