Files
qingjian/apps/linux/scripts/package-install.sh
T
yenharvey 5e48eb19a4 chore(release): 语言模型与含章·通变改从模型仓库取,停用 data-vN
之前 lm.qj 和含章·通变装在主仓库的 data-vN 数据包里,由 data.lock 钉住,
换一个文件就要重打整包、发新号。
现在两者在 qingjian-models 各自发版(lm-v1.0.0、hanzhang-tongbian-v1.0.0),
tools/release/models.lock 钉住标签与压缩包的 SHA-256,models-fetch.py 按 manifest 逐块下载、拼回核对后解到原来的位置。
data-fetch.sh 依次调 models-fetch.py 与 dicts-fetch.py,两者共用 mirror.py(Gitee 与 GitHub 同时请求、先回来的用)。
删掉 data.lock 与 data-bundle.sh;build-info.json 改记 lm.qj 与通变的摘要。
mac 打包每次按锁文件取语言模型,不再按 TSV 新旧自行重打;Linux 预编译包带模型缓存,安装时不联网解开。
lm-v1.0.0 与通变都和 data-v10 里的同一份字节。

测试:本机 data-fetch 全取一遍并核对;mac pkg 里的 lm.qj 与发版那份一致;Linux files.py resources 与模拟离线安装通过。Windows build.ps1 与 release.yml 没跑。
2026-11-10 15:18:30 +08:00

29 lines
1.7 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.
#!/usr/bin/env bash
# //! 预编译包的安装脚本(package.sh 放到包根目录的 install.sh):解开随包模型与词库,装到用户目录;Server 由用户手动启动。
set -euo pipefail
here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
install_prefix="$HOME/.local"
while (($#)); do
case "$1" in
--prefix) install_prefix=${2:?--prefix 需要路径}; shift 2 ;;
--help) echo '用法:install.sh [--prefix 绝对用户目录]'; exit 0 ;;
*) echo "未知参数:$1" >&2; exit 2 ;;
esac
done
[[ "$install_prefix" = /* && "$install_prefix" != / ]] || { echo '需要非根绝对安装路径' >&2; exit 2; }
missing=()
for tool in python3 fcitx5; do
command -v "$tool" >/dev/null 2>&1 || missing+=("$tool")
done
if ((${#missing[@]})); then
echo "缺少依赖:${missing[*]}" >&2
echo 'Debian / Ubuntu:sudo apt install python3 fcitx5 fcitx5-frontend-gtk3 fcitx5-frontend-gtk4 fcitx5-frontend-qt6 fcitx5-config-qt' >&2
exit 1
fi
install_prefix=$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$install_prefix")
# 随包模型与词库带的是下载缓存,按 models.lock / dicts.lock 核对后解开,不联网
python3 "$here/tools/release/models-fetch.py"
python3 "$here/tools/release/dicts-fetch.py"
python3 "$here/files.py" install "$install_prefix" --root "$here" --server "$here/bin/qingjian-linux-server" --settings "$here/bin/qingjian-settings" --plugin "$here/lib/qingjian.so"
printf '已安装。手动启动:%s/bin/qingjian-linux-server\n重启 Fcitx5,在配置工具取消“仅显示当前语言”后添加“青简”。\n设置:应用菜单里的“青简设置”,或 %s/bin/qingjian-settings\n' "$install_prefix" "$install_prefix"