diff options
author | zxp19821005 | 2024-05-14 18:22:53 +0800 |
---|---|---|
committer | zxp19821005 | 2024-05-14 18:22:53 +0800 |
commit | f4e452999767734388ae8d7b6c432a4e49282c2a (patch) | |
tree | 431c487044fde713b2b47cfa9eced9c4898322d4 | |
parent | 164ae4350131009bd4baae9f34679be22c1890e8 (diff) | |
download | aur-maduchat-frontend-bin.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | maduchat-frontend.sh | 21 |
3 files changed, 25 insertions, 13 deletions
@@ -1,19 +1,18 @@ pkgbase = maduchat-frontend-bin pkgdesc = A chat application which has a global chat, friend system, settings and lots of other features pkgver = 1.2.1 - pkgrel = 4 + pkgrel = 5 url = https://github.com/Madu-de/MaduChat arch = aarch64 arch = armv7h arch = x86_64 license = AGPL-3.0-only makedepends = gendesk - depends = electron26-bin - depends = nodejs + depends = electron26 provides = maduchat-frontend=1.2.1 conflicts = maduchat-frontend source = maduchat-frontend.sh - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d source_aarch64 = maduchat-frontend-1.2.1-aarch64.zip::https://github.com/Madu-de/MaduChat/releases/download/v1.2.1/maduchat-frontend-1.2.1-linux-arm64.zip sha256sums_aarch64 = 2325d628fc42a78a9ecd475b116c69a0c17b4d970ebe69dad83bc03c74797ffc source_armv7h = maduchat-frontend-1.2.1-armv7h.zip::https://github.com/Madu-de/MaduChat/releases/download/v1.2.1/maduchat-frontend-1.2.1-linux-armv7l.zip @@ -3,7 +3,7 @@ pkgname=maduchat-frontend-bin _pkgname=MaduChat pkgver=1.2.1 _electronversion=26 -pkgrel=4 +pkgrel=5 pkgdesc="A chat application which has a global chat, friend system, settings and lots of other features" url="https://github.com/Madu-de/MaduChat" arch=( @@ -15,8 +15,7 @@ license=('AGPL-3.0-only') provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" - 'nodejs' + "electron${_electronversion}" ) makedepends=( 'gendesk' @@ -25,7 +24,7 @@ source_aarch64=("${pkgname%-bin}-${pkgver}-aarch64.zip::${url}/releases/download source_armv7h=("${pkgname%-bin}-${pkgver}-armv7h.zip::${url}/releases/download/v${pkgver}/${pkgname%-bin}-${pkgver}-linux-armv7l.zip") source_x86_64=("${pkgname%-bin}-${pkgver}-x86_64.zip::${url}/releases/download/v${pkgver}/${pkgname%-bin}-${pkgver}-linux-x64.zip") source=("${pkgname%-bin}.sh") -sha256sums=('dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') +sha256sums=('41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d') sha256sums_aarch64=('2325d628fc42a78a9ecd475b116c69a0c17b4d970ebe69dad83bc03c74797ffc') sha256sums_armv7h=('9820879bc6f104683b8a447f3b799260a7740144de219040cc4406c33b9793f5') sha256sums_x86_64=('aa15825954e758f3e41e3cd2bc806cb7bf550c9c3f35eaff69820f6356ee163b') @@ -33,9 +32,10 @@ build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app|g" \ + -e "s|@cfgdirname@|maduchat-electron-frontend|g" \ -e "s|@options@||g" \ -i "${srcdir}/${pkgname%-bin}.sh" - gendesk -q -f -n --categories="Network" --name="${_pkgname}" --exec="${pkgname} %U" + gendesk -q -f -n --pkgname="${pkgname%-bin}" --categories="Network" --name="${_pkgname}" --exec="${pkgname} %U" } package() { install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}" diff --git a/maduchat-frontend.sh b/maduchat-frontend.sh index 7ddcaab8d734..398398461fee 100644 --- a/maduchat-frontend.sh +++ b/maduchat-frontend.sh @@ -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
\ No newline at end of file |