blob: 3040b2f75d61682ba1cace74e5f4aa2d744dfbd8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=r3playx-bin
_pkgname=R3PLAYX
pkgver=2.7.5
_electronversion=28
pkgrel=4
pkgdesc="A music player forked from YesPlayMusic。高颜值的第三方网易云播放器,支持 Windows / macOS / Linux"
arch=(
'aarch64'
'x86_64'
)
url="https://github.com/Sherlockouo/music"
license=('AGPL-3.0-only')
conflicts=(
"${pkgname%-bin}"
"${pkgname%x-bin}"
"yesplaymusic"
"my-yesplaymusic"
)
provides=("yesplaymusic")
depends=(
"electron${_electronversion}"
)
makedepends=(
'asar'
)
source=("${pkgname%-bin}.sh")
source_aarch64=("${pkgname%-bin}-${pkgver}-aarch64.deb::${url}/releases/download/${pkgver}/${_pkgname}-${pkgver}-linux-arm64.deb")
source_x86_64=("${pkgname%-bin}-${pkgver}-x86_64.deb::${url}/releases/download/${pkgver}/${_pkgname}-${pkgver}-linux-amd64.deb")
sha256sums=('2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051')
sha256sums_aarch64=('631444fcc800d112738d1abb8aacea2c94e0dfeaa39045055cd988fc144dbca2')
sha256sums_x86_64=('29412fd8023306a96bfa64c9766c580848b28578b70c266c75a55a7408d777c9')
build() {
sed -e "s|@electronversion@|${_electronversion}|" \
-e "s|@appname@|${pkgname%-bin}|g" \
-e "s|@runname@|app.asar|g" \
-e "s|@cfgdirname@|${_pkgname}|g" \
-e "s|@options@|env ELECTRON_OZONE_PLATFORM_HINT=auto|g" \
-i "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data."*
sed -e "s|/opt/${_pkgname}/desktop|${pkgname%-bin}|g" \
-e "s|Icon=desktop|Icon=${pkgname%-bin}|g" \
-e "s|Categories=Music;|Categories=AudioVideo;|g" \
-i "${srcdir}/usr/share/applications/desktop.desktop"
find "${srcdir}/opt/${_pkgname}/resources" -type d -exec chmod 755 {} \;
asar e "${srcdir}/opt/${_pkgname}/resources/app.asar" "${srcdir}/app.asar.unpacked"
sed "s|..\/resources\/bin\/better_sqlite3.node|/usr/lib/${pkgname%-bin}/bin/better_sqlite3.node|g" -i "${srcdir}/app.asar.unpacked/main/index.js"
asar p "${srcdir}/app.asar.unpacked" "${srcdir}/app.asar"
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
install -Dm644 "${srcdir}/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
install -Dm755 "${srcdir}/opt/${_pkgname}/resources/bin/better_sqlite3.node" -t "${pkgdir}/usr/lib/${pkgname%-bin}/bin"
cp -r "${srcdir}/opt/${_pkgname}/resources/app.asar.unpacked" "${pkgdir}/usr/lib/${pkgname%-bin}"
for _icons in 16x16 256x256 512x512;do
install -Dm644 "${srcdir}/usr/share/icons/hicolor/${_icons}/apps/desktop.png" \
"${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-bin}.png"
done
install -Dm644 "${srcdir}/usr/share/applications/desktop.desktop" "${pkgdir}/usr/share/applications/${pkgname%-bin}.desktop"
}
|