blob: a21d9c799ad7856732d5353077e2c6d89e105fc7 (
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=animu-bin
_pkgname=Animu
pkgver=0.7.13
_electronversion=41
pkgrel=1
pkgdesc="An easy to use desktop application for watching anime.(Prebuilt version.Use system-wide electron)"
arch=('x86_64')
url="https://github.com/Owca525/animu"
license=('GPL-3.0-only')
conflicts=("${pkgname%-bin}")
provides=("${pkgname%-bin}=${pkgver}")
depends=(
"electron${_electronversion}"
)
source=(
"${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/v${pkgver}/${pkgname%-bin}-${pkgver}.deb"
"${pkgname%-bin}.sh"
)
sha256sums=('58f0e2cc3880b50fc4fb60b51d41d4e3f61533867ec499dc75f0953892f90d32'
'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
_check_electron_version() {
echo "Verifying Electron version..."
local _app_dir=$(find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1)
local _main_exe=""
if [[ -n "${_app_dir}" ]]; then
_main_exe=$(find "${_app_dir}" -maxdepth 1 -type f -executable -printf '%s %p\n' | sort -nr | head -n 1 | cut -d' ' -f2-)
fi
if [[ -n "${_main_exe}" ]]; then
local _elec_ver=$(strings "${_main_exe}" | grep '^Chrome/[0-9.]* Electron/[0-9]' | cut -d'/' -f3 | cut -d'.' -f1 | head -n 1)
if [[ -n "${_elec_ver}" ]]; then
if [[ "${_elec_ver}" != "${_electronversion}" ]]; then
echo -e "\033[1;31mWarning: Electron version mismatch! Detected: ${_elec_ver}, Expected: ${_electronversion}\033[0m"
else
echo -e "Electron version verified: \033[1;31m${_elec_ver}\033[0m"
fi
fi
else
echo -e "\033[1;33mNote: Could not find Electron binary for version verification.\033[0m"
fi
}
prepare() {
sed -i -e "
s/@electronversion@/${_electronversion}/g
s/@appname@/${pkgname%-bin}/g
s/@runname@/app.asar/g
s/@cfgdirname@/${_pkgname}/g
" "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data."*
_check_electron_version
sed -i "s/\/opt\/${pkgname%-bin}\///g" "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop"
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-bin}"
local _app_dir=$(find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1)
cp -a "${_app_dir}/resources/". "${pkgdir}/usr/lib/${pkgname%-bin}/"
install -Dm644 "${srcdir}/usr/share/icons/hicolor/512x512/apps/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
install -Dm644 "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
}
|