Skip to content

Commit a309cc3

Browse files
Add support for building on desktop
1 parent 4d0258e commit a309cc3

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,31 @@ Release checklist
102102
- copy ~/sources/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin to webinstaller
103103
- update manifest of webinstaller
104104
- push webinstaller
105+
106+
Building for desktop
107+
====================
108+
Building to run as an app on the Linux desktop or MacOS (untested) is supported.
109+
110+
To do so, make sure you have the necessary dependencies (see https://github.com/lvgl-micropython/) and then run:
111+
112+
```
113+
~/sources/PiggyOS/scripts/build_lvgl_micropython.sh unix
114+
```
115+
116+
or
117+
118+
```
119+
~/sources/PiggyOS/scripts/build_lvgl_micropython.sh macOS
120+
```
121+
122+
To run it, it's recommended to symlink your ~/.micropython/lib folder into this project's lib:
123+
124+
```
125+
ln -sf $(readlink -f internal_filesystem/lib) ~/.micropython/lib
126+
```
127+
128+
Then to run it, do:
129+
130+
```
131+
./scripts/run_desktop.sh
132+
```

scripts/build_lvgl_micropython.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# --flash-size: total flash size is 16MB
55
#
66

7-
devbuild="$1"
7+
buildtype="$1"
88

9-
echo "Usage: $0 [devbuild]"
9+
echo "Usage: $0 [devbuild/unix]"
1010
echo "Example: $0"
1111
echo "Example: $0 devbuild"
1212
echo
@@ -16,13 +16,15 @@ sleep 2
1616
pushd ~/sources/lvgl_micropython
1717

1818
manifest="FROZEN_MANIFEST=/home/user/sources/PiggyOS/manifest.py"
19-
if [ "$devbuild" == "devbuild" ]; then
19+
if [ "$buildtype" == "devbuild" ]; then
2020
manifest=""
2121
fi
2222

23-
python3 make.py --ota --partition-size=4194304 --flash-size=16 esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=st7789 INDEV=cst816s USER_C_MODULE="/home/user/sources/micropython-camera-API/src/micropython.cmake" "$manifest"
24-
25-
# build for unix:
26-
#python3 make.py unix DISPLAY=sdl_display INDEV=sdl_pointer
23+
if [ "$buildtype" != "unix" -o "$buildtype" != "macOS" ]; then
24+
python3 make.py --ota --partition-size=4194304 --flash-size=16 esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=st7789 INDEV=cst816s USER_C_MODULE="/home/user/sources/micropython-camera-API/src/micropython.cmake" "$manifest"
25+
else
26+
# build for desktop
27+
python3 make.py "$buildtype" DISPLAY=sdl_display INDEV=sdl_pointer
28+
fi
2729

2830
popd

0 commit comments

Comments
 (0)