yesplaymusic-axuanran-git

LOW
maintainer harryloong 0 votes scanned 2026-10-07 06:05:09.924014
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: xzl <xzl01@outlook.com>
2
3pkgname=yesplaymusic-axuanran-git
4_pkgname=xump
5_electronversion=42
6pkgver=0.1.1.alpha.14.r32.g1d0dadf
7pkgrel=1
8pkgdesc="XuMP - a third-party Netease Cloud Music player (git version)"
9arch=('x86_64')
10url="https://github.com/axuanran/YesPlayMusic"
11license=('MIT')
12provides=("${_pkgname}")
13conflicts=(
14 'yesplaymusic'
15 'yesplaymusic-bin'
16 'yesplaymusic-electron'
17 'yesplaymusic-git'
18 'yesplaymusic-axuanran-bin'
19)
20depends=(
21 "electron${_electronversion}"
22 'alsa-lib'
23 'gtk3'
24 'libxss'
25 'nss'
26)
27optdepends=(
28 'libnotify: desktop notifications'
29 'libayatana-appindicator: system tray support'
30 'xdg-utils: open URLs with default browser'
31 'nodejs: xumpctl / xump-mcp-http control CLI'
32)
33makedepends=(
34 'git'
35 'nodejs'
36 'npm'
37 'yarn'
38)
39options=('!strip' '!debug')
40source=("${pkgname}::git+${url}.git")
41sha256sums=('SKIP')
42
43pkgver() {
44 cd "${pkgname}"
45 set -o pipefail
46 git describe --long --tags --match 'v*' --abbrev=7 |
47 sed 's/^v//; s/\([^-]*-g\)/r\1/; s/-/./g' ||
48 printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
49}
50
51_set_build_env() {
52 export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
53 export ELECTRON_OVERRIDE_DIST_PATH="${ELECTRON_DIST}"
54 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
55 export HOME="${srcdir}/.home"
56 export XDG_CACHE_HOME="${srcdir}/.home/.cache"
57 export XDG_CONFIG_HOME="${srcdir}/.home/.config"
58 export npm_config_cache="${srcdir}/.home/.npm"
59 export YARN_CACHE_FOLDER="${srcdir}/.yarn-cache"
60 mkdir -p "${HOME}" "${XDG_CACHE_HOME}" "${XDG_CONFIG_HOME}" "${npm_config_cache}" "${YARN_CACHE_FOLDER}"
61}
62
63prepare() {
64 cd "${pkgname}"
65 cp .env.example .env
66
67 # the app is built against the system electron, so keep the pin honest
68 local _expected
69 _expected="$(node -p "require('./package.json').devDependencies.electron.replace(/[^0-9.]/g, '').split('.')[0]" 2>/dev/null || echo '?')"
70 if [[ "${_expected}" != "${_electronversion}" ]]; then
71 printf '\n==> upstream expects electron %s but this PKGBUILD pins electron%s\n' \
72 "${_expected}" "${_electronversion}" >&2
73 printf '==> bump _electronversion (and the depends entry) in the PKGBUILD\n\n' >&2
74 fi
75}
76
77build() {
78 cd "${pkgname}"
79 _set_build_env
80
81 # yarn skips devDependencies when NODE_ENV=production
82 export NODE_ENV=development
83 yarn install --frozen-lockfile --ignore-scripts --ignore-engines --non-interactive
84
85 export NODE_ENV=production
86 set -a
87 . ./.env
88 set +a
89
90 yarn electron-vite build
91 yarn tui:build
92
93 # package against the system electron instead of the bundled one
94 ./node_modules/.bin/electron-builder --linux dir \
95 -c.electronDist="${ELECTRON_DIST}" \
96 --publish never
97}
98
99package() {
100 cd "${pkgname}"
101
102 local _libdir="${pkgdir}/usr/lib/${pkgname}"
103 local _unpacked
104 _unpacked="$(find dist_electron/linux-unpacked -maxdepth 1 -type f -name resources.pak -printf '%h')"
105
106 install -dm755 "${_libdir}"
107 cp -a "${_unpacked}/resources/app.asar" "${_libdir}/"
108 if [[ -d "${_unpacked}/resources/app.asar.unpacked" ]]; then
109 cp -a "${_unpacked}/resources/app.asar.unpacked" "${_libdir}/"
110 fi
111
112 install -dm755 "${pkgdir}/usr/bin"
113 cat >"${pkgdir}/usr/bin/${_pkgname}" <<EOF
114#!/bin/sh
115export CHROME_DESKTOP="${_pkgname}.desktop"
116# the app is started from a directory, so make it believe it is packaged
117export ELECTRON_FORCE_IS_PACKAGED=true
118export ELECTRON_IS_DEV=0
119export ELECTRON_OZONE_PLATFORM_HINT="\${ELECTRON_OZONE_PLATFORM_HINT:-auto}"
120exec /usr/lib/electron${_electronversion}/electron /usr/lib/${pkgname}/app.asar "\$@"
121EOF
122 chmod 755 "${pkgdir}/usr/bin/${_pkgname}"
123
124 install -dm755 "${pkgdir}/usr/share/applications"
125 cat >"${pkgdir}/usr/share/applications/${_pkgname}.desktop" <<EOF
126[Desktop Entry]
127Type=Application
128Name=XuMP
129Name[zh_CN]=XuMP 网易云音乐
130GenericName=Music Player
131GenericName[zh_CN]=音乐播放器
132Comment=Third-party Netease Cloud Music client
133Comment[zh_CN]=高颜值的第三方网易云播放器
134Exec=${_pkgname} %U
135Icon=${_pkgname}
136Terminal=false
137Categories=AudioVideo;Audio;Player;
138Keywords=music;netease;player;
139StartupWMClass=${_pkgname}
140EOF
141
142 # node-only control CLI: it talks to the running app over
143 # $XDG_RUNTIME_DIR/xump-control.sock (see docs/control-api.md), so it needs
144 # nodejs (optdepend) but not the app itself to be installed from here
145 install -Dm755 scripts/xumpctl.mjs "${pkgdir}/usr/lib/${pkgname}/cli/xumpctl.mjs"
146 install -Dm644 scripts/xump-mcp-http.mjs \
147 "${pkgdir}/usr/lib/${pkgname}/cli/xump-mcp-http.mjs"
148 cat >"${pkgdir}/usr/bin/xumpctl" <<EOF
149#!/bin/sh
150exec node /usr/lib/${pkgname}/cli/xumpctl.mjs "\$@"
151EOF
152 chmod 755 "${pkgdir}/usr/bin/xumpctl"
153 cat >"${pkgdir}/usr/bin/xump-mcp-http" <<EOF
154#!/bin/sh
155exec node /usr/lib/${pkgname}/cli/xump-mcp-http.mjs "\$@"
156EOF
157 chmod 755 "${pkgdir}/usr/bin/xump-mcp-http"
158
159 local _size
160 for _size in 16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024; do
161 install -Dm644 "build/icons/${_size}.png" \
162 "${pkgdir}/usr/share/icons/hicolor/${_size}/apps/${_pkgname}.png"
163 done
164
165 install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
166}
167

Scan history

Scanned at (UTC)SeverityRules
2026-10-07 06:05:09 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