Files
MeowOS-For-R3P2/patch_v2/meow_launcherd/build_launcher.sh
T

76 lines
3.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# build_launcher.sh — MeowOS launcher (A-1/A-2: launcher 用 SDK 渲染栈).
#
# 变更点(相对 M2.27 / A-0):
# - launcher 不再自建 back_buf/meow_present/refresh_governor —— 改用 SDK 渲染栈:
# fb 指向 SDK 的 back_buf(meow_ui_back_buf),呈现统一 meow_ui_flush()(SDK present,
# 内含 vsync + 帧率门控 + 原子 blit 脏区);刷新率档位经 meow_ui_set_refresh_rate()/
# set_refresh_always_max() 交给 SDK(归口 PERF_SCHEDULER 显示子域)。
# - 播放器 fb 双缓冲交互(fb_backup_player/fb_norm_buf0/fb_restore_player/FBIOPAN/yoffset)
# 保留不动(与 present 上屏不同层)。
# - launcher 与 SDK 共用同一 meow_font.o(已打进 meow_ui.a)——不再单独链 meow_font.a。
# - MEOWOS_VERSION 0.7.21 → 0.7.23(M2.28)。
#
# 用法(在 patch_v2/meow_launcherd 下或任意目录):
# bash build_launcher.sh # 交叉编译 meow_launcherd(mipsel 静态)
# bash build_launcher.sh test # 宿主 gcc 跑本目录 affected 单测(test_bt_page / test_netmgr_ipc)
#
# 工具链:优先环境变量 ZIGCC / MIPS_SYSROOT(M47 起),否则退回历史固定路径 $HOME/Project/R3ProII。
# export ZIGCC=$HOME/.tools/zig-mipsel-cc
set -e
cd "$(dirname "$0")"
CC="${ZIGCC:-$HOME/.tools/zig-mipsel-cc}"
[ -x "$CC" ] || CC="$HOME/Project/R3ProII/.tools/zig-mipsel-cc"
SYSROOT="${MIPS_SYSROOT:-$HOME/.tools/mipsel-linux-muslsf-cross/mipsel-linux-muslsf}"
[ -f "$SYSROOT/lib/libz.a" ] || SYSROOT="$HOME/Project/R3ProII/.tools/mipsel-linux-muslsf-cross/mipsel-linux-muslsf"
# ---------------- 宿主单测(M47 起提供入口;只跑本目录受影响的测试)----------------
run_tests() {
local HOSTCC="${HOSTCC:-gcc}"
local TMPD rc=0
TMPD="$(mktemp -d "${TMPDIR:-/tmp}/meow_launcher_test.XXXXXX")"
trap 'rm -rf "$TMPD"' EXIT
echo "== host test: test_bt_page =="
if "$HOSTCC" -I"../sdk" -I. -Wall -Wextra -fsanitize=undefined \
test_bt_page.c -o "$TMPD/test_bt_page"; then
"$TMPD/test_bt_page" || rc=1
else
rc=1
fi
echo "== host test: test_netmgr_ipc =="
if "$HOSTCC" -I"../sdk" -I. -Wall -Wextra -c netmgr_ipc.c -o "$TMPD/netmgr_ipc.test.o" \
&& "$HOSTCC" -I"../sdk" -I. -Wall -Wextra \
test_netmgr_ipc.c "$TMPD/netmgr_ipc.test.o" -lpthread -o "$TMPD/test_netmgr_ipc"; then
"$TMPD/test_netmgr_ipc" || rc=1
else
rc=1
fi
if [ $rc -eq 0 ]; then echo "== ALL TESTS PASS =="; else echo "!! TESTS FAILED"; fi
return $rc
}
if [ "$1" = "test" ]; then
run_tests
exit $?
fi
[ -f "../sdk/meow_ui.a" ] || { echo "!! 缺 ../sdk/meow_ui.a,先跑 sdk/build_sdk.sh"; exit 1; }
"$CC" -I"../sdk" -Os -static -Wall -Wextra \
main_menu.c statusbar.c fb_compositor.c settings_page.c power_menu.c \
notif_center.c app_launcher.c pkg_install.c audio.c backlight.c net.c about.c \
subpage.c wifi_page.c bt_page.c netmgr_ipc.c now_playing.c bg_page.c \
font_theme.c keys.c util.c meow_dep.c key_router.c \
meow_touch.c meow_settings.c meow_notif.c meow_media.c meow_bgplay.c \
meow_bgmgr.c \
meow_ams_start.c lock_screen.c lock_screen_ui.c lock_settings.c \
"../sdk/meow_lyric.c" "../sdk/meow_lyric_view.c" "../sdk/meow_img_color.c" \
"../sdk/meow_ui.a" "$SYSROOT/lib/libz.a" -lpthread -o meow_launcherd
echo "== meow_launcherd =="
ls -la meow_launcherd
md5sum meow_launcherd
file meow_launcherd