diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | cubytext.sh | 24 |
3 files changed, 34 insertions, 12 deletions
@@ -1,20 +1,22 @@ pkgbase = cubytext-bin pkgdesc = An open-source knowledge management app. pkgver = 0.0.4 - pkgrel = 3 + pkgrel = 4 url = https://github.com/vincentdchan/CubyText arch = x86_64 license = MIT - depends = electron19-bin + depends = electron19 depends = nodejs provides = cubytext=0.0.4 conflicts = cubytext options = !strip + options = !emptydirs + options = !staticlibs source = cubytext-0.0.4.deb::https://github.com/vincentdchan/CubyText/releases/download/0.0.4/cubytext_0.0.4_amd64.deb source = LICENSE-0.0.4::https://raw.githubusercontent.com/vincentdchan/CubyText/0.0.4/LICENSE.txt source = cubytext.sh sha256sums = bd0ff4fdbbeaa30ab532d7efb00b7dc9962eaa87826fa7ee80727cf518a36566 sha256sums = db7050c50a29912ab18366ac4d340da6359df6e8ad1c31bc019af5b707a69aee - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 2b2e8aeed33fd71c521e49fd54fb2fa81218d16aef8bccb88d77909055ab8051 pkgname = cubytext-bin @@ -1,8 +1,9 @@ # Maintainer: zxp19821005 <zxp19821005 at 163 dot com> pkgname=cubytext-bin +_pkgname=CubyText pkgver=0.0.4 _electronversion=19 -pkgrel=3 +pkgrel=4 pkgdesc="An open-source knowledge management app." arch=('x86_64') url="https://github.com/vincentdchan/CubyText" @@ -10,10 +11,14 @@ license=('MIT') provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - "electron${_electronversion}-bin" + "electron${_electronversion}" 'nodejs' ) -options=('!strip') +options=( + '!strip' + '!emptydirs' + '!staticlibs' +) source=( "${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/${pkgver}/${pkgname%-bin}_${pkgver}_amd64.deb" "LICENSE-${pkgver}::https://raw.githubusercontent.com/vincentdchan/CubyText/${pkgver}/LICENSE.txt" @@ -21,11 +26,12 @@ source=( ) sha256sums=('bd0ff4fdbbeaa30ab532d7efb00b7dc9962eaa87826fa7ee80727cf518a36566' 'db7050c50a29912ab18366ac4d340da6359df6e8ad1c31bc019af5b707a69aee' - '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/cubytext.sh b/cubytext.sh index e6784b369c25..4cfe3ac09dd8 100644 --- a/cubytext.sh +++ b/cubytext.sh @@ -1,15 +1,29 @@ -#!/bin/sh -set -e +#!/bin/bash +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}" "$@" || exit $? +if [[ "${EUID}" -ne 0 ]] || [[ "${ELECTRON_RUN_AS_NODE}" ]]; then + exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} "${_USER_FLAGS[@]}" "$@" else - exec electron@electronversion@ "${_RUNNAME}" --no-sandbox "$@" || exit $? + exec electron@electronversion@ "${_RUNNAME}" ${_OPTIONS} --no-sandbox "${_USER_FLAGS[@]}" "$@" fi
\ No newline at end of file |