diff options
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | fishing-funds.sh | 21 |
3 files changed, 29 insertions, 12 deletions
@@ -1,18 +1,18 @@ pkgbase = fishing-funds-bin pkgdesc = 基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发. pkgver = 8.2.3 - pkgrel = 1 + pkgrel = 2 url = https://ff.1zilc.top/ arch = x86_64 license = GPL-3.0-only makedepends = fuse2 - depends = hicolor-icon-theme + makedepends = asar depends = electron29 provides = fishing-funds=8.2.3 conflicts = fishing-funds source = fishing-funds-8.2.3.AppImage::https://github.com/1zilc/fishing-funds/releases/download/v8.2.3/Fishing-Funds-8.2.3.AppImage source = fishing-funds.sh sha256sums = d88590ea5a79a248b754804a08170e5c5ebeb2771755c20a864caf667530fa56 - sha256sums = dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8 + sha256sums = 41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d pkgname = fishing-funds-bin @@ -3,7 +3,7 @@ pkgname=fishing-funds-bin _pkgname=Fishing-Funds pkgver=8.2.3 _electronversion=29 -pkgrel=1 +pkgrel=2 pkgdesc="基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发." arch=('x86_64') url="https://ff.1zilc.top/" @@ -12,32 +12,36 @@ license=('GPL-3.0-only') provides=("${pkgname%-bin}=${pkgver}") conflicts=("${pkgname%-bin}") depends=( - 'hicolor-icon-theme' "electron${_electronversion}" ) makedepends=( 'fuse2' + 'asar' ) source=( "${pkgname%-bin}-${pkgver}.AppImage::${_ghurl}/releases/download/v${pkgver}/${_pkgname}-${pkgver}.AppImage" "${pkgname%-bin}.sh" ) sha256sums=('d88590ea5a79a248b754804a08170e5c5ebeb2771755c20a864caf667530fa56' - 'dc0c5ca385ad81a08315a91655c7c064b5bf110eada55e61265633ae198b39f8') + '41b6d61dffef064762b3eec3dfeca7a3e1f57cbcb6dce9a6940c06797a0eae9d') build() { sed -e "s|@electronversion@|${_electronversion}|g" \ -e "s|@appname@|${pkgname%-bin}|g" \ -e "s|@runname@|app.asar|g" \ - -e "s|@options@||g" \ + -e "s|@cfgdirname@|${_pkgname//_/ }|g" \ + -e "s|@options@|env ELECTRON_OZONE_PLATFORM_HINT=auto|g" \ -i "${srcdir}/${pkgname%-bin}.sh" chmod a+x "${srcdir}/${pkgname%-bin}-${pkgver}.AppImage" "${srcdir}/${pkgname%-bin}-${pkgver}.AppImage" --appimage-extract > /dev/null sed "s|AppRun --no-sandbox|${pkgname%-bin}|g" -i "${srcdir}/squashfs-root/${pkgname%-bin}.desktop" find "${srcdir}/squashfs-root" -type d -exec chmod 755 {} \; + asar e "${srcdir}/squashfs-root/resources/app.asar" "${srcdir}/app.asar.unpacked" + sed "s|process.resourcesPath, \"assets\"|\"\/usr\/lib\/${pkgname%-bin}\", \"assets\"|g" -i "${srcdir}/app.asar.unpacked/dist/main/index.mjs" + asar p "${srcdir}/app.asar.unpacked" "${srcdir}/app.asar" } package() { install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}" - install -Dm644 "${srcdir}/squashfs-root/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}" + install -Dm644 "${srcdir}/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}" cp -r "${srcdir}/squashfs-root/resources/assets" "${pkgdir}/usr/lib/${pkgname%-bin}" install -Dm644 "${srcdir}/squashfs-root/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications" for _icons in 16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024;do diff --git a/fishing-funds.sh b/fishing-funds.sh index 7ddcaab8d734..398398461fee 100644 --- a/fishing-funds.sh +++ b/fishing-funds.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 |