blob: 4d73a95f183ff3356560caaca483a44cfd5a8174 (
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
68
69
70
71
|
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=liground-bin
pkgver=0.6.0
_electronversion=25
pkgrel=1
pkgdesc="A free, open-source and modern Chess Variant Analysis GUI for the 21st century.(Prebuilt version.Use system-wide electron)"
arch=('x86_64')
url="https://ml-research.github.io/liground.github.io/"
_ghurl="https://github.com/ml-research/liground"
license=('AGPL-3.0-only')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
"electron${_electronversion}"
)
makedepends=(
'asar'
)
options=(
'!strip'
'!emptydirs'
)
source=(
"${pkgname%-bin}-${pkgver}-x86_64.AppImage::${_ghurl}/releases/download/${pkgver}/${pkgname%-bin}-${pkgver}.AppImage"
"${pkgname%-bin}.sh"
)
sha256sums=('8db1586a7e2a601ca269666b11a77c81dfc087f4aa872f7aede0715f11db55d4'
'31ad33b633744f5361abd964be306cea53ae1050e760c787115f7eca60045ae6')
_get_electron_version() {
_elec_ver="$(strings "${srcdir}/squashfs-root/${pkgname%-bin}" | grep '^Chrome/[0-9.]* Electron/[0-9]' | cut -d'/' -f3 | cut -d'.' -f1)"
echo -e "The electron version is: \033[1;31m${_elec_ver}\033[0m"
}
prepare() {
sed -i -e "
s/@electronversion@/${_electronversion}/g
s/@appname@/${pkgname%-bin}/g
s/@runname@/app.asar/g
s/@cfgdirname@/${pkgname%-bin}/g
s/@options@//g
" "${srcdir}/${pkgname%-bin}.sh"
if [ ! -x "${srcdir}/${pkgname%-bin}-${pkgver}-${CARCH}.AppImage" ];then
chmod +x "${srcdir}/${pkgname%-bin}-${pkgver}-${CARCH}.AppImage"
fi
if [ -d "${srcdir}/squashfs-root" ];then
rm -rf "${srcdir}/squashfs-root"
fi
"${srcdir}/${pkgname%-bin}-${pkgver}-${CARCH}.AppImage" --appimage-extract > /dev/null
_get_electron_version
sed -i "s/AppRun/${pkgname%-bin}/g" "${srcdir}/squashfs-root/${pkgname%-bin}.desktop"
find "${srcdir}/squashfs-root" -type d -exec chmod 755 {} +
find "${srcdir}/squashfs-root/resources/engines" -type f -name "*.exe" -exec rm -rf {} +
asar e "${srcdir}/squashfs-root/resources/app.asar" "${srcdir}/app.asar.unpacked"
rm -rf "${srcdir}/squashfs-root/resources/app.asar"
find "${srcdir}/app.asar.unpacked/dist" -type f -exec sed -i "s/process.resourcesPath/\"\/usr\/lib\/${pkgname%-bin}\"/g" {} +
asar p "${srcdir}/app.asar.unpacked" "${srcdir}/squashfs-root/resources/app.asar"
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-bin}"
find "${srcdir}/squashfs-root/resources" -maxdepth 1 -type f -exec install -Dm644 -t "${pkgdir}/usr/lib/${pkgname%-bin}" {} +
if find "${srcdir}/squashfs-root/resources" -mindepth 1 -maxdepth 1 -type d | read; then
for _subdir in "${srcdir}/squashfs-root/resources/"*; do
if [ -d "${_subdir}" ]; then
cp -Pr --no-preserve=ownership "${_subdir}" "${pkgdir}/usr/lib/${pkgname%-bin}"
fi
done
fi
cp -Pr --no-preserve=ownership "${srcdir}/squashfs-root/static" "${pkgdir}/usr/lib/${pkgname%-bin}"
install -Dm644 "${srcdir}/squashfs-root/usr/share/icons/hicolor/256x256/apps/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
install -Dm644 "${srcdir}/squashfs-root/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
}
|