Skip to content

Commit 18baaad

Browse files
authored
micropython: Include all required libs in the build. (#119)
Resolves #118. Signed-off-by: Anson Mansfield <anson.mansfield@gmail.com>
1 parent 579f94e commit 18baaad

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Dockerfile.micropython

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update -y -q && apt-get upgrade -y -q && apt-get update -y -q && \
@@ -8,6 +8,7 @@ RUN apt-get update -y -q && apt-get upgrade -y -q && apt-get update -y -q && \
88
libreadline-dev \
99
libffi-dev \
1010
git \
11+
patchelf \
1112
pkg-config \
1213
gcc-arm-none-eabi \
1314
libnewlib-arm-none-eabi

micropython/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ fi;
3030
ci_unix_standard_build
3131
)
3232

33-
mkdir -p "${DEST}" "${DEST}/bin" "${DEST}/tools" "${DEST}/py"
33+
mkdir -p "${DEST}" "${DEST}/bin" "${DEST}/tools" "${DEST}/py" "${DEST}/lib"
3434
cp "${REPO}/mpy-cross/build/mpy-cross" "${DEST}/bin/mpy-cross"
3535
cp "${REPO}/ports/unix/build-standard/micropython" "${DEST}/bin/micropython"
3636
cp "${REPO}/tools/mpy-tool.py" "${DEST}/tools/mpy-tool.py"
3737
cp "${REPO}/py/makeqstrdata.py" "${DEST}/py/makeqstrdata.py"
3838

39+
cp $(ldd "${DEST}/bin/mpy-cross" "${DEST}/bin/micropython" | grep -E '=> /' | grep -Ev 'lib(pthread|c|dl|rt).so' | awk '{print $3}') "${DEST}/lib"
40+
patchelf --set-rpath '$ORIGIN/../lib' "${DEST}/bin/mpy-cross" "${DEST}/bin/micropython"
41+
3942
complete "${DEST}" "${FULLNAME}" "${OUTPUT}"

0 commit comments

Comments
 (0)