blob: ab0968e2f330db8a66c88ef3ae4c2d33930d835b (
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
61
62
63
64
65
66
67
|
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=stremio-web-desktop-bin
_pkgname='Stremio Web Desktop'
pkgver=538
_subver=1.0.0
_electronversion=33
pkgrel=1
pkgdesc="Stremio Web as Electron Desktop App. Latest Stremio Web v5 and Server bundled as electron app.Not affiliated with Stremio in any way.(Prebuilt version.Use system-wide electron)"
arch=('x86_64')
url="https://github.com/Zaarrg/stremio-web-desktop"
license=(
'GPL-3.0-only'
'MIT'
)
conflicts=("${pkgname%-bin}")
provides=("${pkgname%-bin}=${pkgver}")
depends=(
"electron${_electronversion}"
'ffmpeg'
)
options=(
'!emptydirs'
)
source=(
"${pkgname%-bin}-${pkgver}.rpm::${url}/releases/download/v${pkgver}/${pkgname%-bin}-${_subver}-1.${CARCH}.rpm"
"${pkgname%-bin}.sh"
)
sha256sums=('2d7c756e0b880369f24c567cad91cb6798e2ce73c466575701706fa36e8464a6'
'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%-bin}/g
" "${srcdir}/${pkgname%-bin}.sh"
_check_electron_version
}
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/pixmaps/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
install -Dm644 "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
install -Dm644 "${srcdir}/usr/share/doc/${pkgname%-bin}/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|