fix: 修复多架构发行构建

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:
2026-08-23 19:14:26 +08:00
co-authored by Codex
parent 4f0617c597
commit 8db7828ada
17 changed files with 51 additions and 21 deletions
+3
View File
@@ -75,9 +75,11 @@ jobs:
include:
- arch: amd64
deb_arch: amd64
electron_app_dir: release/linux-unpacked
runner: ubuntu-24.04
- arch: arm64
deb_arch: arm64
electron_app_dir: release/linux-arm64-unpacked
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
@@ -101,6 +103,7 @@ jobs:
env:
MELOASR_VERSION: ${{ needs.update-flake-lock.outputs.version }}
MELOASR_DEB_ARCH: ${{ matrix.deb_arch }}
MELOASR_ELECTRON_APP_DIR: ${{ matrix.electron_app_dir }}
run: |
npm ci
npm run package:deb
+1 -1
View File
@@ -2,7 +2,7 @@
## 项目范围
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.8`。
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.9`。
不得恢复 Windows、PowerShell 或 Tauri 输出路径。发行版差异只能存在于依赖说明和打包配置,不能进入语音输入核心逻辑。
+8
View File
@@ -2,6 +2,14 @@
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 的格式。
## [0.1.9] - 2026-08-23
### 修复
- 修复 arm64 deb/rpm 构建使用错误 Electron 解包目录的问题。
- 修复 RPM 打包时 Fcitx5 addon 文件路径校验失败的问题。
- 修复 Nix 构建错误对项目根目录执行 CMake 配置的问题。
## [0.1.8] - 2026-08-23
### 修复
+1 -1
View File
@@ -2,7 +2,7 @@
## 项目范围
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.8`。
MeloASR 是仅面向 Linux 的 Fcitx5 桌面语音输入工具。项目名为 `MeloASR`,分发包名为 `meloasr`,当前版本为 `0.1.9`。
不得恢复 Windows、PowerShell 或 Tauri 输出路径。发行版差异只能存在于依赖说明和打包配置,不能进入语音输入核心逻辑。
+1 -1
View File
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)
project(meloasr-fcitx5 VERSION 0.1.8 LANGUAGES CXX)
project(meloasr-fcitx5 VERSION 0.1.9 LANGUAGES CXX)
include(GNUInstallDirs)
include(CTest)
+1 -1
View File
@@ -6,7 +6,7 @@ Comment[zh_CN]=将 MeloASR 网页后端连接到当前输入上下文
Type=SharedLibrary
Library=@MELOASR_LIBRARY_PATH@
Category=Module
Version=0.1.8
Version=0.1.9
OnDemand=False
Configurable=False
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "meloasr",
"version": "0.1.8",
"version": "0.1.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "meloasr",
"version": "0.1.8",
"version": "0.1.9",
"devDependencies": {
"@types/node": "^24.0.0",
"electron": "42.3.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "meloasr",
"productName": "MeloASR",
"version": "0.1.8",
"version": "0.1.9",
"private": true,
"author": "MeloASR contributors",
"description": "基于网页语音识别后端和 Fcitx5 的 Linux 实时语音输入工具",
+2 -2
View File
@@ -1,6 +1,6 @@
# Linux 分发打包
MeloASR 0.1.8 的系统包由两部分组成:
MeloASR 0.1.9 的系统包由两部分组成:
- Electron 应用安装到 `/opt/meloasr`,命令入口为 `/usr/bin/meloasr`;
- Fcitx5 常驻 addon 由目标发行版中的 CMake/Fcitx5 开发包编译,并安装到该环境报告的 addon 目录。
@@ -40,7 +40,7 @@ npm run build:linux:dir
packaging/deb/build-deb.sh
```
产物位于 `packaging/out/meloasr_0.1.8_<arch>.deb`。依赖名称按 Debian/Ubuntu 系列填写,但尚未在各发行版完成安装验证。
产物位于 `packaging/out/meloasr_0.1.9_<arch>.deb`。依赖名称按 Debian/Ubuntu 系列填写,但尚未在各发行版完成安装验证。
## rpm
+3 -3
View File
@@ -1,10 +1,10 @@
pkgname=meloasr
pkgver=0.1.8
pkgver=0.1.9
pkgrel=1
pkgdesc='Web-backed voice input for Fcitx5'
arch=('x86_64')
url='https://github.com/Melorise/MeloASR'
license=('custom')
license=('MPL2')
depends=('fcitx5' 'gtk3' 'nss' 'libxss' 'mesa' 'alsa-lib')
makedepends=('nodejs' 'npm' 'cmake' 'gcc' 'nlohmann-json')
source=("${pkgname}-${pkgver}.tar.gz")
@@ -38,7 +38,7 @@ package() {
"${pkgdir}/etc/xdg/autostart/meloasr.desktop"
install -Dm644 packaging/assets/meloasr.metainfo.xml \
"${pkgdir}/usr/share/metainfo/meloasr.metainfo.xml"
install -Dm644 logo.png \
install -Dm644 src/assets/logo.png \
"${pkgdir}/usr/share/pixmaps/meloasr.png"
DESTDIR="${pkgdir}" cmake --install build/fcitx5
+1 -1
View File
@@ -1,6 +1,6 @@
# Arch Linux 构建
发布时把项目源码归档为 `meloasr-0.1.8.tar.gz`,与 `PKGBUILD` 放在同一目录,随后运行:
发布时把项目源码归档为 `meloasr-0.1.9.tar.gz`,与 `PKGBUILD` 放在同一目录,随后运行:
```bash
makepkg --syncdeps --cleanbuild
+2 -1
View File
@@ -5,7 +5,7 @@
<summary>Web-backed voice input for Fcitx5</summary>
<summary xml:lang="zh-CN">基于网页后端的 Fcitx5 语音输入工具</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LicenseRef-proprietary</project_license>
<project_license>MPL-2.0</project_license>
<description>
<p>MeloASR connects supported web speech-recognition backends to the active Fcitx5 input context.</p>
<p xml:lang="zh-CN">MeloASR 将支持的网页语音识别后端连接到当前 Fcitx5 输入上下文。</p>
@@ -16,6 +16,7 @@
<binary>meloasr</binary>
</provides>
<releases>
<release version="0.1.9" date="2026-08-23"/>
<release version="0.1.8" date="2026-08-23"/>
<release version="0.1.7" date="2026-08-23"/>
</releases>
+2 -2
View File
@@ -2,9 +2,9 @@
set -euo pipefail
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
version="${MELOASR_VERSION:-0.1.8}"
version="${MELOASR_VERSION:-0.1.9}"
arch="${MELOASR_DEB_ARCH:-$(dpkg --print-architecture)}"
app_dir="${1:-${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"
output_dir="${project_dir}/packaging/out"
+3
View File
@@ -30,6 +30,9 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ fcitx5 nlohmann_json ];
# 项目根目录不是 CMake 工程;Fcitx5 addon 在自定义 buildPhase 中单独配置。
dontConfigure = true;
buildPhase = ''
runHook preBuild
npm run build
+9 -2
View File
@@ -2,8 +2,8 @@
set -euo pipefail
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
version="${MELOASR_VERSION:-0.1.8}"
app_dir="${1:-${project_dir}/release/linux-unpacked}"
version="${MELOASR_VERSION:-0.1.9}"
app_dir="${1:-${MELOASR_ELECTRON_APP_DIR:-${project_dir}/release/linux-unpacked}}"
stage_dir="${project_dir}/packaging/out/rpm-root"
top_dir="${project_dir}/packaging/out/rpmbuild"
@@ -14,12 +14,19 @@ command -v rpmbuild >/dev/null || {
rm -rf -- "${stage_dir}" "${top_dir}"
"${project_dir}/packaging/scripts/stage-linux.sh" "${app_dir}" "${stage_dir}"
addon_file="$(find "${stage_dir}/usr" -type f -path '*/fcitx5/libmeloasr.so' \
-printf '/usr/%P\n' -quit)"
if [[ -z "${addon_file}" ]]; then
echo "未在安装根目录中找到 Fcitx5 addon。" >&2
exit 1
fi
mkdir -p "${top_dir}"/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
tar -C "${stage_dir}" -czf "${top_dir}/SOURCES/meloasr-root.tar.gz" .
rpmbuild -bb \
--define "_topdir ${top_dir}" \
--define "meloasr_version ${version}" \
--define "meloasr_addon_file ${addon_file}" \
"${project_dir}/packaging/rpm/meloasr-binary.spec"
find "${top_dir}/RPMS" -type f -name '*.rpm' -exec cp -f {} "${project_dir}/packaging/out/" \;
+6 -2
View File
@@ -2,7 +2,7 @@ Name: meloasr
Version: %{meloasr_version}
Release: 1%{?dist}
Summary: Web-backed voice input for Fcitx5
License: LicenseRef-Proprietary
License: MPL-2.0
URL: https://github.com/Melorise/MeloASR
Source0: meloasr-root.tar.gz
@@ -28,7 +28,7 @@ tar -C %{buildroot} -xzf %{SOURCE0}
%defattr(-,root,root,-)
/opt/meloasr
/usr/bin/meloasr
/usr/lib*/fcitx5/libmeloasr.so
%{meloasr_addon_file}
/usr/share/applications/meloasr.desktop
/usr/share/pixmaps/meloasr.png
/usr/share/metainfo/meloasr.metainfo.xml
@@ -36,6 +36,10 @@ tar -C %{buildroot} -xzf %{SOURCE0}
/etc/xdg/autostart/meloasr.desktop
%changelog
* Sun Aug 23 2026 MeloASR contributors - 0.1.9-1
- Fix multi-architecture package staging and RPM addon file ownership.
- Fix Nix derivation configuration phase.
* Sun Aug 23 2026 MeloASR contributors - 0.1.8-1
- Fix Fcitx5 addon compatibility with Ubuntu 24.04.
+5 -1
View File
@@ -2,10 +2,14 @@
set -euo pipefail
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
app_dir="${1:-${project_dir}/release/linux-unpacked}"
app_dir="${1:-${MELOASR_ELECTRON_APP_DIR:-${project_dir}/release/linux-unpacked}}"
stage_dir="${2:-${project_dir}/packaging/out/root}"
addon_build_dir="${MELOASR_ADDON_BUILD_DIR:-${project_dir}/packaging/out/fcitx5-build}"
if [[ "${app_dir}" != /* ]]; then
app_dir="${project_dir}/${app_dir}"
fi
if [[ ! -d "${app_dir}" ]]; then
echo "缺少 Electron 解包目录:${app_dir}" >&2
echo "请先运行项目提供的 Linux directory 构建脚本。" >&2