fix errors

This commit is contained in:
zxp19821005 2024-07-12 13:30:40 +08:00
parent 97de2a3569
commit 8ba165cb89
3 changed files with 24 additions and 10 deletions

View file

@ -1,16 +1,16 @@
pkgbase = hugin-messenger-bin
pkgdesc = The new version of the private messaging desktop application powered by the Kryptokrona Blockchain.
pkgver = 0.5.0
pkgrel = 1
pkgrel = 2
url = https://hugin.chat/
arch = x86_64
license = GPL-3.0-only
depends = electron19-bin
depends = electron19
provides = hugin-messenger=0.5.0
conflicts = hugin-messenger
source = hugin-messenger-0.5.0.deb::https://github.com/kryptokrona/hugin-desktop/releases/download/v0.5.0/hugin-messenger_0.5.0_amd64.deb
source = hugin-messenger.sh
sha256sums = 5a1fb9270c2c8726b44b22e9c565f81fbe3f937adc739c3133d8e5a5dbb51990
sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8
sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051
pkgname = hugin-messenger-bin

View file

@ -3,7 +3,7 @@ pkgname=hugin-messenger-bin
_pkgname="Hugin Messenger"
pkgver=0.5.0
_electronversion=19
pkgrel=1
pkgrel=2
pkgdesc="The new version of the private messaging desktop application powered by the Kryptokrona Blockchain."
arch=('x86_64')
url="https://hugin.chat/"
@ -12,18 +12,19 @@ license=('GPL-3.0-only')
conflicts=("${pkgname%-bin}")
provides=("${pkgname%-bin}=${pkgver}")
depends=(
"electron${_electronversion}-bin"
"electron${_electronversion}"
)
source=(
"${pkgname%-bin}-${pkgver}.deb::${_ghurl}/releases/download/v${pkgver}/${pkgname%-bin}_${pkgver}_amd64.deb"
"${pkgname%-bin}.sh"
)
sha256sums=('5a1fb9270c2c8726b44b22e9c565f81fbe3f937adc739c3133d8e5a5dbb51990'
'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
'2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051')
build() {
sed -e "s|@electronversion@|${_electronversion}|g" \
-e "s|@appname@|${pkgname%-bin}|g" \
-e "s|@runname@|app.asar|g" \
-e "s|@cfgdirname@|${_pkgname}|g" \
-e "s|@options@||g" \
-i "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data."*

View file

@ -1,16 +1,29 @@
#!/bin/bash
set -e
set -o pipefail
_APPDIR="/usr/lib/@appname@"
_RUNNAME="${_APPDIR}/@runname@"
_CFGDIR="@cfgdirname@/"
_OPTIONS="@options@"
export PATH="${_APPDIR}:${PATH}"
export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
export ELECTRON_IS_DEV=0
export ELECTRON_FORCE_IS_PACKAGED=true
export ELECTRON_DISABLE_SECURITY_WARNINGS=true
export ELECTRON_OVERRIDE_DIST_PATH="/usr/bin/electron@electronversion@"
export NODE_ENV=production
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export _FLAGS_FILE="${XDG_CONFIG_HOME}/${_CFGDIR}@appname@-flags.conf"
declare -a _USER_FLAGS
if [[ -f "${_FLAGS_FILE}" ]]; then
while read -r line; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
_USER_FLAGS+=("${line}")
fi
done < "${_FLAGS_FILE}"
fi
cd "${_APPDIR}"
if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" "$@" || exit $?
if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then
exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@"
else
exec electron@electronversion@ "${_RUNNAME}" "${_OPTIONS}" --no-sandbox "$@" || exit $?
exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@"
fi