diff options
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | thinreports-section-editor.sh | 21 |
3 files changed, 29 insertions, 16 deletions
@@ -1,20 +1,19 @@ pkgbase = thinreports-section-editor-bin pkgdesc = A template editor for Thinreports to edit Section Format templates pkgver = 1.0.0_dev - pkgrel = 6 + pkgrel = 7 url = https://github.com/thinreports/thinreports arch = x86_64 license = MIT makedepends = fuse2 - depends = electron21-bin - depends = hicolor-icon-theme + depends = electron21 provides = thinreports-section-editor=1.0.0_dev conflicts = thinreports-section-editor - source = thinreports-section-editor-1.0.0_dev.AppImage::https://github.com/thinreports/thinreports-section-editor/releases/download/v1.0.0-dev/thinreports-section-editor-1.0.0-dev-linux-20221031-0b5119.AppImage + source = thinreports-section-editor-1.0.0_dev.AppImage::https://github.com/thinreports/thinreports-section-editor/releases/download/v1.0.0-dev/thinreports-section-editor-1.0.0-dev-linux-20240116-67b3e2.AppImage source = LICENSE-1.0.0_dev::https://raw.githubusercontent.com/thinreports/thinreports-section-editor/v1.0.0-dev/LICENSE source = thinreports-section-editor.sh - sha256sums = 818e3b1fdf4fb1ed1fdbe47cc58a034074a652577a887b168edfb033f47b6aeb + sha256sums = 01845dba1789b07a1280701ac15d40a592c34e54a1a45c7dcb711a3b4871a86c sha256sums = 2d416fa05a32860094f618f477a982dd77676b236dc710f2a4df289b7e43ae0c - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = thinreports-section-editor-bin @@ -1,8 +1,9 @@ # Maintainer: zxp19821005 <zxp19821005 at 163 dot com> pkgname=thinreports-section-editor-bin pkgver=1.0.0_dev +_subver=20240116-67b3e2 _electronversion=21 -pkgrel=6 +pkgrel=7 pkgdesc="A template editor for Thinreports to edit Section Format templates" arch=('x86_64') url="https://github.com/thinreports/thinreports" @@ -11,24 +12,24 @@ license=('MIT') provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" - 'hicolor-icon-theme' + "electron${_electronversion}" ) makedepends=( 'fuse2' ) source=( - "${pkgname%-bin}-${pkgver}.AppImage::${_ghurl}/releases/download/v${pkgver//_/-}/${pkgname%-bin}-${pkgver//_/-}-linux-20221031-0b5119.AppImage" + "${pkgname%-bin}-${pkgver}.AppImage::${_ghurl}/releases/download/v${pkgver//_/-}/${pkgname%-bin}-${pkgver//_/-}-linux-${_subver}.AppImage" "LICENSE-${pkgver}::https://raw.githubusercontent.com/thinreports/thinreports-section-editor/v${pkgver//_/-}/LICENSE" "${pkgname%-bin}.sh" ) -sha256sums=('818e3b1fdf4fb1ed1fdbe47cc58a034074a652577a887b168edfb033f47b6aeb' +sha256sums=('01845dba1789b07a1280701ac15d40a592c34e54a1a45c7dcb711a3b4871a86c' '2d416fa05a32860094f618f477a982dd77676b236dc710f2a4df289b7e43ae0c' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') + '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051') build() { sed -e "s|@electronversion@|${_electronversion}|" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app.asar|g" \ + -e "s|@cfgdirname@|${pkgname%-bin}|g" \ -e "s|@options@||g" \ -i "${srcdir}/${pkgname%-bin}.sh" chmod a+x "${srcdir}/${pkgname%-bin}-${pkgver}.AppImage" diff --git a/thinreports-section-editor.sh b/thinreports-section-editor.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/thinreports-section-editor.sh +++ b/thinreports-section-editor.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 |