mirror of
https://github.com/Melorise/TamaASR.git
synced 2026-11-07 14:39:32 +00:00
build: 迁移依赖管理至 pnpm
AI-assisted-by: Codex AI-model: gpt-5.6-sol AI-reasoning-effort: medium Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -87,10 +87,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ needs.update-flake-lock.outputs.commit_sha }}
|
ref: ${{ needs.update-flake-lock.outputs.commit_sha }}
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 11.21.0
|
||||||
|
run_install: false
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: npm
|
cache: pnpm
|
||||||
|
|
||||||
- name: 安装系统构建依赖
|
- name: 安装系统构建依赖
|
||||||
run: |
|
run: |
|
||||||
@@ -105,9 +110,9 @@ jobs:
|
|||||||
MELOASR_DEB_ARCH: ${{ matrix.deb_arch }}
|
MELOASR_DEB_ARCH: ${{ matrix.deb_arch }}
|
||||||
MELOASR_ELECTRON_APP_DIR: ${{ matrix.electron_app_dir }}
|
MELOASR_ELECTRON_APP_DIR: ${{ matrix.electron_app_dir }}
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
pnpm install --frozen-lockfile
|
||||||
npm run package:deb
|
pnpm run package:deb
|
||||||
npm run package:rpm
|
pnpm run package:rpm
|
||||||
mkdir -p release-artifacts
|
mkdir -p release-artifacts
|
||||||
cp packaging/out/*.deb packaging/out/*.rpm release-artifacts/
|
cp packaging/out/*.deb packaging/out/*.rpm release-artifacts/
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 项目范围
|
## 项目范围
|
||||||
|
|
||||||
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.15`。
|
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.16`。
|
||||||
|
|
||||||
不得恢复 Windows、PowerShell 或 Tauri 输出路径。发行版差异只能存在于依赖说明和打包配置,不能进入语音输入核心逻辑。
|
不得恢复 Windows、PowerShell 或 Tauri 输出路径。发行版差异只能存在于依赖说明和打包配置,不能进入语音输入核心逻辑。
|
||||||
|
|
||||||
@@ -75,18 +75,18 @@ MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `M
|
|||||||
核心命令:
|
核心命令:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm test
|
pnpm test
|
||||||
npm run build
|
pnpm run build
|
||||||
npm run build:fcitx5
|
pnpm run build:fcitx5
|
||||||
ctest --test-dir linux/fcitx5/build --output-on-failure
|
ctest --test-dir linux/fcitx5/build --output-on-failure
|
||||||
```
|
```
|
||||||
|
|
||||||
验证必须与实际改动范围对应,禁止为了展示“完整”而机械扩大测试范围:
|
验证必须与实际改动范围对应,禁止为了展示“完整”而机械扩大测试范围:
|
||||||
|
|
||||||
- TypeScript、preload 或 renderer 改动运行 `npm test` 和 `npm run build`;
|
- TypeScript、preload 或 renderer 改动运行 `pnpm test` 和 `pnpm run build`;
|
||||||
- 只有修改 Fcitx5 C++、CMake 构建逻辑或本地协议实现时,才运行 `npm run build:fcitx5` 和 `ctest`;仅同步发行版本号不要求重测未改动的 Fcitx5 逻辑;
|
- 只有修改 Fcitx5 C++、CMake 构建逻辑或本地协议实现时,才运行 `pnpm run build:fcitx5` 和 `ctest`;仅同步发行版本号不要求重测未改动的 Fcitx5 逻辑;
|
||||||
- FHS 发行版是首要维护目标,FHS 构建或打包问题必须在对应 Debian、Ubuntu、RPM 或 Arch 环境处理,不得默认用 Nix 环境替代;Nix 只用于验证 Nix 打包路径;
|
- FHS 发行版是首要维护目标,FHS 构建或打包问题必须在对应 Debian、Ubuntu、RPM 或 Arch 环境处理,不得默认用 Nix 环境替代;Nix 只用于验证 Nix 打包路径;
|
||||||
- 项目依赖未安装时,按 `package-lock.json` 运行 `npm ci`,不能以 `tsc` 或其它工具缺失为由跳过正常验证;
|
- 项目依赖未安装时,按 `pnpm-lock.yaml` 运行 `pnpm install --frozen-lockfile`,不能以 `tsc` 或其它工具缺失为由跳过正常验证;
|
||||||
- 不得声称添加了未实际添加的测试,也不得把无关环境中的成功构建计入目标平台验证结果。
|
- 不得声称添加了未实际添加的测试,也不得把无关环境中的成功构建计入目标平台验证结果。
|
||||||
|
|
||||||
最低动态回归:连续三轮;文本缩短、改词和补标点;finish 仅一次;cancel/reset/disconnect;ready gate;登录探测;后端切换;多屏位置和键盘微调;托盘退出/重启;自启动;GTK、Qt、Chromium 和终端;X11 与 Wayland。
|
最低动态回归:连续三轮;文本缩短、改词和补标点;finish 仅一次;cancel/reset/disconnect;ready gate;登录探测;后端切换;多屏位置和键盘微调;托盘退出/重启;自启动;GTK、Qt、Chromium 和终端;X11 与 Wayland。
|
||||||
@@ -97,7 +97,7 @@ ctest --test-dir linux/fcitx5/build --output-on-failure
|
|||||||
|
|
||||||
deb、rpm、Arch/pacman 和 Nix 都必须包含 Electron 应用、desktop/icon/autostart 文件和 Fcitx5 addon。桌面 ID、包名、Socket、addon 名称和版本保持一致。仓库地址和许可证确定前,不得把占位值作为正式发行元数据。
|
deb、rpm、Arch/pacman 和 Nix 都必须包含 Electron 应用、desktop/icon/autostart 文件和 Fcitx5 addon。桌面 ID、包名、Socket、addon 名称和版本保持一致。仓库地址和许可证确定前,不得把占位值作为正式发行元数据。
|
||||||
|
|
||||||
版本发布时同步 `package.json`、`package-lock.json`、CHANGELOG、AppStream、Fcitx5 addon 版本和各发行版打包元数据,并运行 `scripts/release-metadata.mjs <version>` 校验发布说明。
|
版本发布时同步 `package.json`、`pnpm-lock.yaml`、CHANGELOG、AppStream、Fcitx5 addon 版本和各发行版打包元数据,并运行 `scripts/release-metadata.mjs <version>` 校验发布说明。
|
||||||
|
|
||||||
`v*` Git 标签由远程 Release 工作流产生。除非用户明确要求,本地禁止创建、移动或删除发布标签,也禁止推送提交或标签。“更新版本”或“更新发版”本身不等于授权本地打标签。
|
`v*` Git 标签由远程 Release 工作流产生。除非用户明确要求,本地禁止创建、移动或删除发布标签,也禁止推送提交或标签。“更新版本”或“更新发版”本身不等于授权本地打标签。
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 的格式。
|
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 的格式。
|
||||||
|
|
||||||
|
## [0.1.16] - 2026-08-26
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
|
||||||
|
- 项目依赖管理、构建脚本、Arch 打包和 Release 工作流统一迁移到 pnpm,避免 npm 将第三方镜像地址识别为禁用的 remote 包。
|
||||||
|
- 使用不包含 registry 下载地址的 `pnpm-lock.yaml` 替代 `package-lock.json`,使锁文件不再固化生成环境的 npm 镜像。
|
||||||
|
|
||||||
## [0.1.15] - 2026-08-26
|
## [0.1.15] - 2026-08-26
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 项目范围
|
## 项目范围
|
||||||
|
|
||||||
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.15`。
|
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.16`。
|
||||||
|
|
||||||
不得恢复 Windows、PowerShell 或 Tauri 输出路径。发行版差异只能存在于依赖说明和打包配置,不能进入语音输入核心逻辑。
|
不得恢复 Windows、PowerShell 或 Tauri 输出路径。发行版差异只能存在于依赖说明和打包配置,不能进入语音输入核心逻辑。
|
||||||
|
|
||||||
@@ -75,18 +75,18 @@ MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `M
|
|||||||
核心命令:
|
核心命令:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm test
|
pnpm test
|
||||||
npm run build
|
pnpm run build
|
||||||
npm run build:fcitx5
|
pnpm run build:fcitx5
|
||||||
ctest --test-dir linux/fcitx5/build --output-on-failure
|
ctest --test-dir linux/fcitx5/build --output-on-failure
|
||||||
```
|
```
|
||||||
|
|
||||||
验证必须与实际改动范围对应,禁止为了展示“完整”而机械扩大测试范围:
|
验证必须与实际改动范围对应,禁止为了展示“完整”而机械扩大测试范围:
|
||||||
|
|
||||||
- TypeScript、preload 或 renderer 改动运行 `npm test` 和 `npm run build`;
|
- TypeScript、preload 或 renderer 改动运行 `pnpm test` 和 `pnpm run build`;
|
||||||
- 只有修改 Fcitx5 C++、CMake 构建逻辑或本地协议实现时,才运行 `npm run build:fcitx5` 和 `ctest`;仅同步发行版本号不要求重测未改动的 Fcitx5 逻辑;
|
- 只有修改 Fcitx5 C++、CMake 构建逻辑或本地协议实现时,才运行 `pnpm run build:fcitx5` 和 `ctest`;仅同步发行版本号不要求重测未改动的 Fcitx5 逻辑;
|
||||||
- FHS 发行版是首要维护目标,FHS 构建或打包问题必须在对应 Debian、Ubuntu、RPM 或 Arch 环境处理,不得默认用 Nix 环境替代;Nix 只用于验证 Nix 打包路径;
|
- FHS 发行版是首要维护目标,FHS 构建或打包问题必须在对应 Debian、Ubuntu、RPM 或 Arch 环境处理,不得默认用 Nix 环境替代;Nix 只用于验证 Nix 打包路径;
|
||||||
- 项目依赖未安装时,按 `package-lock.json` 运行 `npm ci`,不能以 `tsc` 或其它工具缺失为由跳过正常验证;
|
- 项目依赖未安装时,按 `pnpm-lock.yaml` 运行 `pnpm install --frozen-lockfile`,不能以 `tsc` 或其它工具缺失为由跳过正常验证;
|
||||||
- 不得声称添加了未实际添加的测试,也不得把无关环境中的成功构建计入目标平台验证结果。
|
- 不得声称添加了未实际添加的测试,也不得把无关环境中的成功构建计入目标平台验证结果。
|
||||||
|
|
||||||
最低动态回归:连续三轮;文本缩短、改词和补标点;finish 仅一次;cancel/reset/disconnect;ready gate;登录探测;后端切换;多屏位置和键盘微调;托盘退出/重启;自启动;GTK、Qt、Chromium 和终端;X11 与 Wayland。
|
最低动态回归:连续三轮;文本缩短、改词和补标点;finish 仅一次;cancel/reset/disconnect;ready gate;登录探测;后端切换;多屏位置和键盘微调;托盘退出/重启;自启动;GTK、Qt、Chromium 和终端;X11 与 Wayland。
|
||||||
@@ -97,7 +97,7 @@ ctest --test-dir linux/fcitx5/build --output-on-failure
|
|||||||
|
|
||||||
deb、rpm、Arch/pacman 和 Nix 都必须包含 Electron 应用、desktop/icon/autostart 文件和 Fcitx5 addon。桌面 ID、包名、Socket、addon 名称和版本保持一致。仓库地址和许可证确定前,不得把占位值作为正式发行元数据。
|
deb、rpm、Arch/pacman 和 Nix 都必须包含 Electron 应用、desktop/icon/autostart 文件和 Fcitx5 addon。桌面 ID、包名、Socket、addon 名称和版本保持一致。仓库地址和许可证确定前,不得把占位值作为正式发行元数据。
|
||||||
|
|
||||||
版本发布时同步 `package.json`、`package-lock.json`、CHANGELOG、AppStream、Fcitx5 addon 版本和各发行版打包元数据,并运行 `scripts/release-metadata.mjs <version>` 校验发布说明。
|
版本发布时同步 `package.json`、`pnpm-lock.yaml`、CHANGELOG、AppStream、Fcitx5 addon 版本和各发行版打包元数据,并运行 `scripts/release-metadata.mjs <version>` 校验发布说明。
|
||||||
|
|
||||||
`v*` Git 标签由远程 Release 工作流产生。除非用户明确要求,本地禁止创建、移动或删除发布标签,也禁止推送提交或标签。“更新版本”或“更新发版”本身不等于授权本地打标签。
|
`v*` Git 标签由远程 Release 工作流产生。除非用户明确要求,本地禁止创建、移动或删除发布标签,也禁止推送提交或标签。“更新版本”或“更新发版”本身不等于授权本地打标签。
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ api调用——调用各大ai厂商的语音转文字api。显然,该方案最
|
|||||||
依赖:Node.js 22+、CMake 3.16+、支持 C++20 的编译器、Fcitx5 Core/Utils 开发包、nlohmann-json。
|
依赖:Node.js 22+、CMake 3.16+、支持 C++20 的编译器、Fcitx5 Core/Utils 开发包、nlohmann-json。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
pnpm install --frozen-lockfile
|
||||||
npm test
|
pnpm test
|
||||||
npm run build:fcitx5
|
pnpm run build:fcitx5
|
||||||
./linux/fcitx5/install-user.sh
|
./linux/fcitx5/install-user.sh
|
||||||
fcitx5 -r
|
fcitx5 -r
|
||||||
npm start
|
pnpm start
|
||||||
```
|
```
|
||||||
|
|
||||||
应用默认由托盘常驻,设置页与后端调试窗口默认隐藏。首次打开某个后端的调试窗口时,应用会提示登录;登录状态保存在该后端自己的 persistent partition 中。
|
应用默认由托盘常驻,设置页与后端调试窗口默认隐藏。首次打开某个后端的调试窗口时,应用会提示登录;登录状态保存在该后端自己的 persistent partition 中。
|
||||||
@@ -78,9 +78,9 @@ npm start
|
|||||||
## Linux 分发
|
## Linux 分发
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build:linux:dir
|
pnpm run build:linux:dir
|
||||||
npm run package:deb
|
pnpm run package:deb
|
||||||
npm run package:rpm
|
pnpm run package:rpm
|
||||||
```
|
```
|
||||||
|
|
||||||
Arch/pacman 配置位于 `packaging/arch/`,Nix 入口为 `flake.nix`。详细依赖、验证状态和发布前替换项见 `packaging/README.md`。
|
Arch/pacman 配置位于 `packaging/arch/`,Nix 入口为 `flake.nix`。详细依赖、验证状态和发布前替换项见 `packaging/README.md`。
|
||||||
@@ -92,8 +92,8 @@ Arch/pacman 配置位于 `packaging/arch/`,Nix 入口为 `flake.nix`。详细
|
|||||||
## 验证
|
## 验证
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm test
|
pnpm test
|
||||||
npm run build
|
pnpm run build
|
||||||
npm run build:fcitx5
|
pnpm run build:fcitx5
|
||||||
ctest --test-dir linux/fcitx5/build --output-on-failure
|
ctest --test-dir linux/fcitx5/build --output-on-failure
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
nodejs
|
nodejs
|
||||||
|
pnpm_11
|
||||||
cmake
|
cmake
|
||||||
pkg-config
|
pkg-config
|
||||||
fcitx5
|
fcitx5
|
||||||
@@ -37,4 +38,3 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(meloasr-fcitx5 VERSION 0.1.15 LANGUAGES CXX)
|
project(meloasr-fcitx5 VERSION 0.1.16 LANGUAGES CXX)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Comment[zh_CN]=将 MeloASR 网页后端连接到当前输入上下文
|
|||||||
Type=SharedLibrary
|
Type=SharedLibrary
|
||||||
Library=@MELOASR_LIBRARY_PATH@
|
Library=@MELOASR_LIBRARY_PATH@
|
||||||
Category=Module
|
Category=Module
|
||||||
Version=0.1.15
|
Version=0.1.16
|
||||||
OnDemand=False
|
OnDemand=False
|
||||||
Configurable=False
|
Configurable=False
|
||||||
|
|
||||||
|
|||||||
Generated
-4158
File diff suppressed because it is too large
Load Diff
+8
-7
@@ -1,21 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "meloasr",
|
"name": "meloasr",
|
||||||
"productName": "MeloASR",
|
"productName": "MeloASR",
|
||||||
"version": "0.1.15",
|
"version": "0.1.16",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"packageManager": "pnpm@11.21.0",
|
||||||
"author": "MeloASR contributors",
|
"author": "MeloASR contributors",
|
||||||
"description": "基于网页语音识别后端和 Fcitx5 的 Linux 实时语音输入工具",
|
"description": "基于网页语音识别后端和 Fcitx5 的 Linux 实时语音输入工具",
|
||||||
"main": "dist/main/index.js",
|
"main": "dist/main/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "node scripts/clean.mjs",
|
"clean": "node scripts/clean.mjs",
|
||||||
"build": "npm run clean && tsc && esbuild src/preload/backend.ts --bundle --platform=node --format=cjs --external:electron --outfile=dist/preload/backend.js && node scripts/copy-static.mjs",
|
"build": "pnpm run clean && tsc && esbuild src/preload/backend.ts --bundle --platform=node --format=cjs --external:electron --outfile=dist/preload/backend.js && node scripts/copy-static.mjs",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"start": "npm run build && electron --ozone-platform=x11 .",
|
"start": "pnpm run build && electron --ozone-platform=x11 .",
|
||||||
"build:fcitx5": "cmake -S linux/fcitx5 -B linux/fcitx5/build -DCMAKE_BUILD_TYPE=Release && cmake --build linux/fcitx5/build --parallel",
|
"build:fcitx5": "cmake -S linux/fcitx5 -B linux/fcitx5/build -DCMAKE_BUILD_TYPE=Release && cmake --build linux/fcitx5/build --parallel",
|
||||||
"build:linux:dir": "npm run build && electron-builder --config packaging/electron-builder.yml --linux dir",
|
"build:linux:dir": "pnpm run build && electron-builder --config packaging/electron-builder.yml --linux dir",
|
||||||
"package:deb": "npm run build:linux:dir && packaging/deb/build-deb.sh",
|
"package:deb": "pnpm run build:linux:dir && packaging/deb/build-deb.sh",
|
||||||
"package:rpm": "npm run build:linux:dir && packaging/rpm/build-rpm.sh",
|
"package:rpm": "pnpm run build:linux:dir && packaging/rpm/build-rpm.sh",
|
||||||
"test": "npm run typecheck && tsc -p tsconfig.test.json && node --test dist-test/test/*.test.js"
|
"test": "pnpm run typecheck && tsc -p tsconfig.test.json && node --test dist-test/test/*.test.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.0.0",
|
"@types/node": "^24.0.0",
|
||||||
|
|||||||
+7
-7
@@ -1,6 +1,6 @@
|
|||||||
# Linux 分发打包
|
# Linux 分发打包
|
||||||
|
|
||||||
MeloASR 0.1.15 的系统包由两部分组成:
|
MeloASR 0.1.16 的系统包由两部分组成:
|
||||||
|
|
||||||
- Electron 应用安装到 `/opt/meloasr`,命令入口为 `/usr/bin/meloasr`;
|
- Electron 应用安装到 `/opt/meloasr`,命令入口为 `/usr/bin/meloasr`;
|
||||||
- Fcitx5 常驻 addon 由目标发行版中的 CMake/Fcitx5 开发包编译,并安装到该环境报告的 addon 目录。
|
- Fcitx5 常驻 addon 由目标发行版中的 CMake/Fcitx5 开发包编译,并安装到该环境报告的 addon 目录。
|
||||||
@@ -12,7 +12,7 @@ MeloASR 0.1.15 的系统包由两部分组成:
|
|||||||
deb、rpm 和 Arch 配置期望项目提供:
|
deb、rpm 和 Arch 配置期望项目提供:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build:linux:dir
|
pnpm run build:linux:dir
|
||||||
```
|
```
|
||||||
|
|
||||||
该命令应在 `release/linux-unpacked/` 生成可直接运行的 Electron 目录,并且主程序名必须是 `meloasr`。仓库提供的 `electron-builder.yml` 只生成这一中间目录;deb/rpm/Arch 的系统文件仍由各自脚本管理,避免用安装钩子复制未被包管理器追踪的 Fcitx5 文件。
|
该命令应在 `release/linux-unpacked/` 生成可直接运行的 Electron 目录,并且主程序名必须是 `meloasr`。仓库提供的 `electron-builder.yml` 只生成这一中间目录;deb/rpm/Arch 的系统文件仍由各自脚本管理,避免用安装钩子复制未被包管理器追踪的 Fcitx5 文件。
|
||||||
@@ -21,7 +21,7 @@ npm run build:linux:dir
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"build:linux:dir": "npm run build && electron-builder --config packaging/electron-builder.yml --linux dir"
|
"build:linux:dir": "pnpm run build && electron-builder --config packaging/electron-builder.yml --linux dir"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,18 +36,18 @@ packaging/scripts/stage-linux.sh release/linux-unpacked packaging/out/root
|
|||||||
在 Debian/Ubuntu 对应目标环境中安装 Node.js 构建依赖、CMake、C++ 编译器、Fcitx5 开发包与 nlohmann-json 开发包,然后执行:
|
在 Debian/Ubuntu 对应目标环境中安装 Node.js 构建依赖、CMake、C++ 编译器、Fcitx5 开发包与 nlohmann-json 开发包,然后执行:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build:linux:dir
|
pnpm run build:linux:dir
|
||||||
packaging/deb/build-deb.sh
|
packaging/deb/build-deb.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
产物位于 `packaging/out/meloasr_0.1.15_<arch>.deb`。依赖名称按 Debian/Ubuntu 系列填写,但尚未在各发行版完成安装验证。
|
产物位于 `packaging/out/meloasr_0.1.16_<arch>.deb`。依赖名称按 Debian/Ubuntu 系列填写,但尚未在各发行版完成安装验证。
|
||||||
|
|
||||||
## rpm
|
## rpm
|
||||||
|
|
||||||
在目标 RPM 发行版中准备相同的编译依赖和 `rpmbuild`,然后执行:
|
在目标 RPM 发行版中准备相同的编译依赖和 `rpmbuild`,然后执行:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build:linux:dir
|
pnpm run build:linux:dir
|
||||||
packaging/rpm/build-rpm.sh
|
packaging/rpm/build-rpm.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ nix build
|
|||||||
nix run
|
nix run
|
||||||
```
|
```
|
||||||
|
|
||||||
flake 使用 nixpkgs 的 Electron,Node 依赖由 `package-lock.json` 的 integrity 数据导入,不需要手写固定输出 hash。仓库首次确定发布地址后,需要锁定并提交 `flake.lock`。当前环境没有 Nix,尚未实际执行上述命令。
|
flake 使用 nixpkgs 的 Electron,Node 依赖由 `pnpm-lock.yaml` 和固定输出的 pnpm store 导入。仓库首次确定发布地址后,需要锁定并提交 `flake.lock`。
|
||||||
|
|
||||||
## 发布前必须完成
|
## 发布前必须完成
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
pkgname=meloasr
|
pkgname=meloasr
|
||||||
pkgver=0.1.15
|
pkgver=0.1.16
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='Web-backed voice input for Fcitx5'
|
pkgdesc='Web-backed voice input for Fcitx5'
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url='https://github.com/Melorise/MeloASR'
|
url='https://github.com/Melorise/MeloASR'
|
||||||
license=('MPL2')
|
license=('MPL2')
|
||||||
depends=('fcitx5' 'gtk3' 'nss' 'libxss' 'mesa' 'alsa-lib')
|
depends=('fcitx5' 'gtk3' 'nss' 'libxss' 'mesa' 'alsa-lib')
|
||||||
makedepends=('nodejs' 'npm' 'cmake' 'gcc' 'nlohmann-json')
|
makedepends=('nodejs' 'pnpm' 'cmake' 'gcc' 'nlohmann-json')
|
||||||
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
|
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@ _source_dir="MeloASR-${pkgver}"
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/${_source_dir}"
|
cd "${srcdir}/${_source_dir}"
|
||||||
npm ci
|
pnpm install --frozen-lockfile
|
||||||
npm run build:linux:dir
|
pnpm run build:linux:dir
|
||||||
cmake -S linux/fcitx5 -B build/fcitx5 \
|
cmake -S linux/fcitx5 -B build/fcitx5 \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr
|
-DCMAKE_INSTALL_PREFIX=/usr
|
||||||
@@ -24,7 +24,7 @@ build() {
|
|||||||
|
|
||||||
check() {
|
check() {
|
||||||
cd "${srcdir}/${_source_dir}"
|
cd "${srcdir}/${_source_dir}"
|
||||||
npm test
|
pnpm test
|
||||||
ctest --test-dir build/fcitx5 --output-on-failure
|
ctest --test-dir build/fcitx5 --output-on-failure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl --fail --location --remote-name \
|
curl --fail --location --remote-name \
|
||||||
https://github.com/Melorise/MeloASR/releases/download/v0.1.15/PKGBUILD
|
https://github.com/Melorise/MeloASR/releases/download/v0.1.16/PKGBUILD
|
||||||
makepkg --syncdeps --cleanbuild
|
makepkg --syncdeps --cleanbuild
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<binary>meloasr</binary>
|
<binary>meloasr</binary>
|
||||||
</provides>
|
</provides>
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="0.1.16" date="2026-08-26"/>
|
||||||
<release version="0.1.15" date="2026-08-26"/>
|
<release version="0.1.15" date="2026-08-26"/>
|
||||||
<release version="0.1.14" date="2026-08-26"/>
|
<release version="0.1.14" date="2026-08-26"/>
|
||||||
<release version="0.1.13" date="2026-08-24"/>
|
<release version="0.1.13" date="2026-08-24"/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||||
version="${MELOASR_VERSION:-0.1.15}"
|
version="${MELOASR_VERSION:-0.1.16}"
|
||||||
arch="${MELOASR_DEB_ARCH:-$(dpkg --print-architecture)}"
|
arch="${MELOASR_DEB_ARCH:-$(dpkg --print-architecture)}"
|
||||||
app_dir="${1:-${MELOASR_ELECTRON_APP_DIR:-${project_dir}/release/linux-unpacked}}"
|
app_dir="${1:-${MELOASR_ELECTRON_APP_DIR:-${project_dir}/release/linux-unpacked}}"
|
||||||
work_dir="${project_dir}/packaging/out/deb-root"
|
work_dir="${project_dir}/packaging/out/deb-root"
|
||||||
|
|||||||
+16
-12
@@ -1,7 +1,9 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, importNpmLock
|
, fetchPnpmDeps
|
||||||
, nodejs
|
, nodejs
|
||||||
|
, pnpm_11
|
||||||
|
, pnpmConfigHook
|
||||||
, electron
|
, electron
|
||||||
, cmake
|
, cmake
|
||||||
, pkg-config
|
, pkg-config
|
||||||
@@ -10,19 +12,26 @@
|
|||||||
, nlohmann_json
|
, nlohmann_json
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
pnpm = pnpm_11;
|
||||||
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "meloasr";
|
pname = "meloasr";
|
||||||
version = (builtins.fromJSON (builtins.readFile ../../package.json)).version;
|
version = (builtins.fromJSON (builtins.readFile ../../package.json)).version;
|
||||||
|
|
||||||
src = ../..;
|
src = ../..;
|
||||||
|
|
||||||
npmDeps = importNpmLock {
|
pnpmDeps = fetchPnpmDeps {
|
||||||
npmRoot = finalAttrs.src;
|
inherit (finalAttrs) pname version src;
|
||||||
|
inherit pnpm;
|
||||||
|
fetcherVersion = 4;
|
||||||
|
hash = "sha256-KoxRIhZVhshxTpl5rzzfUnaSAuGo3gCvFD2FsltN1gc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
nodejs
|
nodejs
|
||||||
importNpmLock.npmConfigHook
|
pnpm
|
||||||
|
pnpmConfigHook
|
||||||
cmake
|
cmake
|
||||||
pkg-config
|
pkg-config
|
||||||
makeWrapper
|
makeWrapper
|
||||||
@@ -30,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
buildInputs = [ fcitx5 nlohmann_json ];
|
buildInputs = [ fcitx5 nlohmann_json ];
|
||||||
|
|
||||||
# 保留 npmConfigHook 的 postConfigure 生命周期,但不对项目根目录运行默认 CMake 配置。
|
# 保留 pnpmConfigHook 的 postConfigure 生命周期,但不对项目根目录运行默认 CMake 配置。
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
runHook postConfigure
|
runHook postConfigure
|
||||||
@@ -38,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
npm run build
|
pnpm run build
|
||||||
cmake -S linux/fcitx5 -B build/fcitx5 \
|
cmake -S linux/fcitx5 -B build/fcitx5 \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX="$out" \
|
-DCMAKE_INSTALL_PREFIX="$out" \
|
||||||
@@ -49,7 +58,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
npm test
|
pnpm test
|
||||||
ctest --test-dir build/fcitx5 --output-on-failure
|
ctest --test-dir build/fcitx5 --output-on-failure
|
||||||
runHook postCheck
|
runHook postCheck
|
||||||
'';
|
'';
|
||||||
@@ -65,11 +74,6 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
cp package.json "$appDir/"
|
cp package.json "$appDir/"
|
||||||
cp -r dist "$appDir/"
|
cp -r dist "$appDir/"
|
||||||
if [ -d node_modules ]; then
|
|
||||||
npm prune --omit=dev --ignore-scripts
|
|
||||||
cp -r node_modules "$appDir/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
install -Dm644 packaging/assets/meloasr.desktop \
|
install -Dm644 packaging/assets/meloasr.desktop \
|
||||||
"$out/share/applications/meloasr.desktop"
|
"$out/share/applications/meloasr.desktop"
|
||||||
install -Dm644 packaging/assets/meloasr-autostart.desktop \
|
install -Dm644 packaging/assets/meloasr-autostart.desktop \
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||||
version="${MELOASR_VERSION:-0.1.15}"
|
version="${MELOASR_VERSION:-0.1.16}"
|
||||||
app_dir="${1:-${MELOASR_ELECTRON_APP_DIR:-${project_dir}/release/linux-unpacked}}"
|
app_dir="${1:-${MELOASR_ELECTRON_APP_DIR:-${project_dir}/release/linux-unpacked}}"
|
||||||
stage_dir="${project_dir}/packaging/out/rpm-root"
|
stage_dir="${project_dir}/packaging/out/rpm-root"
|
||||||
top_dir="${project_dir}/packaging/out/rpmbuild"
|
top_dir="${project_dir}/packaging/out/rpmbuild"
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ tar -C %{buildroot} -xzf %{SOURCE0}
|
|||||||
/etc/xdg/autostart/meloasr.desktop
|
/etc/xdg/autostart/meloasr.desktop
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 26 2026 MeloASR contributors - 0.1.16-1
|
||||||
|
- Migrate dependency installation and build commands from npm to pnpm.
|
||||||
|
|
||||||
* Wed Aug 26 2026 MeloASR contributors - 0.1.15-1
|
* Wed Aug 26 2026 MeloASR contributors - 0.1.15-1
|
||||||
- Download the Arch package source directly from the matching GitHub release tag.
|
- Download the Arch package source directly from the matching GitHub release tag.
|
||||||
|
|
||||||
|
|||||||
Generated
+2530
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
|||||||
|
allowBuilds:
|
||||||
|
electron: true
|
||||||
|
electron-winstaller: false
|
||||||
|
esbuild: true
|
||||||
Reference in New Issue
Block a user