diff options
author | zxp19821005 | 2024-06-27 16:15:57 +0800 |
---|---|---|
committer | zxp19821005 | 2024-06-27 16:15:57 +0800 |
commit | 94fdb898696501a470bfc1467325516f695b6831 (patch) | |
tree | e5b4a08994f5ba97c1869aec484c873638a7e795 | |
parent | 04e261d3230a09f884401352b457ea27a11ce4f8 (diff) | |
download | aur-huelectron-bin.tar.gz |
fix errors
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | huelectron.sh | 21 |
3 files changed, 25 insertions, 11 deletions
@@ -1,12 +1,12 @@ pkgbase = huelectron-bin pkgdesc = An open-source and cross-platform app for the Hue lighting system from Philips - built on Electron. pkgver = 0.6.1 - pkgrel = 8 + pkgrel = 9 url = https://github.com/4ch1m/huElectron arch = x86_64 license = MIT makedepends = gendesk - depends = electron24-bin + depends = electron24 provides = huelectron=0.6.1 conflicts = huelectron source = huelectron-0.6.1.zip::https://github.com/4ch1m/huElectron/releases/download/0.6.1/huElectron-linux-x64-0.6.1.zip @@ -14,6 +14,6 @@ pkgbase = huelectron-bin source = huelectron.sh sha256sums = 8d3ea2043a7fee5a83a6ff34b97b93acc7cb98318e2ff08d827bb2a8ca5bd94f sha256sums = 1f3f81918f9254f49488f0a113f55bd1da262b9300026d927b21cd10e895bcc6 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = huelectron-bin @@ -3,7 +3,7 @@ pkgname=huelectron-bin _pkgname=huElectron pkgver=0.6.1 _electronversion=24 -pkgrel=8 +pkgrel=9 pkgdesc="An open-source and cross-platform app for the Hue lighting system from Philips - built on Electron." arch=(x86_64) url="https://github.com/4ch1m/huElectron" @@ -11,7 +11,7 @@ license=('MIT') provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" + "electron${_electronversion}" ) makedepends=( 'gendesk' @@ -23,14 +23,15 @@ source=( ) sha256sums=('8d3ea2043a7fee5a83a6ff34b97b93acc7cb98318e2ff08d827bb2a8ca5bd94f' '1f3f81918f9254f49488f0a113f55bd1da262b9300026d927b21cd10e895bcc6' - '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" - gendesk -q -f -n --categories="Development;Utility" --name="${_pkgname}" --exec="${pkgname} %U" + gendesk -q -f -n --pkgname="${pkgname}" --pkgdesc="${pkgdesc}" --categories="Utility" --name="${_pkgname}" --exec="${pkgname} %U" } package() { install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}" diff --git a/huelectron.sh b/huelectron.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/huelectron.sh +++ b/huelectron.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 |