diff options
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | fontastic.sh | 21 |
3 files changed, 24 insertions, 10 deletions
@@ -1,16 +1,16 @@ pkgbase = fontastic-bin pkgdesc = A stunning font management and cataloging application. pkgver = 0.2.0 - pkgrel = 3 + pkgrel = 4 url = https://github.com/tomshaw/fontastic arch = x86_64 license = MIT - depends = electron25-bin + depends = electron25 source = fontastic-0.2.0.deb::https://github.com/tomshaw/fontastic/releases/download/v0.2.0/Fontastic-0.2.0-amd64.deb source = LICENSE-0.2.0::https://raw.githubusercontent.com/tomshaw/fontastic/v0.2.0/LICENSE source = fontastic.sh sha256sums = 3b34a974d7da78f9621b02e11a35c00d9f81a19ec42ed1dddfc4f4d59d67d962 sha256sums = d461d5796257402081b89cae64365068a66d193696f7c64cb7e6fd307b4a48d9 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = fontastic-bin @@ -3,14 +3,14 @@ pkgname=fontastic-bin _pkgname=Fontastic pkgver=0.2.0 _electronversion=25 -pkgrel=3 +pkgrel=4 pkgdesc="A stunning font management and cataloging application." arch=('x86_64') url="https://github.com/tomshaw/fontastic" license=('MIT') conflits=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" + "electron${_electronversion}" ) source=( "${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/v${pkgver}/${_pkgname}-${pkgver}-amd64.deb" @@ -19,11 +19,12 @@ source=( ) sha256sums=('3b34a974d7da78f9621b02e11a35c00d9f81a19ec42ed1dddfc4f4d59d67d962' 'd461d5796257402081b89cae64365068a66d193696f7c64cb7e6fd307b4a48d9' - '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" bsdtar -xf "${srcdir}/data."* diff --git a/fontastic.sh b/fontastic.sh index 7ddcaab8d734..4cfe3ac09dd8 100644 --- a/fontastic.sh +++ b/fontastic.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 |