summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052023-12-14 10:16:33 +0800
committerzxp198210052023-12-14 10:16:33 +0800
commit55b70b4ebff84921db2dc91a3dc6197a199d5ee6 (patch)
tree760ec3d70c58a6ea4ac1fa88ca5d13275fc35c58
parentba60a5011b76be83690469a10b445984689678e4 (diff)
downloadaur-55b70b4ebff84921db2dc91a3dc6197a199d5ee6.tar.gz
fix errors
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD20
-rw-r--r--space-snake.sh17
3 files changed, 26 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b2bcd1659fc2..d9fe553c4c4a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,19 @@
pkgbase = space-snake-bin
pkgdesc = A Desktop game built with Electron and Vue.js.
pkgver = 0.11.1
- pkgrel = 4
+ pkgrel = 5
url = https://github.com/ilyagru/Space-Snake
arch = x86_64
license = MIT
makedepends = gendesk
- depends = bash
depends = electron4
provides = space-snake=0.11.1
conflicts = space-snake
source = space-snake-0.11.1.zip::https://github.com/ilyagru/Space-Snake/releases/download/0.11.1/Space-Snake-linux-x64-v0.11.1.zip
- source = space-snake.png::https://raw.githubusercontent.com/ilyagru/Space-Snake/0.11.1/app/icons/icon.png
- source = space-snake.sh
+ source = space-snake-0.11.1.png::https://raw.githubusercontent.com/ilyagru/Space-Snake/0.11.1/app/icons/icon.png
+ source = space-snake-0.11.1.sh
sha256sums = b4ed62ff9b5dc3cc815f0ac5328dc602ce29f6bb3231beab622c246c7c2554f9
sha256sums = 2cf69008e16f9f81098eaed1b59e481bafb258606cc9171047db9b6fdec6cb9f
- sha256sums = 884097a5e62f1fb7b904876fbe21295d04e5176aae04b5d433a644ffe219fdd8
+ sha256sums = 8915ca75d453698df81f7f3305cce6869f4261d754d90f0c3724b73c7b24ca84
pkgname = space-snake-bin
diff --git a/PKGBUILD b/PKGBUILD
index daeb09417876..c32c1eb78164 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,8 @@
pkgname=space-snake-bin
_pkgname=Space-Snake
pkgver=0.11.1
-pkgrel=4
+_electronversion=4
+pkgrel=5
pkgdesc="A Desktop game built with Electron and Vue.js."
arch=('x86_64')
url="https://github.com/ilyagru/Space-Snake"
@@ -10,27 +11,30 @@ license=('MIT')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
- 'bash'
- 'electron4'
+ "electron${_electronversion}"
)
makedepends=(
'gendesk'
)
source=(
"${pkgname%-bin}-${pkgver}.zip::${url}/releases/download/${pkgver}/${_pkgname}-linux-x64-v${pkgver}.zip"
- "${pkgname%-bin}.png::https://raw.githubusercontent.com/ilyagru/Space-Snake/${pkgver}/app/icons/icon.png"
- "${pkgname%-bin}.sh"
+ "${pkgname%-bin}-${pkgver}.png::https://raw.githubusercontent.com/ilyagru/Space-Snake/${pkgver}/app/icons/icon.png"
+ "${pkgname%-bin}-${pkgver}.sh"
)
sha256sums=('b4ed62ff9b5dc3cc815f0ac5328dc602ce29f6bb3231beab622c246c7c2554f9'
'2cf69008e16f9f81098eaed1b59e481bafb258606cc9171047db9b6fdec6cb9f'
- '884097a5e62f1fb7b904876fbe21295d04e5176aae04b5d433a644ffe219fdd8')
+ '8915ca75d453698df81f7f3305cce6869f4261d754d90f0c3724b73c7b24ca84')
build() {
+ sed -e "s|@electronversion@|${_electronversion}|" \
+ -e "s|@appname@|${pkgname%-bin}|g" \
+ -e "s|@appasar@|app.asar|g" \
+ -i "${srcdir}/${pkgname%-bin}.sh"
gendesk -q -f -n --categories "Game" --name "${_pkgname}" --exec "${pkgname%-bin}"
}
package() {
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/opt/${pkgname%-bin}/${pkgname%-bin}"
install -Dm644 "${srcdir}/${_pkgname}-linux-x64-v${pkgver}/resources/app.asar" -t "${pkgdir}/usr/lib/${pkgname%-bin}"
- install -Dm644 "${srcdir}/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
+ install -Dm644 "${srcdir}/${pkgname%-bin}-${pkgver}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-bin}.png"
install -Dm644 "${srcdir}/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
- install -Dm644 "${srcdir}/${_pkgname}-linux-x64-v${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -Dm644 "${srcdir}/${_pkgname}-linux-x64-v${pkgver}/LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
} \ No newline at end of file
diff --git a/space-snake.sh b/space-snake.sh
index 0512c9c8a80b..2ec4412e5c4f 100644
--- a/space-snake.sh
+++ b/space-snake.sh
@@ -1,11 +1,14 @@
#!/bin/bash
-_ELECTRON=/usr/bin/electron4
-APPDIR=/usr/lib/space-snake
-export PATH="${APPDIR}:${PATH}"
-#export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
-_ASAR="${APPDIR}/app.asar"
+set -e
+_APPDIR="/usr/lib/@appname@"
+export PATH="${_APPDIR}:${PATH}"
+export ELECTRON_IS_DEV=0
+export LD_LIBRARY_PATH="${_APPDIR}/swiftshader:${_APPDIR}/lib:${LD_LIBRARY_PATH}"
+_ASAR="${_APPDIR}/@appasar@"
if [[ $EUID -ne 0 ]] || [[ $ELECTRON_RUN_AS_NODE ]]; then
- exec ${_ELECTRON} ${_ASAR} "$@"
+ cd "${_APPDIR}"
+ exec electron@electronversion@ "${_ASAR}" "$@"
else
- exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@"
+ cd "${_APPDIR}"
+ exec electron@electronversion@ "${_ASAR}" --no-sandbox "$@"
fi \ No newline at end of file