calt-git
maintainer zxp19821005
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The npx command is used to run a local build script (ts-node clean.js) from the project's own source, not to execute an arbitrary remote package, so the risk is low despite the static analyzer flag.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 90%): The npx command is used to run a local build script (ts-node clean.js) from the project's own source, not to execute an arbitrary remote package, so the risk is low despite the static analyzer flag.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
npx/bunx/deno executes a remote package
remote_code_tool
`npx`/`bunx`/`pnpm dlx`/`deno run <url>` downloads AND runs a remote package at build time — the moral equivalent of piping a download into a shell. Severity downgraded: Node.js consumer context.
-
PKGBUILD:98
NODE_ENV=production npx ts-node ./.erb/scripts/clean.js dist
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2
pkgname=calt-git
3
_pkgname=CALT
4
pkgver=0.1.2.r2.g9364a1d
5
_electronversion=31
6
_nodeversion=20
7
pkgrel=1
8
pkgdesc="Context-aware LLM Translator (CALT).(Use system-wide electron)"
9
arch=('any')
10
url="https://github.com/CyrusCKF/translator"
11
license=('MIT')
12
provides=("${pkgname%-git}=${pkgver%.r*}")
13
conflicts=("${pkgname%-git}")
14
depends=(
15
"electron${_electronversion}"
16
'ollama'
17
)
18
makedepends=(
19
'npm'
20
'nvm'
21
'git'
22
'curl'
23
'gendesk'
24
'jq'
25
)
26
source=(
27
"${pkgname//-/.}::git+${url}.git"
28
"${pkgname%-git}.sh"
29
)
30
sha256sums=('SKIP'
31
'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
32
pkgver() {
33
cd "${srcdir}/${pkgname//-/.}"
34
set -o pipefail
35
git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
36
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
37
}
38
_get_app_dir() {
39
find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
40
}
41
_get_electron_version() {
42
_elec_ver=$(find "${srcdir}" -maxdepth 5 -name "package.json" ! -path "*/node_modules/*" \
43
-exec grep -l '"electron"' {} + | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null | head -1)
44
[[ -z "${_elec_ver}" ]] && return 1
45
echo -e "The electron version is: \033[1;31m${_elec_ver%%.*}\033[0m"
46
}
47
_set_build_env() {
48
export electronDist="/usr/lib/electron${_electronversion}"
49
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
50
export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
51
export HOME="${srcdir}/.electron-gyp"
52
export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
53
export NPM_CONFIG_MAXSOCKETS=32
54
if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
55
{
56
export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
57
export NPM_CONFIG_ELECTRON_MIRROR="https://registry.npmmirror.com/-/binary/electron/"
58
export NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"
59
export NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"
60
export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
61
export ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
62
}
63
find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
64
fi
65
}
66
_ensure_local_nvm() {
67
local NVM_DIR="${srcdir}/.nvm"
68
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
69
nvm install "${_nodeversion}"
70
nvm use "${_nodeversion}"
71
}
72
prepare() {
73
cd "${srcdir}/${pkgname//-/.}"
74
_get_electron_version
75
sed -i -e "
76
s/@electronversion@/${_electronversion}/g
77
s/@appname@/${pkgname%-git}/g
78
s/@runname@/app.asar/g
79
s/@cfgdirname@/${pkgname%-git}/g
80
" "${srcdir}/${pkgname%-git}.sh"
81
gendesk -q -f -n \
82
--pkgname="${pkgname%-git}" \
83
--pkgdesc="${pkgdesc}" \
84
--categories="Office" \
85
--name="${_pkgname}" \
86
--exec="${pkgname%-git} %U"
87
_set_build_env
88
_ensure_local_nvm
89
find src -type f -exec sed -i "s/process.resourcesPath/\'\/usr\/lib\/${pkgname%-git}\'/g" {} +
90
sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
91
NODE_ENV=development npm install
92
NODE_ENV=development npm update browserslist caniuse-api
93
}
94
build() {
95
cd "${srcdir}/${pkgname//-/.}"
96
_set_build_env
97
_ensure_local_nvm
98
NODE_ENV=production npx ts-node ./.erb/scripts/clean.js dist
99
NODE_ENV=production npm run build
100
NODE_ENV=production npm exec -c "electron-builder build --linux dir -c.electronDist=${electronDist}"
101
}
102
package() {
103
install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
104
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
105
local _app_dir=$(_get_app_dir)
106
cp -a "${_app_dir}/resources/". "${pkgdir}/usr/lib/${pkgname%-git}/"
107
_icon_sizes=(16x16 24x24 32x32 48x48 64x64 96x96 128x128 256x256 512x512 1024x1024)
108
for _icons in "${_icon_sizes[@]}";do
109
install -Dm644 "${srcdir}/${pkgname//-/.}/assets/icons/${_icons}.png" \
110
-t "${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-git}.png"
111
done
112
install -Dm644 "${srcdir}/${pkgname//-/.}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
113
install -Dm644 "${srcdir}/${pkgname//-/.}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
114
}
115
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |