Fix build on macOS

This commit is contained in:
Thomas Farstrike
2026-03-18 17:57:46 +01:00
parent 32d28dae0d
commit 2e04a4ceb4
+11 -2
View File
@@ -159,8 +159,17 @@ elif [ "$target" == "unix" -o "$target" == "macOS" ]; then
mpconfig_unix="$codebasedir"/lvgl_micropython/lib/micropython/ports/unix/mpconfigport.h
if ! grep -q "MICROPY_PY_WEBREPL" "$mpconfig_unix"; then
echo "Enabling MICROPY_PY_WEBREPL in $mpconfig_unix"
sed -i.backup '/#include "mpconfigvariant.h"/a \
\n#ifndef MICROPY_PY_WEBREPL\n#define MICROPY_PY_WEBREPL (1)\n#endif\n' "$mpconfig_unix"
python3 - "$mpconfig_unix" <<'PY'
import pathlib
import sys
path = pathlib.Path(sys.argv[1])
text = path.read_text()
needle = '#include "mpconfigvariant.h"'
insert = "\n\n#ifndef MICROPY_PY_WEBREPL\n#define MICROPY_PY_WEBREPL (1)\n#endif\n"
if needle in text and "MICROPY_PY_WEBREPL" not in text:
path.write_text(text.replace(needle, needle + insert))
PY
else
echo "MICROPY_PY_WEBREPL already configured in $mpconfig_unix"
fi