Skip to content

Commit 70e10b7

Browse files
author
yuwei
committed
feat: 初始化 host macOS LVGL 预编译包
0 parents  commit 70e10b7

273 files changed

Lines changed: 61754 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: host-macos-package
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build-host-macos-package:
9+
runs-on: macos-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Build LVGL package
15+
run: ./scripts/build_host_macos.sh
16+
17+
- name: Verify LVGL package
18+
run: ./scripts/verify_package.sh

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
downloads/
3+
src/lvgl/
4+
*.tmp
5+
.DS_Store

CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(lvgl_host_macos_prebuilt C)
4+
5+
set(LVGL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/lvgl" CACHE PATH "LVGL source directory")
6+
set(LVGL_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/config/host_macos" CACHE PATH "LVGL config directory")
7+
8+
if(NOT EXISTS "${LVGL_SOURCE_DIR}/CMakeLists.txt")
9+
message(FATAL_ERROR "LVGL source not found at ${LVGL_SOURCE_DIR}. Run scripts/build_host_macos.sh first.")
10+
endif()
11+
12+
if(NOT EXISTS "${LVGL_CONFIG_DIR}/lv_conf.h")
13+
message(FATAL_ERROR "lv_conf.h not found at ${LVGL_CONFIG_DIR}/lv_conf.h")
14+
endif()
15+
16+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
17+
set(LV_CONF_PATH "${LVGL_CONFIG_DIR}/lv_conf.h" CACHE STRING "" FORCE)
18+
set(LV_CONF_BUILD_DISABLE_EXAMPLES ON CACHE BOOL "" FORCE)
19+
set(LV_CONF_BUILD_DISABLE_DEMOS ON CACHE BOOL "" FORCE)
20+
set(LV_CONF_BUILD_DISABLE_THORVG_INTERNAL ON CACHE BOOL "" FORCE)
21+
22+
add_subdirectory("${LVGL_SOURCE_DIR}" "${CMAKE_BINARY_DIR}/lvgl")

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# lvgl-prebuilt-host-macos
2+
3+
这个仓库负责为 Mac host 产出 LVGL 9.1 预编译包。
4+
5+
它的职责是:
6+
7+
- 固定 LVGL 官方版本。
8+
- 使用 Mac 工具链编译 `liblvgl.a`
9+
- 导出成 `embedded-platform-core` 可以消费的包结构。
10+
11+
它不负责:
12+
13+
- 编译匠芯创 Luban-Lite 的 LVGL。
14+
- 编译全志 Linux 的 LVGL。
15+
- 封装 LVGL 控件 API。
16+
- 提供显示窗口、输入设备或平台 port。
17+
18+
## 产物结构
19+
20+
构建后生成:
21+
22+
```text
23+
dist/lvgl/host_macos/
24+
include/
25+
lvgl.h
26+
lv_conf.h
27+
src/
28+
... 只包含 LVGL 头文件
29+
lib/
30+
liblvgl.a
31+
LVGL_LICENCE.txt
32+
lvgl_package.txt
33+
```
34+
35+
`include/``lv_conf.h``lib/liblvgl.a` 必须成套使用,不能和其他平台的 LVGL 包混用。
36+
37+
## 构建
38+
39+
```bash
40+
./scripts/build_host_macos.sh
41+
```
42+
43+
## 验证
44+
45+
```bash
46+
./scripts/verify_package.sh
47+
```
48+
49+
## 版本
50+
51+
- LVGL tag: `v9.1.0`
52+
- LVGL commit: `e1c0b21b2723d391b885de4b2ee5cc997eccca91`
53+
- 平台: `host_macos`

config/host_macos/lv_conf.h

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
* @file lv_conf.h
3+
* Host macOS configuration for LVGL v9.1.0.
4+
*/
5+
6+
#ifndef LV_CONF_H
7+
#define LV_CONF_H
8+
9+
#define LV_COLOR_DEPTH 32
10+
11+
#define LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB
12+
#define LV_USE_STDLIB_STRING LV_STDLIB_CLIB
13+
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_CLIB
14+
15+
#define LV_USE_OS LV_OS_NONE
16+
17+
#define LV_DEF_REFR_PERIOD 33
18+
#define LV_DPI_DEF 130
19+
20+
#define LV_DRAW_BUF_STRIDE_ALIGN 1
21+
#define LV_DRAW_BUF_ALIGN 4
22+
#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
23+
24+
#define LV_USE_DRAW_SW 1
25+
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
26+
#define LV_USE_DRAW_ARM2D_SYNC 0
27+
#define LV_USE_NATIVE_HELIUM_ASM 0
28+
#define LV_DRAW_SW_COMPLEX 1
29+
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
30+
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
31+
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
32+
33+
#define LV_USE_VGLITE 0
34+
#define LV_USE_PXP 0
35+
#define LV_USE_ROTATE_PXP 0
36+
#define LV_USE_DRAW_DAVE2D 0
37+
38+
#define LV_USE_LOG 0
39+
#define LV_USE_ASSERT_NULL 1
40+
#define LV_USE_ASSERT_MALLOC 1
41+
#define LV_USE_ASSERT_STYLE 0
42+
#define LV_USE_ASSERT_MEM_INTEGRITY 0
43+
#define LV_USE_ASSERT_OBJ 0
44+
45+
#define LV_USE_REFR_DEBUG 0
46+
#define LV_USE_LAYER_DEBUG 0
47+
#define LV_USE_PARALLEL_DRAW_DEBUG 0
48+
49+
#define LV_USE_SYSMON 0
50+
#define LV_USE_PERF_MONITOR 0
51+
#define LV_USE_MEM_MONITOR 0
52+
53+
#define LV_USE_STDIO 1
54+
#define LV_USE_STDLIB 1
55+
56+
#define LV_USE_THEME_DEFAULT 1
57+
#define LV_USE_THEME_SIMPLE 1
58+
#define LV_USE_THEME_MONO 1
59+
60+
#define LV_FONT_MONTSERRAT_14 1
61+
#define LV_FONT_DEFAULT &lv_font_montserrat_14
62+
63+
#define LV_USE_ARC 1
64+
#define LV_USE_BAR 1
65+
#define LV_USE_BUTTON 1
66+
#define LV_USE_BUTTONMATRIX 1
67+
#define LV_USE_CANVAS 1
68+
#define LV_USE_CHECKBOX 1
69+
#define LV_USE_DROPDOWN 1
70+
#define LV_USE_IMAGE 1
71+
#define LV_USE_LABEL 1
72+
#define LV_USE_LINE 1
73+
#define LV_USE_ROLLER 1
74+
#define LV_USE_SCALE 1
75+
#define LV_USE_SLIDER 1
76+
#define LV_USE_SWITCH 1
77+
#define LV_USE_TEXTAREA 1
78+
#define LV_USE_TABLE 1
79+
80+
#define LV_USE_ANIMIMG 1
81+
#define LV_USE_CALENDAR 1
82+
#define LV_USE_CHART 1
83+
#define LV_USE_COLORWHEEL 1
84+
#define LV_USE_IMGBTN 1
85+
#define LV_USE_KEYBOARD 1
86+
#define LV_USE_LED 1
87+
#define LV_USE_LIST 1
88+
#define LV_USE_MENU 1
89+
#define LV_USE_MSGBOX 1
90+
#define LV_USE_SPAN 1
91+
#define LV_USE_SPINBOX 1
92+
#define LV_USE_SPINNER 1
93+
#define LV_USE_TABVIEW 1
94+
#define LV_USE_TILEVIEW 1
95+
#define LV_USE_WIN 1
96+
97+
#define LV_BUILD_EXAMPLES 0
98+
#define LV_USE_DEMO_WIDGETS 0
99+
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
100+
#define LV_USE_DEMO_BENCHMARK 0
101+
#define LV_USE_DEMO_STRESS 0
102+
#define LV_USE_DEMO_MUSIC 0
103+
104+
#endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MIT licence
2+
Copyright (c) 2021 LVGL Kft
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
* @file lv_conf.h
3+
* Host macOS configuration for LVGL v9.1.0.
4+
*/
5+
6+
#ifndef LV_CONF_H
7+
#define LV_CONF_H
8+
9+
#define LV_COLOR_DEPTH 32
10+
11+
#define LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB
12+
#define LV_USE_STDLIB_STRING LV_STDLIB_CLIB
13+
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_CLIB
14+
15+
#define LV_USE_OS LV_OS_NONE
16+
17+
#define LV_DEF_REFR_PERIOD 33
18+
#define LV_DPI_DEF 130
19+
20+
#define LV_DRAW_BUF_STRIDE_ALIGN 1
21+
#define LV_DRAW_BUF_ALIGN 4
22+
#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
23+
24+
#define LV_USE_DRAW_SW 1
25+
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
26+
#define LV_USE_DRAW_ARM2D_SYNC 0
27+
#define LV_USE_NATIVE_HELIUM_ASM 0
28+
#define LV_DRAW_SW_COMPLEX 1
29+
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
30+
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
31+
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
32+
33+
#define LV_USE_VGLITE 0
34+
#define LV_USE_PXP 0
35+
#define LV_USE_ROTATE_PXP 0
36+
#define LV_USE_DRAW_DAVE2D 0
37+
38+
#define LV_USE_LOG 0
39+
#define LV_USE_ASSERT_NULL 1
40+
#define LV_USE_ASSERT_MALLOC 1
41+
#define LV_USE_ASSERT_STYLE 0
42+
#define LV_USE_ASSERT_MEM_INTEGRITY 0
43+
#define LV_USE_ASSERT_OBJ 0
44+
45+
#define LV_USE_REFR_DEBUG 0
46+
#define LV_USE_LAYER_DEBUG 0
47+
#define LV_USE_PARALLEL_DRAW_DEBUG 0
48+
49+
#define LV_USE_SYSMON 0
50+
#define LV_USE_PERF_MONITOR 0
51+
#define LV_USE_MEM_MONITOR 0
52+
53+
#define LV_USE_STDIO 1
54+
#define LV_USE_STDLIB 1
55+
56+
#define LV_USE_THEME_DEFAULT 1
57+
#define LV_USE_THEME_SIMPLE 1
58+
#define LV_USE_THEME_MONO 1
59+
60+
#define LV_FONT_MONTSERRAT_14 1
61+
#define LV_FONT_DEFAULT &lv_font_montserrat_14
62+
63+
#define LV_USE_ARC 1
64+
#define LV_USE_BAR 1
65+
#define LV_USE_BUTTON 1
66+
#define LV_USE_BUTTONMATRIX 1
67+
#define LV_USE_CANVAS 1
68+
#define LV_USE_CHECKBOX 1
69+
#define LV_USE_DROPDOWN 1
70+
#define LV_USE_IMAGE 1
71+
#define LV_USE_LABEL 1
72+
#define LV_USE_LINE 1
73+
#define LV_USE_ROLLER 1
74+
#define LV_USE_SCALE 1
75+
#define LV_USE_SLIDER 1
76+
#define LV_USE_SWITCH 1
77+
#define LV_USE_TEXTAREA 1
78+
#define LV_USE_TABLE 1
79+
80+
#define LV_USE_ANIMIMG 1
81+
#define LV_USE_CALENDAR 1
82+
#define LV_USE_CHART 1
83+
#define LV_USE_COLORWHEEL 1
84+
#define LV_USE_IMGBTN 1
85+
#define LV_USE_KEYBOARD 1
86+
#define LV_USE_LED 1
87+
#define LV_USE_LIST 1
88+
#define LV_USE_MENU 1
89+
#define LV_USE_MSGBOX 1
90+
#define LV_USE_SPAN 1
91+
#define LV_USE_SPINBOX 1
92+
#define LV_USE_SPINNER 1
93+
#define LV_USE_TABVIEW 1
94+
#define LV_USE_TILEVIEW 1
95+
#define LV_USE_WIN 1
96+
97+
#define LV_BUILD_EXAMPLES 0
98+
#define LV_USE_DEMO_WIDGETS 0
99+
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
100+
#define LV_USE_DEMO_BENCHMARK 0
101+
#define LV_USE_DEMO_STRESS 0
102+
#define LV_USE_DEMO_MUSIC 0
103+
104+
#endif

0 commit comments

Comments
 (0)