crisperweaver-bin

LOW
maintainer parasail 0 votes scanned 2026-09-23 09:40:25.835658
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: parasail <ikunji@duck.com>
2
3pkgname=crisperweaver-bin
4pkgver=0.11.1
5pkgrel=2
6pkgdesc="On-device audio transcription and speech synthesis GUI (Flutter frontend for the CrispASR engine)"
7arch=('x86_64')
8url="https://github.com/CrispStrobe/CrisperWeaver"
9license=('AGPL-3.0-only')
10_api="https://api.github.com/repos/CrispStrobe/CrisperWeaver"
11depends=(
12 'glibc'
13 'gcc-libs'
14 'gtk3'
15 # libkeybinder-3.0.so.0 — required by libhotkey_manager_linux_plugin.so, which
16 # the Flutter plugin registrant loads at startup (desktop global hotkeys).
17 'libkeybinder3'
18 # path_provider 在 Linux 上要跑 `xdg-user-dir` 才能解析“应用文档目录”,
19 # 没有这个二进制时应用能启动但会报 MissingPlatformDirectoryException:
20 # 日志/模型/历史全部失效(实测)。
21 'xdg-user-dirs'
22)
23optdepends=(
24 'espeak-ng: phonemizer used by the Kokoro/Piper TTS backends (loaded at runtime via dlopen)'
25 'mpv: audio playback through libmpv (media_kit backend of just_audio)'
26)
27provides=('crisperweaver')
28conflicts=('crisperweaver')
29makedepends=('imagemagick' 'patchelf' 'curl')
30source=(
31 "crisper_weaver-linux-x64-$pkgver.tar.gz::https://github.com/CrispStrobe/CrisperWeaver/releases/download/v$pkgver/crisper_weaver-linux-x64.tar.gz"
32 "LICENSE-$pkgver::https://raw.githubusercontent.com/CrispStrobe/CrisperWeaver/v$pkgver/LICENSE"
33 "com.crispstrobe.crisperweaver.desktop::https://raw.githubusercontent.com/CrispStrobe/CrisperWeaver/v$pkgver/linux/com.crispstrobe.crisperweaver.desktop"
34 "com.crispstrobe.crisperweaver.png::https://raw.githubusercontent.com/CrispStrobe/CrisperWeaver/v$pkgver/assets/images/app_logo.png"
35)
36sha256sums=('c3118186e44c65ec575cbd49a9d581b4e7cb8a92c6c5e14ca130191064326e23'
37 '372e65ffd4756f00b2092d7ce5716e3bae2c691009a76eeebb3557375a9702d1'
38 'b2db71f1de5582bcb49d62fe00e86d8e48babf078b6be511478a317e5c997568'
39 '75af78bfe0a7fabd37681984ca1706637e3db09260dea7ec1cc0f6361d4a0007')
40
41pkgver() {
42 local _tag
43
44 _tag=$(curl -fsS --connect-timeout 15 --max-time 60 \
45 "$_api/releases/latest" | grep -oP '"tag_name":\s*"\Kv?[^"]+')
46 if [[ -z "$_tag" ]]; then
47 printf 'pkgver(): 无法从 %s 获取最新 release tag\n' "$_api/releases/latest" >&2
48 return 1
49 fi
50
51 printf '%s' "${_tag#v}"
52}
53
54# The Flutter bundle is a self-contained tree (data/, lib/, icudtl.dat) that the
55# launcher resolves through its `$ORIGIN/lib` RUNPATH, so it is installed
56# verbatim under /usr/lib/crisperweaver and only the launcher is symlinked into
57# /usr/bin (glibc derives $ORIGIN from /proc/self/exe, so symlinks are fine).
58#
59# Known upstream-only packaging blemishes, deliberately not "fixed" here:
60# * no FULL RELRO in the prebuilt ELFs (would need a rebuild from source);
61# * libdartjni.so depends on libjvm.so — the JNI code path is Android-only and
62# unreachable in the Linux build, so no java-runtime dependency is declared.
63package() {
64 install -d "$pkgdir/usr/lib/crisperweaver"
65 cp -a crisper_weaver/. "$pkgdir/usr/lib/crisperweaver/"
66
67 # ── 修掉上游 CI 烧进 ELF 里的 RUNPATH ──────────────────────────────────
68 # 注意:这段既不是“检查库在不在”,也不是“补依赖”。依赖的去处只有两个:
69 # 包内不带 → 写进 depends(gtk3 / libkeybinder3 …);包里自带 → 用
70 # 这个 lib/ 目录里的那份。这段只是改一个烧在二进制里的搜索路径。
71 #
72 # 背景:这些 .so 是上游在 GitHub Actions 上编的,DT_RUNPATH 被写死成 CI
73 # 的临时目录(/home/runner/.../ephemeral)和 runner 上的 temurin JDK 路径,
74 # 在 Arch 上并不存在。
75 # * 功能上一般还能跑:它们要的 libflutter_linux_gtk.so 等已经由主程序
76 # 加载过,动态链接器会按 SONAME 命中内存里那份,不会去翻磁盘;
77 # * 但这是个错误配置(namcap 报 Insecure RUNPATH),还会泄露构建路径,
78 # 所以统一改成 $ORIGIN(= 这些库自己所在的 lib/ 目录)。
79 #
80 # 用“扫描”而不是写死文件名,是为了上游以后加/删插件 .so 时不用改这里。
81 # 只动“有 RUNPATH 且不等于 $ORIGIN”的文件:本来没有 RUNPATH 的
82 # (libapp.so / libglint.so)靠系统路径找库,不需要动;已经是 $ORIGIN 的
83 # (libwhisper.so / libflutter_linux_gtk.so)跳过,少改一次少一分风险。
84 local so rpath fixed=0
85 while IFS= read -r -d '' so; do
86 rpath=$(patchelf --print-rpath "$so")
87 [[ -n "$rpath" && "$rpath" != '$ORIGIN' ]] || continue
88 patchelf --set-rpath '$ORIGIN' "$so"
89 printf ' RUNPATH %s -> $ORIGIN: %s\n' "$rpath" "${so#"$pkgdir"}"
90 fixed=$(( fixed + 1 ))
91 done < <(find "$pkgdir/usr/lib/crisperweaver/lib" -type f -name '*.so*' -print0)
92 if (( fixed == 0 )); then
93 warning "没有找到需要修的 RUNPATH——上游可能自己修好了,这段可以删掉。"
94 fi
95
96 install -d "$pkgdir/usr/bin"
97
98 # ── 启动包装器:把 Flutter 的“文档目录”收进 ~/Documents/crisperweaver ──
99 # Flutter 的 path_provider 在 Linux 上靠执行 `xdg-user-dir DOCUMENTS` 得到
100 # “应用文档目录”,上游把它当沙箱根目录用,于是 logs/ models/ history/
101 # batch/ diagnostics/ 等好几个目录直接铺在用户的 ~/Documents 里。
102 # 这行为是 AOT 编译进 libapp.so 的,-bin 包改不了代码,所以只能拦那一次
103 # 外部命令调用:给应用一个 PATH 前置的 xdg-user-dir,只改 DOCUMENTS 的
104 # 回答(真文档目录 + /crisperweaver 一层,全部收进一个文件夹),其它查询
105 # (DOWNLOAD 等)原样转发给真正的 /usr/bin/xdg-user-dir。
106 # 注意:上游若哪天改用 getApplicationSupportDirectory,这个 shim 自动失效
107 # (不再被查询),不会坏事。
108 # 想换成别的位置:CRISPERWEAVER_DOCS_DIR=/path/to/dir crisperweaver
109 # 想恢复上游行为:CRISPERWEAVER_DOCS_DIR="$HOME/Documents" crisperweaver
110 install -d "$pkgdir/usr/lib/crisperweaver/bin"
111 cat >"$pkgdir/usr/lib/crisperweaver/bin/xdg-user-dir" <<'SHIM'
112#!/bin/sh
113if [ "$1" = DOCUMENTS ]; then
114 if [ -n "${CRISPERWEAVER_DOCS_DIR:-}" ]; then
115 printf '%s\n' "$CRISPERWEAVER_DOCS_DIR"
116 else
117 _base=$(/usr/bin/xdg-user-dir DOCUMENTS 2>/dev/null)
118 printf '%s\n' "${_base:-$HOME/Documents}/crisperweaver"
119 fi
120 exit 0
121fi
122exec /usr/bin/xdg-user-dir "$@"
123SHIM
124 chmod 0755 "$pkgdir/usr/lib/crisperweaver/bin/xdg-user-dir"
125
126 cat >"$pkgdir/usr/bin/crisperweaver" <<'WRAPPER'
127#!/bin/sh
128# CrisperWeaver 启动器(见 PKGBUILD 里的说明)。
129# CRISPERWEAVER_DOCS_DIR 可以指定数据存放目录,默认 <文档目录>/crisperweaver。
130shim=/usr/lib/crisperweaver/bin
131case ":$PATH:" in
132 *":$shim:"*) ;;
133 *) PATH="$shim:$PATH"; export PATH ;;
134esac
135exec /usr/lib/crisperweaver/crisper_weaver "$@"
136WRAPPER
137 chmod 0755 "$pkgdir/usr/bin/crisperweaver"
138 ln -s crisperweaver "$pkgdir/usr/bin/crisper_weaver"
139
140 install -Dm644 com.crispstrobe.crisperweaver.desktop \
141 "$pkgdir/usr/share/applications/com.crispstrobe.crisperweaver.desktop"
142
143 # Upstream only ships a 1024x1024 PNG, which is not one of hicolor's indexed
144 # sizes (see /usr/share/icons/hicolor/index.theme), so without resizing the
145 # icon would never be found by the XDG/GTK icon lookup.
146 local size
147 for size in 256 512; do
148 install -d "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps"
149 magick com.crispstrobe.crisperweaver.png -resize "${size}x${size}" -strip \
150 "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/com.crispstrobe.crisperweaver.png"
151 done
152
153 install -Dm644 "LICENSE-$pkgver" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
154}
155

Scan history

Scanned at (UTC)SeverityRules
2026-09-23 09:40:25 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion