update to 1.4.0
This commit is contained in:
1 parent
34cbc49cfd
commit
39309478a1
3 files changed
+98
-52
No files matched your search
@@ -1,24 +1,24 @@
|
||||
pkgbase = stoat-desktop-bin
|
||||
pkgdesc = Stoat for Desktop. (Prebuilt version. Use system-wide electron)
|
||||
pkgver = 1.3.0
|
||||
pkgrel = 2
|
||||
pkgver = 1.4.0
|
||||
pkgrel = 1
|
||||
url = https://stoat.chat/
|
||||
arch = aarch64
|
||||
arch = x86_64
|
||||
license = AGPL-3.0-only
|
||||
makedepends = gendesk
|
||||
makedepends = git
|
||||
depends = electron38
|
||||
provides = stoat-desktop=1.3.0
|
||||
depends = electron40
|
||||
provides = stoat-desktop=1.4.0
|
||||
conflicts = stoat-desktop
|
||||
options = !emptydirs
|
||||
source = stoat-desktop-assets::git+https://github.com/stoatchat/assets
|
||||
source = stoat-desktop.sh
|
||||
sha256sums = SKIP
|
||||
sha256sums = 31ad33b633744f5361abd964be306cea53ae1050e760c787115f7eca60045ae6
|
||||
source_aarch64 = stoat-desktop-1.3.0-aarch64.zip::https://github.com/stoatchat/for-desktop/releases/download/v1.3.0/Stoat-linux-arm64-1.3.0.zip
|
||||
sha256sums_aarch64 = c1b3743cb6af56562b5d5e6a675e1e38549308fa8b18f3726e26e06922a7366b
|
||||
source_x86_64 = stoat-desktop-1.3.0-x86_64.zip::https://github.com/stoatchat/for-desktop/releases/download/v1.3.0/Stoat-linux-x64-1.3.0.zip
|
||||
sha256sums_x86_64 = 9f875f007589d93bf594abc60c650803da1a18ad48a4b23766b5f9cb7efdfd34
|
||||
sha256sums = a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d
|
||||
source_aarch64 = stoat-desktop-1.4.0-aarch64.zip::https://github.com/stoatchat/for-desktop/releases/download/v1.4.0/Stoat-linux-arm64-1.4.0.zip
|
||||
sha256sums_aarch64 = c992af7e7d0413eceb2d38322b48df2a9f9a116a18133e0d5dd15548ed992e83
|
||||
source_x86_64 = stoat-desktop-1.4.0-x86_64.zip::https://github.com/stoatchat/for-desktop/releases/download/v1.4.0/Stoat-linux-x64-1.4.0.zip
|
||||
sha256sums_x86_64 = 89d88de0e852f62a6343b41aacdae8516ee83c6715e253557c9097e3894de4cb
|
||||
|
||||
pkgname = stoat-desktop-bin
|
||||
@@ -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"
|
||||
}
|
||||
+58
-24
@@ -2,38 +2,72 @@
|
||||
set -e
|
||||
_APPDIR="/usr/lib/@appname@"
|
||||
_RUNNAME="${_APPDIR}/@runname@"
|
||||
_OPTIONS="@options@"
|
||||
export PATH="${_APPDIR}:${PATH}"
|
||||
export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
|
||||
|
||||
# Base environment variables
|
||||
export ELECTRON_IS_DEV=0
|
||||
export ELECTRON_FORCE_IS_PACKAGED=true
|
||||
export ELECTRON_DISABLE_SECURITY_WARNINGS=true
|
||||
export NODE_ENV=production
|
||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
_FLAGS_FILE="${XDG_CONFIG_HOME}/@[email protected]"
|
||||
export LD_LIBRARY_PATH="${_APPDIR}/lib:${LD_LIBRARY_PATH}"
|
||||
|
||||
# 1. Display System Optimization (X11 & Wayland)
|
||||
# Use 'auto' to allow modern Electron (v20+) to detect the best platform
|
||||
# This helps with Wayland window decorations, fractional scaling, and GPU acceleration
|
||||
export ELECTRON_OZONE_PLATFORM_HINT="${ELECTRON_OZONE_PLATFORM_HINT:-auto}"
|
||||
|
||||
# 2. Desktop Environment (DE) Compatibility
|
||||
# Set CHROME_DESKTOP to match the .desktop file for correct taskbar icon grouping
|
||||
export CHROME_DESKTOP="@[email protected]"
|
||||
|
||||
# Fix for Electron's trash implementation on different DEs
|
||||
case "${XDG_CURRENT_DESKTOP}" in
|
||||
KDE)
|
||||
export ELECTRON_TRASH="kioclient5"
|
||||
;;
|
||||
GNOME)
|
||||
export ELECTRON_TRASH="gio"
|
||||
;;
|
||||
XFCE)
|
||||
export ELECTRON_TRASH="gvfs-trash"
|
||||
;;
|
||||
*)
|
||||
# Default fallback
|
||||
;;
|
||||
esac
|
||||
|
||||
# 3. Load user-defined flags
|
||||
# The script checks for flags in the following order (later files override/append to earlier ones):
|
||||
# 1. System-wide Electron flags: $XDG_CONFIG_HOME/electron-flags.conf
|
||||
# 2. Version-specific Electron flags: $XDG_CONFIG_HOME/electron@[email protected]
|
||||
# 3. App-specific global flags: $XDG_CONFIG_HOME/@[email protected]
|
||||
# 4. App-specific directory flags: $XDG_CONFIG_HOME/@cfgdirname@/@[email protected]
|
||||
_FLAG_SOURCES=(
|
||||
"${XDG_CONFIG_HOME}/electron-flags.conf"
|
||||
"${XDG_CONFIG_HOME}/electron@[email protected]"
|
||||
"${XDG_CONFIG_HOME}/@[email protected]"
|
||||
"${XDG_CONFIG_HOME}/@cfgdirname@/@[email protected]"
|
||||
)
|
||||
|
||||
declare -a flags
|
||||
for _FLAGS_FILE in "${_FLAG_SOURCES[@]}"; do
|
||||
if [[ -f "${_FLAGS_FILE}" ]]; then
|
||||
mapfile -t < "${_FLAGS_FILE}"
|
||||
fi
|
||||
for line in "${MAPFILE[@]}"; do
|
||||
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then
|
||||
flags+=("${line}")
|
||||
echo "Loading flags from ${_FLAGS_FILE}"
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
[[ "${line}" =~ ^[[:space:]]*#.* ]] || [[ -z "${line}" ]] || {
|
||||
read -ra line_flags <<< "$line"
|
||||
flags+=("${line_flags[@]}")
|
||||
}
|
||||
done < "${_FLAGS_FILE}"
|
||||
fi
|
||||
done
|
||||
_WAYLAND_OPTION=false
|
||||
for arg in "$@"; do
|
||||
if [[ "${arg}" == "--wayland" ]]; then
|
||||
_WAYLAND_OPTION=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ "${_WAYLAND_OPTION}" == true ]]; then
|
||||
echo "Forcing Wayland"
|
||||
flags+=("--enable-features=UseOzonePlatform,WaylandWindowDecorations,VaapiVideoDecodeLinuxGL" "--ozone-platform=wayland")
|
||||
|
||||
# 4. Sandbox and Execution Permissions
|
||||
# Disable sandbox if running as root without ELECTRON_RUN_AS_NODE
|
||||
_SANDBOX_ARG=()
|
||||
if [[ "${EUID}" -eq 0 ]] && [[ "${ELECTRON_RUN_AS_NODE}" != "1" ]]; then
|
||||
_SANDBOX_ARG=("--no-sandbox")
|
||||
fi
|
||||
|
||||
cd "${_APPDIR}"
|
||||
if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then
|
||||
exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "${flags[@]}" "$@" || exit $?
|
||||
else
|
||||
exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "${flags[@]}" "$@" || exit $?
|
||||
fi
|
||||
exec electron@electronversion@ "${flags[@]}" "${_SANDBOX_ARG[@]}" "${_RUNNAME}" "$@"
|
||||
Reference in new issue
Block a user