live2d-desktop-pet-git

LOW
maintainer zxp19821005 0 votes scanned 2026-11-01 00:21:48.120785
View on AUR
Why flagged

The npm install in prepare() is for the project's own dependencies from a trusted npm registry, not an external undeclared package, and is part of normal build process for Electron apps.

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-2507) reviewed the full PKGBUILD and judged it LOW (confidence 90%): The npm install in prepare() is for the project's own dependencies from a trusted npm registry, not an external undeclared package, and is part of normal build process for Electron apps.

1 higher static finding superseded - not the current verdict (shown for transparency)
Medium npm/yarn/pnpm install of an undeclared external package npm_install_external

Runs `npm/yarn/pnpm install <package>` for a package not in source=(), pulling unpinned, unreviewed code at build time. Severity downgraded: the package declares/looks like a Node.js consumer, where build-time installs are expected.

  • PKGBUILD:91 npm add -D electron-builder

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2pkgname=live2d-desktop-pet-git
3_pkgname='Live2D Desktop Pet'
4pkgver=1.0.r5.g2f77c07
5_electronversion=24
6_nodeversion=20
7pkgrel=1
8pkgdesc="Live2D Desktop Pet.(Use system-wide electron)"
9arch=('any')
10url="https://github.com/wasd09090030/live2Dpet_Miku"
11license=('MIT')
12conflicts=("${pkgname%-git}")
13provides=("${pkgname%-git}=${pkgver%.r*}")
14depends=(
15 "electron${_electronversion}-bin"
16)
17makedepends=(
18 'gendesk'
19 'npm'
20 'nvm'
21 'git'
22 'jq'
23 'imagemagick'
24)
25source=(
26 "${pkgname%-git}.git::git+${url}"
27 "${pkgname%-git}.sh"
28)
29sha256sums=('SKIP'
30 'dfcd6603d29c7b8d88e019b517a2e5c1a7b5ab905a0961a8b81adfa508b258b8')
31_get_project_dir() {
32 local d
33 while IFS= read -r d; do
34 find "$d" -name "package.json" ! -path "*/node_modules/*" 2>/dev/null | grep -q . && { echo "$d"; return; }
35 done < <(find "${srcdir}" -maxdepth 1 -mindepth 1 -type d ! -name '.*')
36}
37pkgver() {
38 cd "$(_get_project_dir)"
39 set -o pipefail
40 git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
41 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
42}
43_ensure_local_nvm() {
44 local NVM_DIR="${srcdir}/.nvm"
45 source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
46 nvm install "${_nodeversion}"
47 nvm use "${_nodeversion}"
48}
49_get_app_dir() {
50 find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -print 2>/dev/null | while read f; do [ -d "${f%/*}/resources" ] && echo "${f%/*}" && break; done
51}
52_get_electron_version() {
53 _elec_ver=$(find "$(_get_project_dir)" -name "package.json" ! -path "*/node_modules/*" -print \
54 | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null \
55 | grep -oE '[0-9]+' | head -1)
56 [[ -z "${_elec_ver}" ]] && return 1
57 (( _elec_ver == _electronversion )) && c=32 || c=31
58 echo -e "Electron version: \033[1;${c}m${_elec_ver}$([[ $c -eq 31 ]] && echo " (expected ${_electronversion})")\033[0m"
59}
60_set_build_env() {
61 export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
62 export ELECTRON_OVERRIDE_DIST_PATH="${ELECTRON_DIST}"
63 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
64 export ELECTRON_BUILDER_OFFLINE=true
65 export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/^v//')"
66 export HOME="${srcdir}/.home"
67 export XDG_CACHE_HOME="${HOME}/.cache"
68 export XDG_CONFIG_HOME="${HOME}/.config"
69 export XDG_DATA_HOME="${HOME}/.local/share"
70 export npm_config_cache="${HOME}/.npm_cache"
71 export COREPACK_NPM_REGISTRY="${COREPACK_NPM_REGISTRY:-${NPM_CONFIG_REGISTRY:-https://registry.npmjs.org}}"
72 export COREPACK_HOME="${HOME}/.corepack"
73 export npm_config_audit=false
74 export npm_config_registry="${NPM_CONFIG_REGISTRY:-${npm_config_registry:-https://registry.npmjs.org}}"
75 mkdir -p "${HOME}" "${npm_config_cache}" "${COREPACK_HOME}"
76}
77prepare() {
78 cd "$(_get_project_dir)"
79 _get_electron_version
80 sed -i -e "
81 s/@electronversion@/${_electronversion}/g
82 s/@appname@/${pkgname%-git}/g
83 " "${srcdir}/${pkgname%-git}.sh"
84 _ensure_local_nvm
85 _set_build_env
86 magick favicon.ico favicon.png
87 sed -i "s/favicon.ico/favicon.png/g" main.js
88 jq --arg ver "${SYSTEM_ELECTRON_VERSION}" '.devDependencies.electron = $ver' package.json > package.json.tmp && mv package.json.tmp package.json
89 export NODE_ENV=development
90 npm install
91 npm add -D electron-builder
92}
93build() {
94 cd "$(_get_project_dir)"
95 _ensure_local_nvm
96 _set_build_env
97 export NODE_ENV=production
98 npm exec -c "electron-builder --linux dir -c.electronDist=${ELECTRON_DIST}"
99}
100package() {
101 install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
102 install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
103 rm -rf "$(_get_app_dir)/resources/default_app.asar"
104 cp -a "$(_get_app_dir)/resources/." "${pkgdir}/usr/lib/${pkgname%-git}/"
105 install -Dm644 "$(_get_project_dir)/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
106 install -Dm644 "$(_get_project_dir)/favicon.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
107 install -Dm644 "$(_get_project_dir)/package.json" -t "${pkgdir}/usr/share/licenses/${pkgname}"
108}
109

Scan history

Scanned at (UTC)SeverityRules
2026-11-01 00:21:48 Low 2
2026-10-31 00:07:41 Low 2
2026-10-30 00:29:30 Low 2
2026-10-29 00:13:55 Low 2
2026-10-28 00:06:54 Low 2
2026-10-27 00:23:28 Low 2
2026-10-26 00:12:40 Low 2
2026-10-25 00:20:48 Low 2
2026-10-24 00:14:55 Low 2
2026-10-23 00:02:19 Low 2
2026-10-22 00:13:10 Low 2
2026-10-21 00:12:50 Low 2
2026-10-20 00:10:31 Low 2
2026-10-19 00:03:55 Low 2
2026-10-18 00:06:55 Low 2
2026-10-17 00:21:55 Low 2
2026-10-16 00:12:47 Low 2
2026-10-15 00:28:05 Low 2
2026-10-14 00:06:47 Low 2
2026-10-13 09:16:20 Medium 1

Report a package

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

0 / 4000
Your suggestion