summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD12
-rw-r--r--dicionario.js.sh21
3 files changed, 30 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index aaacf2ffaeaf..dcd5d168bbeb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = dicionario.js-bin
pkgdesc = Simple dictionary in which you record your own words.
pkgver = 2.7.5
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/ArthurLobopro/dicionario.js
arch = x86_64
license = MIT
@@ -9,9 +9,11 @@ pkgbase = dicionario.js-bin
depends = nodejs
provides = dicionario.js=2.7.5
conflicts = dicionario.js
+ options = !strip
+ options = !emptydirs
source = dicionario.js-2.7.5.deb::https://github.com/ArthurLobopro/dicionario.js/releases/download/v2.7.5/dicionario.js_2.7.5_amd64.deb
source = dicionario.js.sh
sha256sums = 354d3d518cb64f07dbadb9989dfc43702f234c0fb2e330822b97fb36215b033a
- sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8
+ sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051
pkgname = dicionario.js-bin
diff --git a/PKGBUILD b/PKGBUILD
index 4950cd9acdcf..25381b38d914 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,9 @@
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
-pkgname=dicionario.js-bin
+_pkgname=dicionario
+pkgname="${_pkgname}.js-bin"
pkgver=2.7.5
_electronversion=28
-pkgrel=2
+pkgrel=3
pkgdesc="Simple dictionary in which you record your own words."
arch=('x86_64')
url="https://github.com/ArthurLobopro/dicionario.js"
@@ -13,16 +14,21 @@ depends=(
"electron${_electronversion}"
'nodejs'
)
+options=(
+ '!strip'
+ '!emptydirs'
+)
source=(
"${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/v${pkgver}/${pkgname%-bin}_${pkgver}_amd64.deb"
"${pkgname%-bin}.sh"
)
sha256sums=('354d3d518cb64f07dbadb9989dfc43702f234c0fb2e330822b97fb36215b033a'
- 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8')
+ '2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051')
build() {
sed -e "s|@electronversion@|${_electronversion}|g" \
-e "s|@appname@|${pkgname%-bin}|g" \
-e "s|@runname@|app|g" \
+ -e "s|@cfgdirname@|${_pkgname}|g" \
-e "s|@options@||g" \
-i "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data."*
diff --git a/dicionario.js.sh b/dicionario.js.sh
index 7ddcaab8d734..4cfe3ac09dd8 100644
--- a/dicionario.js.sh
+++ b/dicionario.js.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