summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052023-12-20 15:13:23 +0800
committerzxp198210052023-12-20 15:13:23 +0800
commit764b56e0883601d6ac180243a80ff67289fa21db (patch)
tree3965e55498486372d72df0843599a64e8db44c18
parentbcd05025bee063daa7748652fe7a491643ee1863 (diff)
downloadaur-764b56e0883601d6ac180243a80ff67289fa21db.tar.gz
fix errors
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD13
-rw-r--r--csbooks.sh22
3 files changed, 25 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e0b363c80b36..43cb887da123 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = csbooks-bin
pkgdesc = A smart book management and reading software,also a PDF reader, EPUB reader, MOBI reader and DJVU file reader.
pkgver = 7.5.0
- pkgrel = 5
+ pkgrel = 6
url = https://caesiumstudio.com/csbooks/
arch = x86_64
license = custom
@@ -12,6 +12,6 @@ pkgbase = csbooks-bin
source = csbooks-bin-7.5.0.pacman::https://github.com/caesiumstudio/csBooks-updates/releases/download/latest/csBooks-7.5.0.pacman
source = csbooks.sh
sha256sums = b1dfc2d6b137580b7bba60da5d97886369170f6b38b3154ad919847b9eca7afc
- sha256sums = 932fffc222021ab8075936a7131736d547dbda29aaecd687fe645665c1871905
+ sha256sums = 5ce46265f0335b03568aa06f7b4c57c5f8ffade7a226489ea39796be91a511bf
pkgname = csbooks-bin
diff --git a/PKGBUILD b/PKGBUILD
index 72c6a7049d91..73652e0caf50 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,8 @@
pkgname=csbooks-bin
_appname=csBooks
pkgver=7.5.0
-pkgrel=5
+_electronversion=21
+pkgrel=6
pkgdesc="A smart book management and reading software,also a PDF reader, EPUB reader, MOBI reader and DJVU file reader."
arch=('x86_64')
url="https://caesiumstudio.com/csbooks/"
@@ -11,7 +12,7 @@ license=('custom')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
- 'electron21'
+ "electron${_electronversion}"
'hicolor-icon-theme'
)
source=(
@@ -19,9 +20,13 @@ source=(
"${pkgname%-bin}.sh"
)
sha256sums=('b1dfc2d6b137580b7bba60da5d97886369170f6b38b3154ad919847b9eca7afc'
- '932fffc222021ab8075936a7131736d547dbda29aaecd687fe645665c1871905')
+ '5ce46265f0335b03568aa06f7b4c57c5f8ffade7a226489ea39796be91a511bf')
build() {
- sed "s|/opt/${_appname}/${pkgname%-bin} %U|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop"
+ sed -e "s|@electronversion@|${_electronversion}|g" \
+ -e "s|@appname@|${pkgname%-bin}|g" \
+ -e "s|@appasar@|app.asar|g" \
+ -i "${srcdir}/${pkgname%-bin}.sh"
+ sed "s|/opt/${_appname}/${pkgname%-bin}|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop"
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/opt/${pkgname%-bin}/${pkgname%-bin}"
diff --git a/csbooks.sh b/csbooks.sh
index b9953c67a1a1..c77c53567639 100644
--- a/csbooks.sh
+++ b/csbooks.sh
@@ -1,11 +1,17 @@
-#!/bin/bash
-_ELECTRON=/usr/bin/electron21
-APPDIR="/usr/lib/csbooks"
-export PATH="${APPDIR}:${PATH}"
-export LD_LIBRARY_PATH="${APPDIR}/swiftshader:${LD_LIBRARY_PATH}"
-_ASAR="${APPDIR}/app.asar"
+#!/bin/sh
+set -e
+_APPDIR="/usr/lib/@appname@"
+_ASAR="${_APPDIR}/@appasar@"
+export PATH="${_APPDIR}:${PATH}"
+export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
+export ELECTRON_IS_DEV=0
+export NODE_ENV=production
if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
- exec ${_ELECTRON} ${_ASAR} "$@"
+ cd "${_APPDIR}"
+ exec electron@electronversion@ "${_ASAR}" "$@"
+ exit
else
- exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@"
+ cd "${_APPDIR}"
+ exec electron@electronversion@ "${_ASAR}" --no-sandbox "$@"
+ exit
fi \ No newline at end of file