update to 1.4.0
This commit is contained in:
1 parent
34cbc49cfd
commit
39309478a1
3 files changed
+99
-53
No files matched your search
@@ -1,9 +1,9 @@
|
||||
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
|
||||
pkgname=stoat-desktop-bin
|
||||
_pkgname=Stoat
|
||||
pkgver=1.3.0
|
||||
_electronversion=38
|
||||
pkgrel=2
|
||||
pkgver=1.4.0
|
||||
_electronversion=40
|
||||
pkgrel=1
|
||||
pkgdesc="Stoat for Desktop. (Prebuilt version. Use system-wide electron)"
|
||||
arch=(
|
||||
'aarch64'
|
||||
@@ -31,12 +31,31 @@ source=(
|
||||
source_aarch64=("${pkgname%-bin}-${pkgver}-aarch64.zip::${_ghurl}/releases/download/v${pkgver}/${_pkgname}-linux-arm64-${pkgver}.zip")
|
||||
source_x86_64=("${pkgname%-bin}-${pkgver}-x86_64.zip::${_ghurl}/releases/download/v${pkgver}/${_pkgname}-linux-x64-${pkgver}.zip")
|
||||
sha256sums=('SKIP'
|
||||
'31ad33b633744f5361abd964be306cea53ae1050e760c787115f7eca60045ae6')
|
||||
sha256sums_aarch64=('c1b3743cb6af56562b5d5e6a675e1e38549308fa8b18f3726e26e06922a7366b')
|
||||
sha256sums_x86_64=('9f875f007589d93bf594abc60c650803da1a18ad48a4b23766b5f9cb7efdfd34')
|
||||
_get_electron_version() {
|
||||
_elec_ver="$(strings "${srcdir}/${_pkgname}-"*/"${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"
|
||||
'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
|
||||
sha256sums_aarch64=('c992af7e7d0413eceb2d38322b48df2a9f9a116a18133e0d5dd15548ed992e83')
|
||||
sha256sums_x86_64=('89d88de0e852f62a6343b41aacdae8516ee83c6715e253557c9097e3894de4cb')
|
||||
_get_app_dir() {
|
||||
find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
|
||||
}
|
||||
_check_electron_version() {
|
||||
echo "Verifying Electron version..."
|
||||
local _app_dir=$(_get_app_dir)
|
||||
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 "
|
||||
@@ -44,9 +63,8 @@ prepare() {
|
||||
s/@appname@/${pkgname%-bin}/g
|
||||
s/@runname@/app.asar/g
|
||||
s/@cfgdirname@/${pkgname%-bin}/g
|
||||
s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto/g
|
||||
" "${srcdir}/${pkgname%-bin}.sh"
|
||||
_get_electron_version
|
||||
_check_electron_version
|
||||
gendesk -q -f -n \
|
||||
--pkgname="${pkgname%-bin}" \
|
||||
--pkgdesc="Stoat for Desktop." \
|
||||
@@ -57,14 +75,8 @@ prepare() {
|
||||
package() {
|
||||
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
|
||||
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-bin}"
|
||||
find "${srcdir}/${_pkgname}-"*"/resources" -maxdepth 1 -type f -exec install -Dm644 -t "${pkgdir}/usr/lib/${pkgname%-bin}" {} +
|
||||
if find "${srcdir}/${_pkgname}-"*"/resources" -mindepth 1 -maxdepth 1 -type d | read; then
|
||||
for _subdir in "${srcdir}/${_pkgname}-"*"/resources/"*; do
|
||||
if [ -d "${_subdir}" ]; then
|
||||
cp -Pr --no-preserve=ownership "${_subdir}" "${pkgdir}/usr/lib/${pkgname%-bin}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
local _app_dir=$(_get_app_dir)
|
||||
cp -a "${_app_dir}/resources/". "${pkgdir}/usr/lib/${pkgname%-bin}/"
|
||||
install -Dm644 "${srcdir}/${pkgname%-bin}-assets/desktop/[email protected]" "${pkgdir}/usr/share/pixmaps/${pkgname%-bin}.png"
|
||||
install -Dm644 "${srcdir}/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
|
||||
}
|
||||
Reference in new issue
Block a user