summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzxp198210052023-12-19 10:47:08 +0800
committerzxp198210052023-12-19 10:47:08 +0800
commitc5d04b2762cb5ab357f13d36a9acd56f9cb44b87 (patch)
treee27893d135aa946db9269a69d9b8707bbac23aaa
parent494dddee754ebe5cea94068ad64bdb67b9e5ca02 (diff)
downloadaur-c5d04b2762cb5ab357f13d36a9acd56f9cb44b87.tar.gz
fix errors
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD15
-rw-r--r--amcrest-desktop.sh20
3 files changed, 25 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3a481609d707..7866cb5eff50 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = amcrest-desktop-bin
pkgdesc = A simple Desktop application for Amcrest NVR, built using Electron.js
pkgver = 1.0.1
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/mikepruett3/amcrest-desktop
arch = x86_64
license = MIT
@@ -9,10 +9,10 @@ pkgbase = amcrest-desktop-bin
provides = amcrest-desktop=1.0.1
conflicts = amcrest-desktop
source = amcrest-desktop-1.0.1.deb::https://github.com/mikepruett3/amcrest-desktop/releases/download/v1.0.1/amcrest-desktop_1.0.1_amd64.deb
- source = LICENSE::https://raw.githubusercontent.com/mikepruett3/amcrest-desktop/v1.0.1/LICENSE
+ source = LICENSE-1.0.1::https://raw.githubusercontent.com/mikepruett3/amcrest-desktop/v1.0.1/LICENSE
source = amcrest-desktop.sh
sha256sums = e25fe0802fc45f037b1581641be4fba22e9233d890b3bc1be8dcf6c273a913bf
sha256sums = 82f04c17c97a90cb676f7eec2bdeca09cfff8a6779b310226d8e750a70abad79
- sha256sums = d55bb3160b4feb2b1bc23adc412e264c3c588e3afbdf694e9a6feea4da797469
+ sha256sums = 68521cf799a902fb3c86aa1ebdcfa92566ee49621b0e1db5873a0501d893b2e6
pkgname = amcrest-desktop-bin
diff --git a/PKGBUILD b/PKGBUILD
index 4ec3ff5f868f..3f50308079bb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,8 @@
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=amcrest-desktop-bin
pkgver=1.0.1
-pkgrel=3
+_electronversion=14
+pkgrel=4
pkgdesc="A simple Desktop application for Amcrest NVR, built using Electron.js"
arch=('x86_64')
url="https://github.com/mikepruett3/amcrest-desktop"
@@ -9,17 +10,21 @@ license=('MIT')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
- 'electron14'
+ "electron${_electronversion}"
)
source=(
"${pkgname%-bin}-${pkgver}.deb::${url}/releases/download/v${pkgver}/${pkgname%-bin}_${pkgver}_amd64.deb"
- "LICENSE::https://raw.githubusercontent.com/mikepruett3/amcrest-desktop/v${pkgver}/LICENSE"
+ "LICENSE-${pkgver}::https://raw.githubusercontent.com/mikepruett3/amcrest-desktop/v${pkgver}/LICENSE"
"${pkgname%-bin}.sh"
)
sha256sums=('e25fe0802fc45f037b1581641be4fba22e9233d890b3bc1be8dcf6c273a913bf'
'82f04c17c97a90cb676f7eec2bdeca09cfff8a6779b310226d8e750a70abad79'
- 'd55bb3160b4feb2b1bc23adc412e264c3c588e3afbdf694e9a6feea4da797469')
+ '68521cf799a902fb3c86aa1ebdcfa92566ee49621b0e1db5873a0501d893b2e6')
build() {
+ sed -e "s|@electronversion@|${_electronversion}|" \
+ -e "s|@appname@|${pkgname%-bin}|g" \
+ -e "s|@appasar@|app.asar|g" \
+ -i "${srcdir}/${pkgname%-bin}.sh"
bsdtar -xf "${srcdir}/data.tar.zst"
sed "s|${pkgname%-bin} %U|${pkgname%-bin}|g" -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop"
}
@@ -29,5 +34,5 @@ package() {
install -Dm644 "${srcdir}/usr/lib/${pkgname%-bin}/swiftshader/"* -t "${pkgdir}/usr/lib/${pkgname%-bin}/swiftshader"
install -Dm644 "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
install -Dm644 "${srcdir}/usr/share/pixmaps/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
- install -Dm644 "${srcdir}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -Dm644 "${srcdir}/LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
} \ No newline at end of file
diff --git a/amcrest-desktop.sh b/amcrest-desktop.sh
index ca9983959d35..98f84b151b4f 100644
--- a/amcrest-desktop.sh
+++ b/amcrest-desktop.sh
@@ -1,11 +1,15 @@
-#!/bin/bash
-_ELECTRON=/usr/bin/electron14
-APPDIR="/usr/lib/amcrest-desktop"
-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}" "$@"
else
- exec ${_ELECTRON} ${_ASAR} --no-sandbox "$@"
+ cd "${_APPDIR}"
+ exec electron@electronversion@ "${_ASAR}" --no-sandbox "$@"
fi \ No newline at end of file