keyboards/zofle/build.bash

30 lines
976 B
Bash
Raw Normal View History

2021-11-22 14:44:07 -06:00
#!/usr/bin/env bash
2021-11-08 23:20:01 -06:00
2023-11-14 09:41:59 -06:00
ZMK_DOCKER_IMAGE="${ZMK_DOCKER_IMAGE:-docker.io/zmkfirmware/zmk-build-arm:stable}"
2021-11-08 23:20:01 -06:00
2023-11-14 09:41:59 -06:00
if [[ -n $ZMK_PULL_DOCKER_IMAGE ]]; then
2024-06-24 16:16:41 -05:00
podman pull "$ZMK_DOCKER_IMAGE"
2023-11-14 09:41:59 -06:00
fi
mkdir -p "${PWD}/build"
mkdir -p "${PWD}/.cache"
podman run -it --rm \
-v "${PWD}/.cache:/zofle" \
-v "${PWD}/config:/zofle/config:ro" \
-v "${PWD}/build:/build" \
"$ZMK_DOCKER_IMAGE" sh -c '
set -x
2021-12-06 10:35:56 -06:00
set -e
cd /zofle
2023-11-14 09:41:59 -06:00
git config --global --add safe.directory /zofle/zmk
2021-12-06 10:35:56 -06:00
west init -l config || true # allowed to fail since it will fail if already initialized
2021-11-08 23:20:01 -06:00
west update
west zephyr-export
echo "Building left"
west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=sofle_left -DZMK_CONFIG="/zofle/config"
cp /zofle/build/zephyr/zmk.uf2 /build/sofle_left_nice_nano.uf2
echo "Building right"
west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=sofle_right -DZMK_CONFIG="/zofle/config"
cp /zofle/build/zephyr/zmk.uf2 /build/sofle_right_nice_nano.uf2
2023-11-14 09:41:59 -06:00
'