-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kmkpy): make dist -> uf2 files for each supported NRF board, wit…
…h KMK bundled
- Loading branch information
Showing
5 changed files
with
64 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,3 +126,4 @@ kmk/release_info.py | |
kmk/release_info.mpy | ||
*.mpy | ||
.vscode | ||
.dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
FROM python:3.7-alpine | ||
FROM python:3.9-slim-buster | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
ARG KMKPY_REF | ||
ARG KMKPY_URL | ||
|
||
ENV KMKPY_REF ${KMKPY_REF} | ||
ENV KMKPY_URL ${KMKPY_URL} | ||
|
||
RUN apk update && apk add alpine-sdk coreutils curl gettext git git-lfs openssh rsync wget zip | ||
RUN mkdir -p /app /dist | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y build-essential curl gettext git git-lfs rsync wget zip lbzip2 | ||
RUN pip install pipenv | ||
|
||
### Get a local copy of CircuitPython and its dependencies | ||
# Our absolute baseline is 4.0.0, which (as of writing) shares MPY compat | ||
# with all future versions. Our baseline will need to update as MPY compat | ||
# changes | ||
RUN git clone --branch 4.0.0 --depth 1 https://github.com/adafruit/CircuitPython /opt/circuitpython | ||
RUN git -C /opt/circuitpython submodule update --init | ||
# Pull CircuitPython-designated ARM GCC to avoid mismatches/weird | ||
# inconsistencies with upstream | ||
RUN curl -L -o /tmp/gcc-arm.tar.bz2 https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 && \ | ||
tar -C /usr --strip-components=1 -xaf /tmp/gcc-arm.tar.bz2 && \ | ||
rm -rf /tmp/gcc-arm.tar.bz2 | ||
|
||
# Get a local copy of KMKPython and its dependencies. We don't provide MPY | ||
# builds for kmkpython anymore, so we can get away with being opinionated | ||
# here. | ||
RUN git init /opt/kmkpython && \ | ||
git -C /opt/kmkpython remote add origin ${KMKPY_URL} && \ | ||
git -C /opt/kmkpython fetch --depth 1 origin ${KMKPY_REF} && \ | ||
git -C /opt/kmkpython checkout FETCH_HEAD && \ | ||
git -C /opt/kmkpython submodule update --init --recursive | ||
|
||
# Build the MPY compiler | ||
RUN make -C /opt/kmkpython/mpy-cross | ||
|
||
ENV PATH=/opt/kmkpython/mpy-cross:${PATH} | ||
|
||
### Build the MPY compiler | ||
RUN make -C /opt/circuitpython/mpy-cross | ||
RUN mkdir -p /opt/kmkpython/frozen/kmk/kmk | ||
COPY ./build_kmkpython_release.sh /app/ | ||
COPY ./kmk /opt/kmkpython/frozen/kmk/kmk | ||
|
||
ENV PATH=/opt/circuitpython/mpy-cross:${PATH} | ||
CMD /app/build_kmkpython_release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
TIMESTAMP=$(date +%s) | ||
TARGETS=${TARGETS:-"nice_nano itsybitsy_nrf52840_express"} | ||
|
||
for TARGET in ${TARGETS}; do | ||
make -C /opt/kmkpython/ports/nrf BOARD="${TARGET}" | ||
cp "/opt/kmkpython/ports/nrf/build-${TARGET}/firmware.uf2" "/dist/${TARGET}-${TIMESTAMP}.uf2" | ||
echo "===> Built /dist/${TARGET}-${TIMESTAMP}.uf2" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/kmkfw/kmkpython b55fe4abc344bf1f509e8ef036d2a4cf13d6be63 |